mirror of https://github.com/stella-emu/stella.git
removed interrupt handling code
This commit is contained in:
parent
5d1f4a2a0e
commit
1a16d3633f
|
@ -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<uInt16>(mySystem->peek(0xFFFE)) | (static_cast<uInt16>(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<uInt16>(mySystem->peek(0xFFFA)) | (static_cast<uInt16>(mySystem->peek(0xFFFB)) << 8);
|
||||
}
|
||||
|
||||
// Clear the interrupt bits in myExecutionStatus
|
||||
myExecutionStatus &= ~(MaskableInterruptBit | NonmaskableInterruptBit);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool M6502::save(Serializer& out) const
|
||||
{
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
Loading…
Reference in New Issue