diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index dd01f9d18..76dd0320a 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -417,15 +417,6 @@ inline void M6502::_execute(uInt64 cycles, DispatchResult& result) #endif } - // JTZ, TODO: This code seems to be superfluous for a 6507: - // See if we need to handle an interrupt - if((myExecutionStatus & MaskableInterruptBit) || - (myExecutionStatus & NonmaskableInterruptBit)) - { - // Yes, so handle the interrupt - interruptHandler(); - } - // See if a fatal error has occurred if(myExecutionStatus & FatalErrorBit) { @@ -450,34 +441,6 @@ inline void M6502::_execute(uInt64 cycles, DispatchResult& result) } } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void M6502::interruptHandler() -{ - // Handle the interrupt - if((myExecutionStatus & MaskableInterruptBit) && !I) - { - mySystem->incrementCycles(7 * SYSTEM_CYCLES_PER_CPU); - mySystem->poke(0x0100 + SP--, (PC - 1) >> 8); - mySystem->poke(0x0100 + SP--, (PC - 1) & 0x00ff); - mySystem->poke(0x0100 + SP--, PS() & (~0x10)); - D = false; - I = true; - PC = static_cast(mySystem->peek(0xFFFE)) | (static_cast(mySystem->peek(0xFFFF)) << 8); - } - else if(myExecutionStatus & NonmaskableInterruptBit) - { - mySystem->incrementCycles(7 * SYSTEM_CYCLES_PER_CPU); - mySystem->poke(0x0100 + SP--, (PC - 1) >> 8); - mySystem->poke(0x0100 + SP--, (PC - 1) & 0x00ff); - mySystem->poke(0x0100 + SP--, PS() & (~0x10)); - D = false; - PC = static_cast(mySystem->peek(0xFFFA)) | (static_cast(mySystem->peek(0xFFFB)) << 8); - } - - // Clear the interrupt bits in myExecutionStatus - myExecutionStatus &= ~(MaskableInterruptBit | NonmaskableInterruptBit); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool M6502::save(Serializer& out) const { diff --git a/src/emucore/M6502.hxx b/src/emucore/M6502.hxx index 41db16372..0e0fad082 100644 --- a/src/emucore/M6502.hxx +++ b/src/emucore/M6502.hxx @@ -83,16 +83,6 @@ class M6502 : public Serializable */ void reset(); - /** - Request a maskable interrupt - */ - void irq() { myExecutionStatus |= MaskableInterruptBit; } - - /** - Request a non-maskable interrupt - */ - void nmi() { myExecutionStatus |= NonmaskableInterruptBit; } - /** Set the callback for handling a halt condition */ @@ -330,11 +320,6 @@ class M6502 : public Serializable C = ps & 0x01; } - /** - Called after an interrupt has be requested using irq() or nmi() - */ - void interruptHandler(); - /** Check whether halt was requested (RDY low) and notify */ @@ -362,9 +347,7 @@ class M6502 : public Serializable */ static constexpr uInt8 StopExecutionBit = 0x01, - FatalErrorBit = 0x02, - MaskableInterruptBit = 0x04, - NonmaskableInterruptBit = 0x08 + FatalErrorBit = 0x02 ; uInt8 myExecutionStatus{0};