Skip to content

Commit 28709da

Browse files
committed
Add support for the 68533 image format
Closes #137.
1 parent f061180 commit 28709da

6 files changed

+28
-20
lines changed

.gitpod.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tasks:
2+
- init: nvm install && npm install && npm run build

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.15.0

dist/squeak_bundle.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@
14931493
}
14941494
};
14951495
// read version and determine endianness
1496-
var versions = [6501, 6502, 6504, 6505, 6521, 68000, 68002, 68003, 68021],
1496+
var versions = [6501, 6502, 6504, 6505, 6521, 68000, 68002, 68003, 68021, 68533],
14971497
version = 0,
14981498
fileHeaderSize = 0;
14991499
while (true) { // try all four endianness + header combos
@@ -1504,9 +1504,9 @@
15041504
if (!littleEndian) fileHeaderSize += 512;
15051505
if (fileHeaderSize > 512) throw Error("bad image version");
15061506
} this.version = version;
1507-
var nativeFloats = [6505, 6521, 68003, 68021].indexOf(version) >= 0;
1508-
this.hasClosures = [6504, 6505, 6521, 68002, 68003, 68021].indexOf(version) >= 0;
1509-
this.isSpur = [6521, 68021].indexOf(version) >= 0;
1507+
var nativeFloats = [6505, 6521, 68003, 68021, 68533].indexOf(version) >= 0;
1508+
this.hasClosures = [6504, 6505, 6521, 68002, 68003, 68021, 68533].indexOf(version) >= 0;
1509+
this.isSpur = [6521, 68021, 68533].indexOf(version) >= 0;
15101510
var is64Bit = version >= 68000;
15111511
if (is64Bit && !this.isSpur) throw Error("64 bit non-spur images not supported yet");
15121512
if (is64Bit) { readWord = readWord64; wordSize = 8; }
@@ -5438,7 +5438,7 @@
54385438
case 175: if (this.oldPrims) return this.namedPrimitive('SoundPlugin', 'primitiveSoundPlaySilence', argCount);
54395439
else return this.popNandPushIfOK(argCount+1, this.behaviorHash(this.stackNonInteger(0)));
54405440
case 176: if (this.oldPrims) return this.namedPrimitive('SoundGenerationPlugin', 'primWaveTableSoundmixSampleCountintostartingAtpan', argCount);
5441-
break; // fail
5441+
else return this.popNandPushIfOK(argCount+1, this.vm.image.isSpur ? 0x3FFFFF : 0xFFF); // primitiveMaxIdentityHash
54425442
case 177: if (this.oldPrims) return this.namedPrimitive('SoundGenerationPlugin', 'primFMSoundmixSampleCountintostartingAtpan', argCount);
54435443
return this.popNandPushIfOK(argCount+1, this.allInstancesOf(this.stackNonInteger(0)));
54445444
case 178: if (this.oldPrims) return this.namedPrimitive('SoundGenerationPlugin', 'primPluckedSoundmixSampleCountintostartingAtpan', argCount);
@@ -40050,6 +40050,10 @@
4005040050
from
4005140051
DeflatePlugin VMMaker-bf.353 uuid: 8ae25e7e-8d2c-451e-8277-598b30e9c002
4005240052
*/
40053+
/*
40054+
Manual fixes:
40055+
2022-01-15 VMMaker.oscog-mt.3135 and VMMaker.oscog-mt.3136
40056+
*/
4005340057

4005440058
(function ZipPlugin() {
4005540059

@@ -40302,7 +40306,7 @@
4030240306
}
4030340307

4030440308

40305-
/* Determine the inst size of the class above DeflateStream by
40309+
/* Determine the inst size of the class above InflateStream by
4030640310
looking for the first class whose inst size is less than 13. */
4030740311

4030840312
function determineSizeOfReadStream(rcvr) {
@@ -40578,8 +40582,8 @@
4057840582
/* zipWriteLimit := interpreterProxy fetchInteger: 3 ofObject: rcvr. */
4057940583

4058040584
zipReadLimit = interpreterProxy.fetchIntegerofObject(2, rcvr);
40581-
zipBitBuf = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 1, rcvr);
40582-
zipBitPos = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 2, rcvr);
40585+
zipBitBuf = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 0, rcvr);
40586+
zipBitPos = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 1, rcvr);
4058340587
return !interpreterProxy.failed();
4058440588
}
4058540589

