Skip to content

Commit

Permalink
Remove apparent econet bad merge duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgodbolt committed Dec 24, 2023
1 parent 9457862 commit ae57064
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions 6502.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,24 +760,6 @@ export class Cpu6502 extends Base6502 {
}
}

if (this.econet) {
if ((!this.model.isMaster && addr === 0xfe20) || (this.model.isMaster && addr === 0xfe3c)) {
if (!this.econet.econetNMIEnabled) {
// was off
this.econet.econetNMIEnabled = true;
if (this.econet.ADLC.status1 & 128) {
// irq pending
this.NMI(true); // delayed NMI asserted
}
}
}

if ((!this.model.isMaster && addr === 0xfe18) || (this.model.isMaster && addr === 0xfe38)) {
this.econet.econetNMIEnabled = false;
return this.econet.stationId;
}
}

switch (addr & ~0x0003) {
case 0xfc10:
if (this.model.hasTeletextAdaptor) return this.teletextAdaptor.read(addr - 0xfc10);
Expand Down Expand Up @@ -948,13 +930,6 @@ export class Cpu6502 extends Base6502 {
}
}

if (this.econet) {
if (addr >= 0xfea0 && addr < 0xfebf) {
this.econet.writeRegister(addr & 3, b);
return;
}
}

switch (addr & ~0x0003) {
case 0xfc10:
if (this.model.hasTeletextAdaptor) return this.teletextAdaptor.write(addr - 0xfc10, b);
Expand Down Expand Up @@ -1048,6 +1023,17 @@ export class Cpu6502 extends Base6502 {
case 0xfe9c:
if (!this.model.isMaster) return this.fdc.write(addr, b);
break;

case 0xfea0:
case 0xfea4:
case 0xfea8:
case 0xfeac:
case 0xfeb0:
case 0xfeb4:
case 0xfeb8:
case 0xfebc:
if (this.econet) this.econet.writeRegister(addr & 3, b);
break;
case 0xfec0:
case 0xfec4:
case 0xfec8:
Expand Down

0 comments on commit ae57064

Please sign in to comment.