diff --git a/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs b/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs index 97cb1f1e7d..8fd7086a88 100644 --- a/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs +++ b/BizHawk.Emulation.Common/Base Implementations/CallbackBasedTraceBuffer.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; - +using System.Linq; using BizHawk.Emulation.Common.IEmulatorExtensions; namespace BizHawk.Emulation.Common @@ -71,7 +71,8 @@ namespace BizHawk.Emulation.Common if (_sink != null) { - DebuggableCore.MemoryCallbacks.Add(new TracingMemoryCallback(TraceFromCallback)); + var scope = DebuggableCore.MemoryCallbacks.AvailableScopes.First(); // This will be an issue when cores use this trace buffer and utilize multiple scopes + DebuggableCore.MemoryCallbacks.Add(new TracingMemoryCallback(TraceFromCallback, scope)); } } } @@ -80,9 +81,10 @@ namespace BizHawk.Emulation.Common public class TracingMemoryCallback : IMemoryCallback { - public TracingMemoryCallback(MemoryCallbackDelegate callback) + public TracingMemoryCallback(MemoryCallbackDelegate callback, string scope) { Callback = callback; + Scope = scope; } public MemoryCallbackType Type => MemoryCallbackType.Execute; @@ -95,7 +97,7 @@ namespace BizHawk.Emulation.Common public uint? AddressMask => null; - public string Scope => ""; // This will be relevant if/when the trace logger can trace anything other than the system bus + public string Scope { get; } } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs index 913ba15a86..00ab8b4dea 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IDebuggable.cs @@ -36,10 +36,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx throw new NotImplementedException(); } - public IMemoryCallbackSystem MemoryCallbacks - { - get { return _memoryCallbacks; } - } + public IMemoryCallbackSystem MemoryCallbacks => _memoryCallbacks; public bool CanStep(StepType type) { return false; } @@ -47,12 +44,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx public void Step(StepType type) { throw new NotImplementedException(); } [FeatureNotImplemented] - public long TotalExecutedCycles - { - get { throw new NotImplementedException(); } - } + public long TotalExecutedCycles => throw new NotImplementedException(); - private readonly MemoryCallbackSystem _memoryCallbacks = new MemoryCallbackSystem(new[] { "M68K BUS", "" }); + private readonly MemoryCallbackSystem _memoryCallbacks = new MemoryCallbackSystem(new[] { "M68K BUS" }); private LibGPGX.mem_cb ExecCallback; private LibGPGX.mem_cb ReadCallback;