BizHawk/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ITraceable.cs

47 lines
1.1 KiB
C#
Raw Normal View History

using System;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.Components.Z80GB;
namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
{
public partial class Gameboy
{
private ITraceable Tracer { get; set; }
private LibGambatte.TraceCallback tracecb;
private void MakeTrace(IntPtr _s)
{
2015-09-17 19:10:31 +00:00
int[] s = new int[14];
System.Runtime.InteropServices.Marshal.Copy(_s, s, 0, 14);
ushort unused;
Tracer.Put(new TraceInfo
{
Disassembly =
NewDisassembler
.Disassemble((ushort)s[1], (addr) => LibGambatte.gambatte_cpuread(GambatteState, addr), out unused)
.PadRight(30),
RegisterInfo =
string.Format(
2016-04-13 21:09:22 +00:00
"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:{13:x2} {11} Cy:{0}",
s[0],
s[1] & 0xffff,
s[2] & 0xffff,
s[3] & 0xff,
s[4] & 0xff,
s[5] & 0xff,
s[6] & 0xff,
s[7] & 0xff,
s[8] & 0xff,
s[9] & 0xff,
s[10] & 0xff,
s[11] != 0 ? "skip" : "",
2016-04-13 21:09:22 +00:00
s[12] & 0xff,
s[13] & 0xff
)
});
}
}
}