diff --git a/BizHawk.Emulation/CPUs/HuC6280/Execute.cs b/BizHawk.Emulation/CPUs/HuC6280/Execute.cs index a26d2a93fa..611833a781 100644 --- a/BizHawk.Emulation/CPUs/HuC6280/Execute.cs +++ b/BizHawk.Emulation/CPUs/HuC6280/Execute.cs @@ -8,6 +8,9 @@ namespace BizHawk.Emulation.CPUs.H6280 { public partial class HuC6280 { + public bool Debug; + public Action Logger; + public void Execute(int cycles) { sbyte rel8; @@ -56,6 +59,8 @@ namespace BizHawk.Emulation.CPUs.H6280 IRQControlByte = IRQNextControlByte; LagIFlag = FlagI; + if (Debug) Logger(State()); + byte opcode = ReadMemory(PC++); switch (opcode) { diff --git a/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs index 18bc6198e5..75997a40a9 100644 --- a/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation/Consoles/PC Engine/PCEngine.cs @@ -54,6 +54,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx public PCEngine(GameInfo game, byte[] rom) { CoreOutputComm = new CoreOutputComm(); + CoreOutputComm.CpuTraceAvailable = true; switch (game.System) { @@ -87,6 +88,8 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx PSG = new HuC6280PSG(); SCSI = new ScsiCDBus(this, disc); + Cpu.Logger = (s) => CoreInputComm.Tracer.Put(s); + if (TurboGrafx) { Ram = new byte[0x2000]; @@ -238,6 +241,8 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx Controller.UpdateControls(Frame++); PSG.BeginFrame(Cpu.TotalExecutedCycles); + Cpu.Debug = CoreInputComm.Tracer.Enabled; + if (SuperGrafx) VPC.ExecFrame(render); else