From e1f59363f2d005bb016196cdf56c127f57d97321 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 25 Jan 2015 19:50:54 +0000 Subject: [PATCH] Debugger - on refresh, check for new non-debugger made breakpoints and display them --- .../tools/Debugger/BreakpointControl.cs | 24 +++++++++++++++++++ .../Debugger/GenericDebugger.IToolForm.cs | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs index 310e03e144..62e570200c 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/BreakpointControl.cs @@ -86,11 +86,35 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger { if (Enabled) { + CheckForNewBreakpoints(); + BreakpointView.ItemCount = Breakpoints.Count; UpdateStatsLabel(); } } + /// + /// Did any breakpoints get added from other sources such as lua? + /// + private void CheckForNewBreakpoints() + { + if (MCS != null) + { + foreach (var callback in MCS) + { + if (!Breakpoints.Any(b => + b.Type == callback.Type && + b.Address == callback.Address && + b.Name == callback.Name && + b.Callback == callback.Callback + )) + { + Breakpoints.Add(new Breakpoint(Core, callback)); + } + } + } + } + public void GenerateUI() { if (MCS != null) diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs index 0989e5b1d0..af4dab0f98 100644 --- a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs @@ -143,7 +143,7 @@ namespace BizHawk.Client.EmuHawk { RegisterPanel.UpdateValues(); UpdateDisassembler(); - // TODO: check for new breakpoints and add them to the Breakpoint list? + BreakPointControl1.UpdateValues(); } public void FastUpdate()