From 2dc01eab33247b90480242c48f7f358a92662839 Mon Sep 17 00:00:00 2001 From: beirich Date: Sat, 8 Feb 2014 20:18:36 +0000 Subject: [PATCH] pasky better do something cool with this to warrant janking up my HuC6280 core --- BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs | 1 + BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs | 6 +++++- BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs | 2 +- BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs | 6 +++--- CpuCoreGenerator/HuC6280/CoreGenerator.cs | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs b/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs index 493c56795d..63f2bdd627 100644 --- a/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs +++ b/BizHawk.Emulation.Cores/CPUs/HuC6280/Execute.cs @@ -59,6 +59,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280 LagIFlag = FlagI; if (Debug) Logger(State()); + CoreComm.MemoryCallbackSystem.CallExecute(PC); byte opcode = ReadMemory(PC++); switch (opcode) diff --git a/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs b/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs index a31c70a061..130b6cbf01 100644 --- a/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs +++ b/BizHawk.Emulation.Cores/CPUs/HuC6280/HuC6280.cs @@ -3,14 +3,16 @@ using System.Globalization; using System.IO; using BizHawk.Common; +using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Components.H6280 { public sealed partial class HuC6280 { - public HuC6280() + public HuC6280(CoreComm comm) { Reset(); + CoreComm = comm; } public void Reset() @@ -347,6 +349,8 @@ namespace BizHawk.Emulation.Cores.Components.H6280 public Action WriteVDC; public Action ThinkAction = delegate { }; + public CoreComm CoreComm; + public byte ReadMemory(ushort address) { byte page = MPR[address >> 13]; diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index bdb368437e..a53da572ac 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -93,7 +93,7 @@ namespace BizHawk.Emulation.Cores.PCEngine void Init(GameInfo game, byte[] rom) { Controller = NullController.GetNullController(); - Cpu = new HuC6280(); + Cpu = new HuC6280(CoreComm); VCE = new VCE(); VDC1 = new VDC(this, Cpu, VCE); PSG = new HuC6280PSG(); diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs index 719858ea96..873e640e3d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/VDP.cs @@ -27,9 +27,9 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem VdpCommand vdpCommand; int TmsMode = 4; - bool VIntPending; // FIXME put in savestate - bool HIntPending; // FIXME put in savestate - int lineIntLinesRemaining; // FIXME put in savestate + bool VIntPending; + bool HIntPending; + int lineIntLinesRemaining; SMS Sms; VdpMode mode; diff --git a/CpuCoreGenerator/HuC6280/CoreGenerator.cs b/CpuCoreGenerator/HuC6280/CoreGenerator.cs index 8a630a9a82..146e106ca1 100644 --- a/CpuCoreGenerator/HuC6280/CoreGenerator.cs +++ b/CpuCoreGenerator/HuC6280/CoreGenerator.cs @@ -494,6 +494,7 @@ namespace HuC6280 w.WriteLine(" LagIFlag = FlagI;"); w.WriteLine(); w.WriteLine(" if (Debug) Logger(State());"); + w.WriteLine(" CoreComm.MemoryCallbackSystem.CallExecute(PC);"); w.WriteLine(); w.WriteLine(" byte opcode = ReadMemory(PC++);"); w.WriteLine(" switch (opcode)");