Reroll IRQ edge case fix

This commit is contained in:
OV2 2012-06-04 21:31:27 +02:00
parent 679db377c7
commit a08f4fb531
1 changed files with 3 additions and 4 deletions

View File

@ -278,10 +278,9 @@ static inline void S9xCheckInterrupts (void)
if (CPU.IRQLine && thisIRQ)
CPU.IRQTransition = TRUE;
int32 htimepos = PPU.HTimerEnabled ? PPU.HTimerPosition : 10;
if (thisIRQ)
if (PPU.HTimerEnabled)
{
int32 htimepos = PPU.HTimerPosition;
if (CPU.Cycles >= Timings.H_Max && htimepos < CPU.PrevCycles)
htimepos += Timings.H_Max;
@ -292,7 +291,7 @@ static inline void S9xCheckInterrupts (void)
if (PPU.VTimerEnabled)
{
int32 vcounter = CPU.V_Counter;
if (htimepos >= Timings.H_Max)
if (CPU.Cycles >= Timings.H_Max && (!PPU.HTimerEnabled || PPU.HTimerPosition < CPU.PrevCycles))
vcounter++;
if (vcounter != PPU.VTimerPosition)