From 2d8ea8a989febb3c0e0c501c18a17c413df76028 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sat, 3 Jul 2021 20:43:53 -0400 Subject: [PATCH] NESHawk: fix MMC5 IRQ timing, fixes #2036 --- .../Consoles/Nintendo/NES/Boards/ExROM.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs index 07fec3d7e7..3302df5404 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/ExROM.cs @@ -669,10 +669,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES public override void ClockPpu() { - if (NES.ppu.ppur.status.cycle != 336) + if (NES.ppu.ppur.status.cycle != 3) return; - int sl = NES.ppu.ppur.status.sl + 1; + int sl = NES.ppu.ppur.status.sl; if (!NES.ppu.PPUON || sl >= 241) { @@ -695,7 +695,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES else { irq_counter++; - if (irq_counter == irq_target) + if (irq_counter == (irq_target + 1)) { irq_pending = true; SyncIRQ();