Fix some IRQ bits.

This commit is contained in:
Brandon Wright 2018-05-26 17:02:57 -05:00
parent 0d1bd3f5ae
commit 37954fe510
2 changed files with 3 additions and 3 deletions

View File

@ -229,7 +229,7 @@ void S9xMainLoop (void)
}
}
if (CPU.Cycles >= Timings.NextIRQTimer || CPU.IRQExternal)
if ((CPU.Cycles >= Timings.NextIRQTimer || CPU.IRQExternal) && !CPU.IRQLine)
{
if (CPU.IRQPending)
CPU.IRQPending--;

View File

@ -312,7 +312,7 @@ void S9xUpdateIRQPositions (void)
PPU.VTimerPosition = PPU.IRQVBeamPos;
if ((PPU.HTimerPosition >= Timings.H_Max) && (PPU.IRQHBeamPos < 340))
if ((PPU.HTimerPosition >= Timings.H_Max) && (PPU.IRQHBeamPos < 340) && PPU.HTimerEnabled)
{
PPU.HTimerPosition -= Timings.H_Max;
PPU.VTimerPosition++;
@ -336,7 +336,7 @@ void S9xUpdateIRQPositions (void)
if (CPU.V_Counter == PPU.VTimerPosition)
Timings.NextIRQTimer = 0;
else
Timings.NextIRQTimer = CyclesUntilNext (0, PPU.VTimerPosition);
Timings.NextIRQTimer = CyclesUntilNext (ONE_DOT_CYCLE + Timings.IRQTriggerCycles, PPU.VTimerPosition);
}
else
{