fix IRQ v-counter edge case

This commit is contained in:
OV2 2012-08-12 21:10:00 +02:00
parent 3c8804d6ca
commit ef683d61c6
1 changed files with 4 additions and 1 deletions

View File

@ -291,8 +291,11 @@ static inline void S9xCheckInterrupts (void)
if (PPU.VTimerEnabled)
{
int32 vcounter = CPU.V_Counter;
if (CPU.Cycles >= Timings.H_Max && (!PPU.HTimerEnabled || PPU.HTimerPosition < CPU.PrevCycles))
if (CPU.Cycles >= Timings.H_Max && (!PPU.HTimerEnabled || PPU.HTimerPosition < CPU.PrevCycles)) {
vcounter++;
if(vcounter >= Timings.V_Max)
vcounter = 0;
}
if (vcounter != PPU.VTimerPosition)
thisIRQ = FALSE;