Some simplification.

This commit is contained in:
Brandon Wright 2018-06-01 15:34:51 -05:00
parent f70592df90
commit c4cf40c509

View File

@ -242,8 +242,14 @@ void S9xMainLoop (void)
}
}
if (CPU.IRQTransition)
if ((CPU.Cycles >= Timings.NextIRQTimer))
{
S9xUpdateIRQPositions();
#ifdef DEBUGGER
S9xTraceMessage ("Timer triggered\n");
#endif
if (CPU.WaitingForInterrupt)
{
CPU.WaitingForInterrupt = FALSE;
@ -253,20 +259,9 @@ void S9xMainLoop (void)
S9xDoHEventProcessing();
}
CPU.IRQTransition = FALSE;
CPU.IRQLine = TRUE;
}
if ((CPU.Cycles >= Timings.NextIRQTimer) && !CPU.IRQLine && !CPU.IRQTransition)
{
S9xUpdateIRQPositions();
#ifdef DEBUGGER
S9xTraceMessage ("Timer triggered\n");
#endif
CPU.IRQTransition = TRUE;
}
if ((CPU.IRQLine || CPU.IRQExternal) && !CheckFlag(IRQ))
{
/* The flag pushed onto the stack is the new value */