@gaialabs/core 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -28,7 +28,12 @@ var QuintetLZ = class _QuintetLZ {
28
28
  dictionary.fill(_QuintetLZ.DICTIONARY_INIT);
29
29
  let dictPosition = _QuintetLZ.DICTIONARY_OFFSET;
30
30
  let outPosition = 0;
31
- const dstLen = bitStream.readShort();
31
+ let dstLen = bitStream.readShort();
32
+ if (dstLen === 0) {
33
+ return srcData.slice(srcPosition + 2, srcStop);
34
+ } else if (dstLen & 32768) {
35
+ dstLen = 65536 - dstLen;
36
+ }
32
37
  const outBuffer = new Uint8Array(dstLen);
33
38
  while (bitStream.currentPosition < srcStop && outPosition < dstLen) {
34
39
  if (bitStream.readBit()) {
@@ -859,7 +864,7 @@ var AddressingModeHandler = class {
859
864
  if (addr.isROM) {
860
865
  const wrapper = new LocationWrapper(addr.toInt(), AddressType.Offset);
861
866
  if (isJump) {
862
- const type = isIndexedIndirect ? "*Code" : "Code";
867
+ const type = isIndexedIndirect ? "&Code" : "Code";
863
868
  const name = this._blockReader.noteType(wrapper.location, type, isPush, registers);
864
869
  if (isPush) {
865
870
  operands.push(`&${name}-1`);
@@ -3780,7 +3785,7 @@ var RomGenerator = class {
3780
3785
  }
3781
3786
  async writeRom(blockLookup, entryPoints, chunkFiles, asmFiles) {
3782
3787
  const romWriter = new RomWriter(entryPoints, "GAIALABS", "01JG ");
3783
- for (const file of chunkFiles.sort((a, b) => a.location - b.location)) await romWriter.writeFile(file, blockLookup);
3788
+ for (const file of chunkFiles) await romWriter.writeFile(file, blockLookup);
3784
3789
  romWriter.writeHeader();
3785
3790
  romWriter.writeEntryPoints(asmFiles);
3786
3791
  romWriter.writeChecksum();