gambatte - add LY to trace log

This commit is contained in:
zeromus 2015-09-17 14:10:31 -05:00
parent b5582722c8
commit ef5bfc49a7
5 changed files with 11 additions and 5 deletions

View File

@ -13,12 +13,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
private void MakeTrace(IntPtr _s)
{
int[] s = new int[13];
System.Runtime.InteropServices.Marshal.Copy(_s, s, 0, 13);
int[] s = new int[14];
System.Runtime.InteropServices.Marshal.Copy(_s, s, 0, 14);
ushort unused;
Tracer.Put(string.Format(
"{13} SP:{2:x2} A:{3:x2} B:{4:x2} C:{5:x2} D:{6:x2} E:{7:x2} F:{8:x2} H:{9:x2} L:{10:x2} {11} Cy:{0}",
"{13} SP:{2:x2} A:{3:x2} B:{4:x2} C:{5:x2} D:{6:x2} E:{7:x2} F:{8:x2} H:{9:x2} L:{10:x2} LY:{14:x2} {11} Cy:{0}",
s[0],
s[1] & 0xffff,
s[2] & 0xffff,
@ -32,7 +32,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
s[10] & 0xff,
s[11] != 0 ? "skip" : "",
s[12] & 0xff,
Common.Components.Z80GB.NewDisassembler.Disassemble((ushort)s[1], (addr) => LibGambatte.gambatte_cpuread(GambatteState, addr), out unused).PadRight(30)
Common.Components.Z80GB.NewDisassembler.Disassemble((ushort)s[1], (addr) => LibGambatte.gambatte_cpuread(GambatteState, addr), out unused).PadRight(30),
s[13] & 0xff
));
}
}

View File

@ -505,7 +505,7 @@ void CPU::process(const unsigned long cycles) {
unsigned char opcode;
if (tracecallback) {
int result[13];
int result[14];
result[0] = cycleCounter;
result[1] = PC;
result[2] = SP;
@ -520,6 +520,7 @@ void CPU::process(const unsigned long cycles) {
result[11] = skip;
PC_READ(opcode);
result[12] = opcode;
result[13] = memory.debugGetLY();
tracecallback((void *)result);
}
else {

View File

@ -85,6 +85,8 @@ public:
bool loaded() const { return cart.loaded(); }
const char * romTitle() const { return cart.romTitle(); }
int debugGetLY() const { return display.debugGetLY(); }
void setStatePtrs(SaveState &state);
void loadState(const SaveState &state/*, unsigned long oldCc*/);
void loadSavedata(const char *data) { cart.loadSavedata(data); }

View File

@ -175,6 +175,8 @@ public:
void setCgbPalette(unsigned *lut);
void setVideoBuffer(uint_least32_t *videoBuf, int pitch);
int debugGetLY() const { return ppu.lyCounter().ly(); }
void dmgBgPaletteChange(const unsigned data, const unsigned long cycleCounter) {
update(cycleCounter);
bgpData[0] = data;

Binary file not shown.