diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs index 32c4b0ef7f..7b7cc52871 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs @@ -63,7 +63,12 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger { if (Core.MemoryCallbacksAvailable()) { - // TODO: need a way to populate existing breakpoints + foreach (var callback in Core.MemoryCallbacks) + { + Breakpoints.Add(new Breakpoint(Core, callback.Callback, callback.Address ?? 0 /*TODO*/,callback.Type, true)); + } + + BreakpointView.Refresh(); } else { diff --git a/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs b/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs index 44ee428642..9ca678f7d5 100644 --- a/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs +++ b/BizHawk.Emulation.Common/Base Implementations/MemoryCallbackSystem.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; @@ -9,6 +10,16 @@ namespace BizHawk.Emulation.Common { private readonly List Callbacks = new List(); + public IEnumerator GetEnumerator() + { + return Callbacks.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + public void Add(IMemoryCallback callback) { var hadAny = Callbacks.Any(); diff --git a/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs b/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs index 1c7cbc4ab3..caf1335207 100644 --- a/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs +++ b/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; namespace BizHawk.Emulation.Common { - public interface IMemoryCallbackSystem + public interface IMemoryCallbackSystem : IEnumerable { /// /// Returns whether or not there are currently any read hooks