@@ -40888,8 +40892,8 @@
4088840892
result = sendBlockwithwithwith(litStream, distStream, litTree, distTree);
4088940893
if (!interpreterProxy.failed()) {
4089040894
interpreterProxy.storeIntegerofObjectwithValue(1, rcvr, zipPosition);
40891-
interpreterProxy.storeIntegerofObjectwithValue(readStreamInstSize + 1, rcvr, zipBitBuf);
40892-
interpreterProxy.storeIntegerofObjectwithValue(readStreamInstSize + 2, rcvr, zipBitPos);
40895+
interpreterProxy.storeIntegerofObjectwithValue(writeStreamInstSize + 0, rcvr, zipBitBuf);
40896+
interpreterProxy.storeIntegerofObjectwithValue(writeStreamInstSize + 1, rcvr, zipBitPos);
4089340897
}
4089440898
if (!interpreterProxy.failed()) {
4089540899
interpreterProxy.pop(5);

dist/squeak_headless_bundle.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ Object.subclass('Squeak.Image',
14901490
}
14911491
};
14921492
// read version and determine endianness
1493-
var versions = [6501, 6502, 6504, 6505, 6521, 68000, 68002, 68003, 68021],
1493+
var versions = [6501, 6502, 6504, 6505, 6521, 68000, 68002, 68003, 68021, 68533],
14941494
version = 0,
14951495
fileHeaderSize = 0;
14961496
while (true) { // try all four endianness + header combos
@@ -1501,9 +1501,9 @@ Object.subclass('Squeak.Image',
15011501
if (!littleEndian) fileHeaderSize += 512;
15021502
if (fileHeaderSize > 512) throw Error("bad image version");
15031503
} this.version = version;
1504-
var nativeFloats = [6505, 6521, 68003, 68021].indexOf(version) >= 0;
1505-
this.hasClosures = [6504, 6505, 6521, 68002, 68003, 68021].indexOf(version) >= 0;
1506-
this.isSpur = [6521, 68021].indexOf(version) >= 0;
1504+
var nativeFloats = [6505, 6521, 68003, 68021, 68533].indexOf(version) >= 0;
1505+
this.hasClosures = [6504, 6505, 6521, 68002, 68003, 68021, 68533].indexOf(version) >= 0;
1506+
this.isSpur = [6521, 68021, 68533].indexOf(version) >= 0;
15071507
var is64Bit = version >= 68000;
15081508
if (is64Bit && !this.isSpur) throw Error("64 bit non-spur images not supported yet");
15091509
if (is64Bit) { readWord = readWord64; wordSize = 8; }
@@ -5435,7 +5435,7 @@ Object.subclass('Squeak.Primitives',
54355435
case 175: if (this.oldPrims) return this.namedPrimitive('SoundPlugin', 'primitiveSoundPlaySilence', argCount);
54365436
else return this.popNandPushIfOK(argCount+1, this.behaviorHash(this.stackNonInteger(0)));
54375437
case 176: if (this.oldPrims) return this.namedPrimitive('SoundGenerationPlugin', 'primWaveTableSoundmixSampleCountintostartingAtpan', argCount);
5438-
break; // fail
5438+
else return this.popNandPushIfOK(argCount+1, this.vm.image.isSpur ? 0x3FFFFF : 0xFFF); // primitiveMaxIdentityHash
54395439
case 177: if (this.oldPrims) return this.namedPrimitive('SoundGenerationPlugin', 'primFMSoundmixSampleCountintostartingAtpan', argCount);
54405440
return this.popNandPushIfOK(argCount+1, this.allInstancesOf(this.stackNonInteger(0)));
54415441
case 178: if (this.oldPrims) return this.namedPrimitive('SoundGenerationPlugin', 'primPluckedSoundmixSampleCountintostartingAtpan', argCount);

package-lock.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vm.image.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Object.subclass('Squeak.Image',
114114
}
115115
};
116116
// read version and determine endianness
117-
var versions = [6501, 6502, 6504, 6505, 6521, 68000, 68002, 68003, 68021],
117+
var versions = [6501, 6502, 6504, 6505, 6521, 68000, 68002, 68003, 68021, 68533],
118118
version = 0,
119119
fileHeaderSize = 0;
120120
while (true) { // try all four endianness + header combos
@@ -126,9 +126,9 @@ Object.subclass('Squeak.Image',
126126
if (fileHeaderSize > 512) throw Error("bad image version");
127127
};
128128
this.version = version;
129-
var nativeFloats = [6505, 6521, 68003, 68021].indexOf(version) >= 0;
130-
this.hasClosures = [6504, 6505, 6521, 68002, 68003, 68021].indexOf(version) >= 0;
131-
this.isSpur = [6521, 68021].indexOf(version) >= 0;
129+
var nativeFloats = [6505, 6521, 68003, 68021, 68533].indexOf(version) >= 0;
130+
this.hasClosures = [6504, 6505, 6521, 68002, 68003, 68021, 68533].indexOf(version) >= 0;
131+
this.isSpur = [6521, 68021, 68533].indexOf(version) >= 0;
132132
var is64Bit = version >= 68000;
133133
if (is64Bit && !this.isSpur) throw Error("64 bit non-spur images not supported yet");
134134
if (is64Bit) { readWord = readWord64; wordSize = 8; }

0 commit comments

Comments
 (0)