@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.js CHANGED
@@ -30,7 +30,12 @@ var QuintetLZ = class _QuintetLZ {
30
30
  dictionary.fill(_QuintetLZ.DICTIONARY_INIT);
31
31
  let dictPosition = _QuintetLZ.DICTIONARY_OFFSET;
32
32
  let outPosition = 0;
33
- const dstLen = bitStream.readShort();
33
+ let dstLen = bitStream.readShort();
34
+ if (dstLen === 0) {
35
+ return srcData.slice(srcPosition + 2, srcStop);
36
+ } else if (dstLen & 32768) {
37
+ dstLen = 65536 - dstLen;
38
+ }
34
39
  const outBuffer = new Uint8Array(dstLen);
35
40
  while (bitStream.currentPosition < srcStop && outPosition < dstLen) {
36
41
  if (bitStream.readBit()) {
@@ -861,7 +866,7 @@ var AddressingModeHandler = class {
861
866
  if (addr.isROM) {
862
867
  const wrapper = new shared.LocationWrapper(addr.toInt(), shared.AddressType.Offset);
863
868
  if (isJump) {
864
- const type = isIndexedIndirect ? "*Code" : "Code";
869
+ const type = isIndexedIndirect ? "&Code" : "Code";
865
870
  const name = this._blockReader.noteType(wrapper.location, type, isPush, registers);
866
871
  if (isPush) {
867
872
  operands.push(`&${name}-1`);
@@ -3782,7 +3787,7 @@ var RomGenerator = class {
3782
3787
  }
3783
3788
  async writeRom(blockLookup, entryPoints, chunkFiles, asmFiles) {
3784
3789
  const romWriter = new RomWriter(entryPoints, "GAIALABS", "01JG ");
3785
- for (const file of chunkFiles.sort((a, b) => a.location - b.location)) await romWriter.writeFile(file, blockLookup);
3790
+ for (const file of chunkFiles) await romWriter.writeFile(file, blockLookup);
3786
3791
  romWriter.writeHeader();
3787
3792
  romWriter.writeEntryPoints(asmFiles);
3788
3793
  romWriter.writeChecksum();