gba tracelog: add register display

This commit is contained in:
goyuken 2014-11-19 03:33:09 +00:00
parent d15caf3daf
commit d58b00b72b
3 changed files with 17 additions and 3 deletions

View File

@ -99,7 +99,7 @@ namespace BizHawk.Emulation.Cores.Components.ARM
return null;
if (Str(d, s, false))
return null;
return Encoding.ASCII.GetString(s.total);
return Encoding.ASCII.GetString(s.total, 0, Array.IndexOf(s.total, (byte)0));
}
}

View File

@ -273,9 +273,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
string Trace(uint addr, uint opcode)
{
return
string.Format("{0:x8} {1}",
string.Format("{0:x8} {1} {2}",
opcode,
Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr, opcode));
(Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr, opcode) ?? "").PadRight(30),
regs.TraceString());
}
void InitCallbacks()

View File

@ -40,5 +40,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
}
return ret;
}
public string TraceString()
{
var sb = new StringBuilder();
int* p = (int*)_origin;
for (int i = 0; i < 17; i++)
{
sb.Append(p[i].ToString("X8"));
if (i != 16)
sb.Append(' ');
}
return sb.ToString();
}
}
}