PCE - Hu6280 - pass in and store the callback system instead of an IDebuggable instance and calling .MemoryCallbacks constantly

This commit is contained in:
adelikat 2015-01-24 15:05:03 +00:00
parent e194c9f0c4
commit aa9e5cf2d7
4 changed files with 6 additions and 6 deletions

View File

@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
LagIFlag = FlagI; LagIFlag = FlagI;
if (Debug) Logger(State()); if (Debug) Logger(State());
Core.MemoryCallbacks.CallExecutes(PC); MemoryCallbacks.CallExecutes(PC);
if (CDLLoggingActive) CDLOpcode(); if (CDLLoggingActive) CDLOpcode();

View File

@ -9,10 +9,10 @@ namespace BizHawk.Emulation.Cores.Components.H6280
{ {
public sealed partial class HuC6280 public sealed partial class HuC6280
{ {
public HuC6280(IDebuggable core) public HuC6280(IMemoryCallbackSystem callbacks)
{ {
Reset(); Reset();
Core = core; MemoryCallbacks = callbacks;
} }
public void Reset() public void Reset()
@ -224,7 +224,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
public Action<int, byte> WriteVDC; public Action<int, byte> WriteVDC;
public Action<int> ThinkAction = delegate { }; public Action<int> ThinkAction = delegate { };
public IDebuggable Core; public IMemoryCallbackSystem MemoryCallbacks;
public byte ReadMemory(ushort address) public byte ReadMemory(ushort address)
{ {

View File

@ -157,7 +157,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
void Init(GameInfo game, byte[] rom) void Init(GameInfo game, byte[] rom)
{ {
Controller = NullController.GetNullController(); Controller = NullController.GetNullController();
Cpu = new HuC6280(this); Cpu = new HuC6280(MemoryCallbacks);
VCE = new VCE(); VCE = new VCE();
VDC1 = new VDC(this, Cpu, VCE); VDC1 = new VDC(this, Cpu, VCE);
PSG = new HuC6280PSG(); PSG = new HuC6280PSG();

View File

@ -494,7 +494,7 @@ namespace HuC6280
w.WriteLine(" LagIFlag = FlagI;"); w.WriteLine(" LagIFlag = FlagI;");
w.WriteLine(); w.WriteLine();
w.WriteLine(" if (Debug) Logger(State());"); w.WriteLine(" if (Debug) Logger(State());");
w.WriteLine(" Core.MemoryCallbacks.CallExecutes(PC);"); w.WriteLine(" MemoryCallbacks.CallExecutes(PC);");
w.WriteLine(" if (CDLLoggingActive) CDLOpcode();"); w.WriteLine(" if (CDLLoggingActive) CDLOpcode();");
w.WriteLine(); w.WriteLine();
w.WriteLine(" byte opcode = ReadMemory(PC++);"); w.WriteLine(" byte opcode = ReadMemory(PC++);");