From 2d2a04f5f9395a1da1d27bb23db2f1c8f508e1b6 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 24 Jan 2015 14:16:15 +0000 Subject: [PATCH] PCEngine - check if MemoryExecute callbacks exist before calling them, provides a noticeable speedup, also update the cpu generator code --- BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs | 3 ++- CpuCoreGenerator/HuC6280/CoreGenerator.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs b/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs index 3b918732fa..73046df20c 100644 --- a/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs @@ -59,7 +59,8 @@ namespace BizHawk.Emulation.Cores.Components.H6280 LagIFlag = FlagI; if (Debug) Logger(State()); - Core.MemoryCallbacks.CallExecutes(PC); + if (Core.MemoryCallbacks.HasExecutes) { Core.MemoryCallbacks.CallExecutes(PC); } + if (CDLLoggingActive) CDLOpcode(); byte opcode = ReadMemory(PC++); diff --git a/CpuCoreGenerator/HuC6280/CoreGenerator.cs b/CpuCoreGenerator/HuC6280/CoreGenerator.cs index f5713075cd..1793f2c2b9 100644 --- a/CpuCoreGenerator/HuC6280/CoreGenerator.cs +++ b/CpuCoreGenerator/HuC6280/CoreGenerator.cs @@ -494,8 +494,8 @@ namespace HuC6280 w.WriteLine(" LagIFlag = FlagI;"); w.WriteLine(); w.WriteLine(" if (Debug) Logger(State());"); - w.WriteLine(" CoreComm.MemoryCallbackSystem.CallExecute(PC);"); - w.WriteLine(" if (CDLLoggingActive) CDLOpcode();"); + w.WriteLine(" if (Core.MemoryCallbacks.HasExecutes) { Core.MemoryCallbacks.CallExecutes(PC); }"); + w.WriteLine(" if (CDLLoggingActive) CDLOpcode();"); w.WriteLine(); w.WriteLine(" byte opcode = ReadMemory(PC++);"); w.WriteLine(" switch (opcode)");