@gaialabs/core 0.1.12 → 0.1.14
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 +13 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -715,9 +715,11 @@ var AddressingModeHandler = class {
|
|
|
715
715
|
case "Immediate":
|
|
716
716
|
this.handleImmediateMode(code.mnem, context.size, operands, reg);
|
|
717
717
|
break;
|
|
718
|
+
case "AbsoluteIndexedIndirect":
|
|
719
|
+
this.handleAbsoluteMode(code.mnem, void 0, context.nextAddress, reg.dataBank, operands, reg, true);
|
|
720
|
+
break;
|
|
718
721
|
case "AbsoluteIndirect":
|
|
719
722
|
case "AbsoluteIndirectLong":
|
|
720
|
-
case "AbsoluteIndexedIndirect":
|
|
721
723
|
case "Absolute":
|
|
722
724
|
case "AbsoluteIndexedX":
|
|
723
725
|
case "AbsoluteIndexedY":
|
|
@@ -847,19 +849,20 @@ var AddressingModeHandler = class {
|
|
|
847
849
|
const stackOperations = new StackOperations(reg, this._blockReader);
|
|
848
850
|
stackOperations.handleStackOperation(mnemonic);
|
|
849
851
|
}
|
|
850
|
-
handleAbsoluteMode(mnemonic, xBank1, next, dataBank, operands, registers) {
|
|
852
|
+
handleAbsoluteMode(mnemonic, xBank1, next, dataBank, operands, registers, isIndexedIndirect = false) {
|
|
851
853
|
let refLoc = this._dataReader.readUShort();
|
|
852
854
|
const isPush = this.isPushInstruction(mnemonic);
|
|
853
855
|
if (isPush) {
|
|
854
856
|
refLoc++;
|
|
855
857
|
}
|
|
856
|
-
const isJump = isPush || this.isJumpInstruction(mnemonic);
|
|
858
|
+
const isJump = isPush || isIndexedIndirect || this.isJumpInstruction(mnemonic);
|
|
857
859
|
const bank = xBank1 ?? (isJump ? this._dataReader.position >> 16 : dataBank ?? 129);
|
|
858
860
|
const addr = new shared.Address(bank, refLoc);
|
|
859
861
|
if (addr.isROM) {
|
|
860
862
|
const wrapper = new shared.LocationWrapper(addr.toInt(), shared.AddressType.Offset);
|
|
861
863
|
if (isJump) {
|
|
862
|
-
const
|
|
864
|
+
const type = isIndexedIndirect ? "*Code" : "Code";
|
|
865
|
+
const name = this._blockReader.noteType(wrapper.location, type, isPush, registers);
|
|
863
866
|
if (isPush) {
|
|
864
867
|
operands.push(`&${name}-1`);
|
|
865
868
|
return;
|
|
@@ -2668,11 +2671,15 @@ var RomWriter = class {
|
|
|
2668
2671
|
}
|
|
2669
2672
|
writeChecksum() {
|
|
2670
2673
|
const buf = this.outBuffer;
|
|
2674
|
+
buf[65500] = 255;
|
|
2675
|
+
buf[65501] = 255;
|
|
2676
|
+
buf[65502] = 0;
|
|
2677
|
+
buf[65503] = 0;
|
|
2671
2678
|
let sum = 0;
|
|
2672
|
-
for (let i = 0; i < buf.length; i++) sum += buf[i]
|
|
2679
|
+
for (let i = 0; i < buf.length; i++) sum += buf[i];
|
|
2673
2680
|
buf[65502] = sum & 255;
|
|
2674
2681
|
buf[65503] = sum >> 8 & 255;
|
|
2675
|
-
const comp = ~sum
|
|
2682
|
+
const comp = ~sum;
|
|
2676
2683
|
buf[65500] = comp & 255;
|
|
2677
2684
|
buf[65501] = comp >> 8 & 255;
|
|
2678
2685
|
}
|