MemoryCallbackSystem - implement IEnumerable, Debugger - use it to pre-populate the breakpoint dialog with pre-existing breakpoints
This commit is contained in:
parent
be8563469c
commit
68e1eae014
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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<IMemoryCallback> Callbacks = new List<IMemoryCallback>();
|
||||
|
||||
public IEnumerator<IMemoryCallback> GetEnumerator()
|
||||
{
|
||||
return Callbacks.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public void Add(IMemoryCallback callback)
|
||||
{
|
||||
var hadAny = Callbacks.Any();
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
|
||||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
public interface IMemoryCallbackSystem
|
||||
public interface IMemoryCallbackSystem : IEnumerable<IMemoryCallback>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns whether or not there are currently any read hooks
|
||||
|
|
Loading…
Reference in New Issue