From af78aedc02a1c8e923ea3569467a8f457b37134b Mon Sep 17 00:00:00 2001 From: feos Date: Wed, 24 Aug 2016 07:26:42 +0300 Subject: [PATCH] as always --- .../Sega/Saturn/Yabause.ITraceable.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ITraceable.cs diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ITraceable.cs b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ITraceable.cs new file mode 100644 index 0000000000..a4107ec5f7 --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Yabause.ITraceable.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using BizHawk.Emulation.Common; + +namespace BizHawk.Emulation.Cores.Sega.Saturn +{ + public partial class Yabause + { + public TraceBuffer Tracer { get; private set; } + + public static string TraceHeader = "SH2: core, PC, machine code, mnemonic, operands, registers (GPRs, PR, SR, MAC, GBR, VBR)"; + + LibYabause.TraceCallback trace_cb; + + public void YabauseTraceCallback(string dis, string regs) + { + Tracer.Put(new TraceInfo + { + Disassembly = dis, + RegisterInfo = regs + }); + } + + private void ConnectTracer() + { + trace_cb = new LibYabause.TraceCallback(YabauseTraceCallback); + Tracer = new TraceBuffer() { Header = TraceHeader }; + ServiceProvider = new BasicServiceProvider(this); + (ServiceProvider as BasicServiceProvider).Register(Tracer); + } + } +}