diff --git a/cpuexec.cpp b/cpuexec.cpp index 358d0f00..cdcc2a91 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -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--; diff --git a/ppu.cpp b/ppu.cpp index 4a2578dd..9cab99f1 100644 --- a/ppu.cpp +++ b/ppu.cpp @@ -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 {