diff --git a/BizHawk.Emulation/CPUs/Z80-GB/Execute.cs b/BizHawk.Emulation/CPUs/Z80-GB/Execute.cs index b15efd1a0e..26cea96064 100644 --- a/BizHawk.Emulation/CPUs/Z80-GB/Execute.cs +++ b/BizHawk.Emulation/CPUs/Z80-GB/Execute.cs @@ -41,8 +41,10 @@ namespace BizHawk.Emulation.CPUs.Z80GB public void ExecuteInstruction() { + LogCPU(); byte TB; byte TB2; sbyte TSB; ushort TUS; int TI1; int TI2; int TIR; - + while (RegPC.Word == 0x031A) + break; byte op = ReadMemory(RegPC.Word++); int mCycleTime = mCycleTable[op]; PendingCycles -= mCycleTime; diff --git a/BizHawk.Emulation/CPUs/Z80-GB/Z80.cs b/BizHawk.Emulation/CPUs/Z80-GB/Z80.cs index 92fd75a98e..9b78d4ea1f 100644 --- a/BizHawk.Emulation/CPUs/Z80-GB/Z80.cs +++ b/BizHawk.Emulation/CPUs/Z80-GB/Z80.cs @@ -27,6 +27,8 @@ namespace BizHawk.Emulation.CPUs.Z80GB public Func ReadMemory; public Action WriteMemory; + private bool logging = false; + private TextWriter log = File.CreateText("log.txt"); public void UnregisterMemoryMapper() { @@ -143,5 +145,12 @@ namespace BizHawk.Emulation.CPUs.Z80GB TotalExecutedCycles = reader.ReadInt32(); PendingCycles = reader.ReadInt32(); } + + private void LogCPU() + { + if (!logging) + return; + SaveStateText(log); + } } } \ No newline at end of file