From 92d4e1bd175a1a6c2237bef6f2a69152cf2704cb Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sun, 16 Oct 2016 17:25:13 -0400 Subject: [PATCH] Fix power up behaviour (and Dragon Slayer IV) Power up timing is now consistent with all know information regarding VBlank timing and initial state. This is mostly thanks to True's console testing of Battletoads, which happens to require exacting timing to sync. However, Dragon Slayer 4 requires writes to $2000 to be recognized well before the PPU is initialized, and even blargg states that this should not be the case. Since the game obviously is supposed to run, I have removed all write ignore code until more testing can be done. --- .../Consoles/Nintendo/NES/PPU.regs.cs | 6 ++---- .../Consoles/Nintendo/NES/PPU.run.cs | 15 +++------------ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs index cf7b5efac5..53bc2abd6a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.regs.cs @@ -340,11 +340,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES if (!reg_2000.vblank_nmi_gen & ((value & 0x80) != 0) && (Reg2002_vblank_active) && !Reg2002_vblank_clear_pending) { //if we just unleashed the vblank interrupt then activate it now - if (ppudead<=1) - NMI_PendingInstructions = 2; + NMI_PendingInstructions = 2; } - if (ppudead<=1) - reg_2000.Value = value; + reg_2000.Value = value; } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs index 5ba98ab505..74a1986046 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.run.cs @@ -638,18 +638,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES //register before around a full frame, but no games //should write to those regs during that time, it needs //to wait for vblank - if (ppudead < 2) - { - ppur.status.sl = 241; - runppu(3); - //Reg2002_vblank_active = true; - runppu(3); - runppu(postNMIlines * kLineTime - 6); - ppur.status.sl = 0; - //clear_2002(); - } - runppu(241 * kLineTime); - runppu(preNMIlines * kLineTime); + + runppu(241 * kLineTime-7*3); + //runppu(preNMIlines * kLineTime); --ppudead; } }