Added a logging flag for GB using the SaveStateText function.
This commit is contained in:
parent
147caec758
commit
9623f073eb
|
@ -41,8 +41,10 @@ namespace BizHawk.Emulation.CPUs.Z80GB
|
||||||
|
|
||||||
public void ExecuteInstruction()
|
public void ExecuteInstruction()
|
||||||
{
|
{
|
||||||
|
LogCPU();
|
||||||
byte TB; byte TB2; sbyte TSB; ushort TUS; int TI1; int TI2; int TIR;
|
byte TB; byte TB2; sbyte TSB; ushort TUS; int TI1; int TI2; int TIR;
|
||||||
|
while (RegPC.Word == 0x031A)
|
||||||
|
break;
|
||||||
byte op = ReadMemory(RegPC.Word++);
|
byte op = ReadMemory(RegPC.Word++);
|
||||||
int mCycleTime = mCycleTable[op];
|
int mCycleTime = mCycleTable[op];
|
||||||
PendingCycles -= mCycleTime;
|
PendingCycles -= mCycleTime;
|
||||||
|
|
|
@ -27,6 +27,8 @@ namespace BizHawk.Emulation.CPUs.Z80GB
|
||||||
|
|
||||||
public Func<ushort, byte> ReadMemory;
|
public Func<ushort, byte> ReadMemory;
|
||||||
public Action<ushort, byte> WriteMemory;
|
public Action<ushort, byte> WriteMemory;
|
||||||
|
private bool logging = false;
|
||||||
|
private TextWriter log = File.CreateText("log.txt");
|
||||||
|
|
||||||
public void UnregisterMemoryMapper()
|
public void UnregisterMemoryMapper()
|
||||||
{
|
{
|
||||||
|
@ -143,5 +145,12 @@ namespace BizHawk.Emulation.CPUs.Z80GB
|
||||||
TotalExecutedCycles = reader.ReadInt32();
|
TotalExecutedCycles = reader.ReadInt32();
|
||||||
PendingCycles = reader.ReadInt32();
|
PendingCycles = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LogCPU()
|
||||||
|
{
|
||||||
|
if (!logging)
|
||||||
|
return;
|
||||||
|
SaveStateText(log);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue