mirror of https://github.com/snes9xgit/snes9x.git
Fix IRQ edge cases
This commit is contained in:
parent
ea09fef2b9
commit
0c74e2c437
|
@ -278,10 +278,11 @@ static inline void S9xCheckInterrupts (void)
|
||||||
if (CPU.IRQLine && thisIRQ)
|
if (CPU.IRQLine && thisIRQ)
|
||||||
CPU.IRQTransition = TRUE;
|
CPU.IRQTransition = TRUE;
|
||||||
|
|
||||||
if (PPU.HTimerEnabled)
|
int32 htimepos = PPU.HTimerEnabled ? PPU.HTimerPosition : 10;
|
||||||
|
|
||||||
|
if (thisIRQ)
|
||||||
{
|
{
|
||||||
int32 htimepos = PPU.HTimerPosition;
|
if (CPU.Cycles >= Timings.H_Max && htimepos < CPU.PrevCycles)
|
||||||
if (CPU.Cycles >= Timings.H_Max)
|
|
||||||
htimepos += Timings.H_Max;
|
htimepos += Timings.H_Max;
|
||||||
|
|
||||||
if (CPU.PrevCycles >= htimepos || CPU.Cycles < htimepos)
|
if (CPU.PrevCycles >= htimepos || CPU.Cycles < htimepos)
|
||||||
|
@ -291,7 +292,7 @@ static inline void S9xCheckInterrupts (void)
|
||||||
if (PPU.VTimerEnabled)
|
if (PPU.VTimerEnabled)
|
||||||
{
|
{
|
||||||
int32 vcounter = CPU.V_Counter;
|
int32 vcounter = CPU.V_Counter;
|
||||||
if (CPU.Cycles >= Timings.H_Max)
|
if (htimepos >= Timings.H_Max)
|
||||||
vcounter++;
|
vcounter++;
|
||||||
|
|
||||||
if (vcounter != PPU.VTimerPosition)
|
if (vcounter != PPU.VTimerPosition)
|
||||||
|
|
Loading…
Reference in New Issue