Added a logging flag for GB using the SaveStateText function.

This commit is contained in:
brandman211 2012-05-20 06:43:41 +00:00
parent 147caec758
commit 9623f073eb
2 changed files with 12 additions and 1 deletions

View File

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

View File

@ -27,6 +27,8 @@ namespace BizHawk.Emulation.CPUs.Z80GB
public Func<ushort, byte> ReadMemory;
public Action<ushort, byte> 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);
}
}
}