support Trace Logging in PCE

This commit is contained in:
beirich 2012-10-01 00:21:25 +00:00
parent a87a5c96b2
commit ea6e170703
2 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,9 @@ namespace BizHawk.Emulation.CPUs.H6280
{
public partial class HuC6280
{
public bool Debug;
public Action<string> 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)
{

View File

@ -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