From ebdb244714370872190878ccfcf483f191b63100 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 28 Jun 2017 10:24:19 -0500 Subject: [PATCH] NESHawk - a small speedup (a few fps) - don't call Board.ClockPPU unless it is implemented --- .../Consoles/Nintendo/NES/NES.BoardSystem.cs | 1 + BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs index ce5c62bc3f..d4486394b3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.BoardSystem.cs @@ -404,6 +404,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES } Board.Dispose(); Board = newboard; + ppu.HasClockPPU = Board.GetType().GetMethod(nameof(INESBoard.ClockPPU)).DeclaringType != typeof(NESBoardBase); } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs index ebf93f8361..1e749f7c1c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs @@ -8,6 +8,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES { public int cpu_step, cpu_stepcounter; + public bool HasClockPPU = false; + // this only handles region differences within the PPU int preNMIlines; int postNMIlines; @@ -333,7 +335,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES Reg2002_vblank_clear_pending = false; } - nes.Board.ClockPPU(); + if (HasClockPPU) + { + nes.Board.ClockPPU(); + } } } }