mirror of https://github.com/snes9xgit/snes9x.git
Change NextTimer to NextIRQTimer. Don't subtract a dot in interlaced mode.
This commit is contained in:
parent
3553650469
commit
f1cab4ab17
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.NextTimer = 0xffff;
|
||||
Timings.NextIRQTimer = 0xffff;
|
||||
if (Model->_5A22 == 2)
|
||||
Timings.WRAMRefreshPos = SNES_WRAM_REFRESH_HC_v2;
|
||||
else
|
||||
|
|
|
@ -229,7 +229,7 @@ void S9xMainLoop (void)
|
|||
}
|
||||
}
|
||||
|
||||
if (CPU.Cycles >= Timings.NextTimer || CPU.IRQExternal)
|
||||
if (CPU.Cycles >= Timings.NextIRQTimer || CPU.IRQExternal)
|
||||
{
|
||||
if (CPU.IRQPending)
|
||||
CPU.IRQPending--;
|
||||
|
@ -417,8 +417,8 @@ void S9xDoHEventProcessing (void)
|
|||
CPU.Cycles -= Timings.H_Max;
|
||||
if (Timings.NMITriggerPos != 0xffff)
|
||||
Timings.NMITriggerPos -= Timings.H_Max;
|
||||
if (Timings.NextTimer != 0xffff)
|
||||
Timings.NextTimer -= Timings.H_Max;
|
||||
if (Timings.NextIRQTimer != 0xffff)
|
||||
Timings.NextIRQTimer -= Timings.H_Max;
|
||||
S9xAPUSetReferenceTime(CPU.Cycles);
|
||||
|
||||
CPU.V_Counter++;
|
||||
|
|
10
ppu.cpp
10
ppu.cpp
|
@ -288,17 +288,17 @@ static int CyclesUntilNext (int hc, int vc)
|
|||
// Add number of lines
|
||||
total += (vc - vpos) * Timings.H_Max;
|
||||
// If line 240 is in there and we're odd, subtract a dot
|
||||
if (vpos <= 240 && vc > 240 && Timings.InterlaceField)
|
||||
if (vpos <= 240 && vc > 240 && Timings.InterlaceField & !IPPU.Interlace)
|
||||
total -= ONE_DOT_CYCLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
total += (Timings.V_Max - vpos) * Timings.H_Max;
|
||||
if (vpos <= 240 && Timings.InterlaceField)
|
||||
if (vpos <= 240 && Timings.InterlaceField && !IPPU.Interlace)
|
||||
total -= ONE_DOT_CYCLE;
|
||||
|
||||
total += (vc) * Timings.H_Max;
|
||||
if (vc > 240 && !Timings.InterlaceField)
|
||||
if (vc > 240 && !Timings.InterlaceField && !IPPU.Interlace)
|
||||
total -= ONE_DOT_CYCLE;
|
||||
}
|
||||
|
||||
|
@ -329,11 +329,11 @@ void S9xUpdateIRQPositions (void)
|
|||
|
||||
if (!PPU.HTimerEnabled && !PPU.VTimerEnabled)
|
||||
{
|
||||
Timings.NextTimer = 0xffff;
|
||||
Timings.NextIRQTimer = 0xffff;
|
||||
}
|
||||
else
|
||||
{
|
||||
Timings.NextTimer =
|
||||
Timings.NextIRQTimer =
|
||||
CyclesUntilNext (PPU.HTimerEnabled ? PPU.HTimerPosition : 0,
|
||||
PPU.VTimerEnabled ? PPU.VTimerPosition : 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue