mirror of
https://github.com/libretro/snes9x.git
synced 2024-11-23 16:29:41 +00:00
Fix a couple IRQ problems.
This commit is contained in:
parent
c96f6cd913
commit
d27d9b6dbd
2
cpu.cpp
2
cpu.cpp
@ -266,7 +266,7 @@ static void S9xSoftResetCPU (void)
|
||||
Timings.H_Max = Timings.H_Max_Master;
|
||||
Timings.V_Max = Timings.V_Max_Master;
|
||||
Timings.NMITriggerPos = 0xffff;
|
||||
Timings.NextIRQTimer = 0xffff;
|
||||
Timings.NextIRQTimer = 0x0fffffff;
|
||||
if (Model->_5A22 == 2)
|
||||
Timings.WRAMRefreshPos = SNES_WRAM_REFRESH_HC_v2;
|
||||
else
|
||||
|
@ -417,7 +417,7 @@ void S9xDoHEventProcessing (void)
|
||||
CPU.Cycles -= Timings.H_Max;
|
||||
if (Timings.NMITriggerPos != 0xffff)
|
||||
Timings.NMITriggerPos -= Timings.H_Max;
|
||||
if (Timings.NextIRQTimer != 0xffff)
|
||||
if (Timings.NextIRQTimer != 0xffffffff)
|
||||
Timings.NextIRQTimer -= Timings.H_Max;
|
||||
S9xAPUSetReferenceTime(CPU.Cycles);
|
||||
|
||||
|
10
ppu.cpp
10
ppu.cpp
@ -329,13 +329,19 @@ void S9xUpdateIRQPositions (void)
|
||||
|
||||
if (!PPU.HTimerEnabled && !PPU.VTimerEnabled)
|
||||
{
|
||||
Timings.NextIRQTimer = 0xffff;
|
||||
Timings.NextIRQTimer = 0x0fffffff;
|
||||
}
|
||||
else if (PPU.HTimerEnabled && !PPU.VTimerEnabled)
|
||||
{
|
||||
Timings.NextIRQTimer = PPU.HTimerPosition - CPU.Cycles;
|
||||
if (Timings.NextIRQTimer < 0)
|
||||
Timings.NextIRQTimer += Timings.H_Max;
|
||||
}
|
||||
else
|
||||
{
|
||||
Timings.NextIRQTimer =
|
||||
CyclesUntilNext (PPU.HTimerEnabled ? PPU.HTimerPosition : 0,
|
||||
PPU.VTimerEnabled ? PPU.VTimerPosition : 0);
|
||||
PPU.VTimerPosition);
|
||||
}
|
||||
#ifdef DEBUGGER
|
||||
S9xTraceFormattedMessage("--- IRQ Timer set HTimer:%d Pos:%04d VTimer:%d Pos:%03d",
|
||||
|
Loading…
Reference in New Issue
Block a user