From 3638474c99b95e59cc2d7b3c48d57a4082925d52 Mon Sep 17 00:00:00 2001 From: Sour Date: Thu, 7 May 2020 23:06:40 -0400 Subject: [PATCH] Debugger: Fixed debugger refresh bug when memory tools were opened --- GUI.NET/Debugger/DebugWorkspaceManager.cs | 10 ++++++---- GUI.NET/Debugger/frmMemoryViewer.cs | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/GUI.NET/Debugger/DebugWorkspaceManager.cs b/GUI.NET/Debugger/DebugWorkspaceManager.cs index 6422bbf5..b42db4d0 100644 --- a/GUI.NET/Debugger/DebugWorkspaceManager.cs +++ b/GUI.NET/Debugger/DebugWorkspaceManager.cs @@ -71,7 +71,7 @@ namespace Mesen.GUI.Debugger } } - public static DebugWorkspace GetWorkspace() + public static DebugWorkspace GetWorkspace(bool refreshState = true) { string romName = InteropEmu.GetRomInfo().GetRomName(); if(_workspace == null || _romName != romName) { @@ -95,9 +95,11 @@ namespace Mesen.GUI.Debugger } } - //Send breakpoints & labels to emulation core (even if the same game is running) - BreakpointManager.SetBreakpoints(_workspace.Breakpoints); - LabelManager.RefreshLabels(); + if(refreshState) { + //Send breakpoints & labels to emulation core (even if the same game is running) + BreakpointManager.SetBreakpoints(_workspace.Breakpoints); + LabelManager.RefreshLabels(); + } return _workspace; } diff --git a/GUI.NET/Debugger/frmMemoryViewer.cs b/GUI.NET/Debugger/frmMemoryViewer.cs index 18bfc040..51bf1fd3 100644 --- a/GUI.NET/Debugger/frmMemoryViewer.cs +++ b/GUI.NET/Debugger/frmMemoryViewer.cs @@ -239,7 +239,7 @@ namespace Mesen.GUI.Debugger private void InitTblMappings() { - DebugWorkspace workspace = DebugWorkspaceManager.GetWorkspace(); + DebugWorkspace workspace = DebugWorkspaceManager.GetWorkspace(false); if(workspace.TblMappings != null && workspace.TblMappings.Count > 0) { var tblDict = TblLoader.ToDictionary(workspace.TblMappings.ToArray()); if(tblDict != null) { @@ -364,9 +364,10 @@ namespace Mesen.GUI.Debugger return; } - if(DebugWorkspaceManager.GetWorkspace() != this._previousWorkspace) { + DebugWorkspace workspace = DebugWorkspaceManager.GetWorkspace(false); + if(workspace != this._previousWorkspace) { this.InitTblMappings(); - _previousWorkspace = DebugWorkspaceManager.GetWorkspace(); + _previousWorkspace = workspace; } if(this.tabMain.SelectedTab == this.tpgAccessCounters) {