diff --git a/UI/Debugger/Config/DebuggerInfo.cs b/UI/Debugger/Config/DebuggerInfo.cs index 5337f9f..9b744f1 100644 --- a/UI/Debugger/Config/DebuggerInfo.cs +++ b/UI/Debugger/Config/DebuggerInfo.cs @@ -15,6 +15,8 @@ namespace Mesen.GUI.Config public Size WindowSize = new Size(0, 0); public Point WindowLocation; + public bool ShowByteCode = false; + public int BreakOnValue = 0; public int BreakInCount = 1; public BreakInMetric BreakInMetric = BreakInMetric.CpuInstructions; diff --git a/UI/Debugger/Controls/ctrlDisassemblyView.cs b/UI/Debugger/Controls/ctrlDisassemblyView.cs index 47c296e..c70b89e 100644 --- a/UI/Debugger/Controls/ctrlDisassemblyView.cs +++ b/UI/Debugger/Controls/ctrlDisassemblyView.cs @@ -30,7 +30,7 @@ namespace Mesen.GUI.Debugger.Controls _styleProvider = new CpuLineStyleProvider(); ctrlCode.StyleProvider = _styleProvider; - ctrlCode.ShowContentNotes = true; + ctrlCode.ShowContentNotes = false; ctrlCode.ShowMemoryValues = true; InitShortcuts(); diff --git a/UI/Debugger/MemoryTools/frmMemoryTools.cs b/UI/Debugger/MemoryTools/frmMemoryTools.cs index 5da1f73..f1abaca 100644 --- a/UI/Debugger/MemoryTools/frmMemoryTools.cs +++ b/UI/Debugger/MemoryTools/frmMemoryTools.cs @@ -107,10 +107,7 @@ namespace Mesen.GUI.Debugger config.MemoryType = cboMemoryType.GetEnumValue(); _entityBinder.UpdateObject(); ConfigManager.ApplyChanges(); - - //TODO? - //DebugWorkspaceManager.SaveWorkspace(); - + if(this._notifListener != null) { this._notifListener.Dispose(); this._notifListener = null; diff --git a/UI/Debugger/frmDebugger.Designer.cs b/UI/Debugger/frmDebugger.Designer.cs index c5527da..7e5f90a 100644 --- a/UI/Debugger/frmDebugger.Designer.cs +++ b/UI/Debugger/frmDebugger.Designer.cs @@ -71,6 +71,8 @@ this.mnuGoToBrkHandler = new System.Windows.Forms.ToolStripMenuItem(); this.mnuGoToCopHandler = new System.Windows.Forms.ToolStripMenuItem(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuShowByteCode = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator(); this.fontSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mnuIncreaseFontSize = new System.Windows.Forms.ToolStripMenuItem(); this.mnuDecreaseFontSize = new System.Windows.Forms.ToolStripMenuItem(); @@ -399,6 +401,8 @@ // optionsToolStripMenuItem // this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuShowByteCode, + this.toolStripMenuItem5, this.fontSizeToolStripMenuItem, this.toolStripMenuItem4, this.mnuPreferences}); @@ -406,6 +410,18 @@ this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); this.optionsToolStripMenuItem.Text = "Options"; // + // mnuShowByteCode + // + this.mnuShowByteCode.CheckOnClick = true; + this.mnuShowByteCode.Name = "mnuShowByteCode"; + this.mnuShowByteCode.Size = new System.Drawing.Size(209, 22); + this.mnuShowByteCode.Text = "Show byte code"; + // + // toolStripMenuItem5 + // + this.toolStripMenuItem5.Name = "toolStripMenuItem5"; + this.toolStripMenuItem5.Size = new System.Drawing.Size(206, 6); + // // fontSizeToolStripMenuItem // this.fontSizeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -676,5 +692,7 @@ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem21; private System.Windows.Forms.ToolStripMenuItem mnuSelectFont; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4; + private System.Windows.Forms.ToolStripMenuItem mnuShowByteCode; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem5; } } \ No newline at end of file diff --git a/UI/Debugger/frmDebugger.cs b/UI/Debugger/frmDebugger.cs index 0c8601b..635b1dd 100644 --- a/UI/Debugger/frmDebugger.cs +++ b/UI/Debugger/frmDebugger.cs @@ -34,17 +34,7 @@ namespace Mesen.GUI.Debugger InitShortcuts(); InitToolbar(); - - DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger; - Font font = new Font(cfg.FontFamily, cfg.FontSize, cfg.FontStyle); - ctrlDisassemblyView.CodeViewer.BaseFont = font; - ctrlDisassemblyView.CodeViewer.TextZoom = cfg.TextZoom; - - if(!cfg.WindowSize.IsEmpty) { - this.StartPosition = FormStartPosition.Manual; - this.Size = cfg.WindowSize; - this.Location = cfg.WindowLocation; - } + LoadConfig(); toolTip.SetToolTip(picWatchHelp, ctrlWatch.GetTooltipText()); @@ -59,6 +49,7 @@ namespace Mesen.GUI.Debugger DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger; cfg.WindowSize = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Size : this.Size; cfg.WindowLocation = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Location : this.Location; + _entityBinder.UpdateObject(); ConfigManager.ApplyChanges(); BreakpointManager.BreakpointsEnabled = false; @@ -167,6 +158,27 @@ namespace Mesen.GUI.Debugger ); } + private void LoadConfig() + { + DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger; + _entityBinder.Entity = cfg; + _entityBinder.AddBinding(nameof(cfg.ShowByteCode), mnuShowByteCode); + + mnuShowByteCode.CheckedChanged += (s, e) => { ctrlDisassemblyView.CodeViewer.ShowContentNotes = mnuShowByteCode.Checked; }; + + _entityBinder.UpdateUI(); + + Font font = new Font(cfg.FontFamily, cfg.FontSize, cfg.FontStyle); + ctrlDisassemblyView.CodeViewer.BaseFont = font; + ctrlDisassemblyView.CodeViewer.TextZoom = cfg.TextZoom; + + if(!cfg.WindowSize.IsEmpty) { + this.StartPosition = FormStartPosition.Manual; + this.Size = cfg.WindowSize; + this.Location = cfg.WindowLocation; + } + } + private void UpdateContinueAction() { bool paused = EmuApi.IsPaused();