diff --git a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.ITraceable.cs b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.ITraceable.cs index 1cf9814c73..c1779a18d2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.ITraceable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.ITraceable.cs @@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX { public partial class Octoshock { - public ITraceable Tracer { get { return tracer; } } + public TraceBuffer Tracer { get; private set; } public static string TraceHeader = "R3000A: PC, raw bytes, mnemonic, registers (GPRs, lo, hi, sr, cause, epc)"; @@ -34,5 +34,12 @@ namespace BizHawk.Emulation.Cores.Sony.PSX RegisterInfo = sb.ToString().Trim() }); } + + private void ConnectTracer() + { + Tracer = new TraceBuffer() { Header = TraceHeader }; + ServiceProvider = new BasicServiceProvider(this); + (ServiceProvider as BasicServiceProvider).Register(Tracer); + } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs index 2c6b4a8bf8..cf1afd5144 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sony/PSX/Octoshock.cs @@ -121,10 +121,6 @@ namespace BizHawk.Emulation.Cores.Sony.PSX static Octoshock CurrOctoshockCore; IntPtr psx; - TraceBuffer tracer = new TraceBuffer() - { - Header = TraceHeader - }; bool disposed = false; public void Dispose() @@ -250,8 +246,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX void Load(CoreComm comm, List discs, List discNames, byte[] exe, object settings, object syncSettings, PSF psf) { - ServiceProvider = new BasicServiceProvider(this); - (ServiceProvider as BasicServiceProvider).Register(tracer); + ConnectTracer(); CoreComm = comm; DriveLightEnabled = true; @@ -699,7 +694,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSX OctoshockDll.shock_SetRenderOptions(psx, ref ropts); //prep tracer - if (tracer.Enabled) + if (Tracer.Enabled) OctoshockDll.shock_SetTraceCallback(psx, IntPtr.Zero, ShockTraceCallback); else OctoshockDll.shock_SetTraceCallback(psx, IntPtr.Zero, null);