mirror of https://github.com/snes9xgit/snes9x.git
Bound late NMI trigger to last half of scanline. Be more careful setting trigger position.
This commit is contained in:
parent
7f88063b84
commit
8c47efb89a
12
cpuexec.cpp
12
cpuexec.cpp
|
@ -413,7 +413,7 @@ void S9xDoHEventProcessing (void)
|
|||
}
|
||||
|
||||
/* Did we skip over a late NMI Trigger Pos? If so, reschedule it immediately. */
|
||||
if (CPU.NMIPending && (CPU.Cycles >= Timings.NMITriggerPos))
|
||||
if (CPU.NMIPending && (CPU.Cycles >= Timings.NMITriggerPos) && (Timings.NMITriggerPos > Timings.H_Max / 2))
|
||||
Timings.NMITriggerPos = 0;
|
||||
|
||||
S9xAPUEndScanline();
|
||||
|
@ -421,16 +421,6 @@ void S9xDoHEventProcessing (void)
|
|||
CPU.PrevCycles -= Timings.H_Max;
|
||||
S9xAPUSetReferenceTime(CPU.Cycles);
|
||||
|
||||
if ((Timings.NMITriggerPos != 0xffff) && (Timings.NMITriggerPos >= Timings.H_Max))
|
||||
{
|
||||
Timings.NMITriggerPos -= Timings.H_Max;
|
||||
#ifdef DEBUGGER
|
||||
if (Settings.TraceHCEvent)
|
||||
S9xTraceFormattedMessage ("NMI Trigger pos changed to %d\n", Timings.NMITriggerPos);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
CPU.V_Counter++;
|
||||
if (CPU.V_Counter >= Timings.V_Max) // V ranges from 0 to Timings.V_Max - 1
|
||||
{
|
||||
|
|
2
ppu.cpp
2
ppu.cpp
|
@ -1520,6 +1520,8 @@ void S9xSetCPU (uint8 Byte, uint16 Address)
|
|||
// then, when to call S9xOpcode_NMI()?
|
||||
CPU.NMIPending = TRUE;
|
||||
Timings.NMITriggerPos = CPU.Cycles + 6 + 6;
|
||||
if (Timings.NMITriggerPOS >= Timings.H_Max)
|
||||
Timings.NMITriggerPOS -= Timings.H_Max;
|
||||
|
||||
#ifdef DEBUGGER
|
||||
if (Settings.TraceHCEvent)
|
||||
|
|
Loading…
Reference in New Issue