diff --git a/cpuexec.cpp b/cpuexec.cpp index 768a2a4d..ef1e03bd 100644 --- a/cpuexec.cpp +++ b/cpuexec.cpp @@ -412,13 +412,11 @@ void S9xDoHEventProcessing (void) SuperFX.oneLineDone = FALSE; } - /* Did we skip over a late NMI Trigger Pos? If so, reschedule it immediately. */ - if (CPU.NMIPending && (CPU.Cycles >= Timings.NMITriggerPos) && (Timings.NMITriggerPos > Timings.H_Max / 2)) - Timings.NMITriggerPos = 0; - S9xAPUEndScanline(); CPU.Cycles -= Timings.H_Max; CPU.PrevCycles -= Timings.H_Max; + if (Timings.NMITriggerPos != 0xffff) + Timings.NMITriggerPos -= Timings.H_Max; S9xAPUSetReferenceTime(CPU.Cycles); CPU.V_Counter++; diff --git a/dma.cpp b/dma.cpp index ef617860..b079b8cc 100644 --- a/dma.cpp +++ b/dma.cpp @@ -1291,8 +1291,6 @@ bool8 S9xDoDMA (uint8 Channel) if (CPU.NMIPending && (Timings.NMITriggerPos != 0xffff)) { Timings.NMITriggerPos = CPU.Cycles + Timings.NMIDMADelay; - if (Timings.NMITriggerPos >= Timings.H_Max) - Timings.NMITriggerPos -= Timings.H_Max; } // Release the memory used in SPC7110 DMA diff --git a/ppu.cpp b/ppu.cpp index 8b168403..4d05d512 100644 --- a/ppu.cpp +++ b/ppu.cpp @@ -1520,8 +1520,6 @@ 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) @@ -1798,6 +1796,7 @@ uint8 S9xGetCPU (uint16 Address) byte = CPU.IRQLine ? 0x80 : 0; CPU.IRQLine = FALSE; CPU.IRQTransition = FALSE; + return (byte | (OpenBus & 0x7f)); case 0x4212: // HVBJOY