diff --git a/GUI.NET/Config/DebuggerShortcutsConfig.cs b/GUI.NET/Config/DebuggerShortcutsConfig.cs index 4c5ac4c0..d3ab15fc 100644 --- a/GUI.NET/Config/DebuggerShortcutsConfig.cs +++ b/GUI.NET/Config/DebuggerShortcutsConfig.cs @@ -194,6 +194,12 @@ namespace Mesen.GUI.Config public XmlKeys MemoryViewer_Import = Keys.Control | Keys.O; [ShortcutName("Export")] public XmlKeys MemoryViewer_Export = Keys.Control | Keys.S; + [ShortcutName("View in CPU Memory")] + public XmlKeys MemoryViewer_ViewInCpuMemory = Keys.None; + [ShortcutName("View in [memory type]")] + public XmlKeys MemoryViewer_ViewInMemoryType = Keys.None; + [ShortcutName("View in disassembly")] + public XmlKeys MemoryViewer_ViewInDisassembly = Keys.None; //Script Window [ShortcutName("Open Script")] diff --git a/GUI.NET/Debugger/Controls/ctrlHexViewer.Designer.cs b/GUI.NET/Debugger/Controls/ctrlHexViewer.Designer.cs index 6eeb7f1f..75642580 100644 --- a/GUI.NET/Debugger/Controls/ctrlHexViewer.Designer.cs +++ b/GUI.NET/Debugger/Controls/ctrlHexViewer.Designer.cs @@ -54,7 +54,7 @@ this.mnuAddToWatch = new System.Windows.Forms.ToolStripMenuItem(); this.mnuEditBreakpoint = new System.Windows.Forms.ToolStripMenuItem(); this.mnuEditLabel = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.sepViewActions = new System.Windows.Forms.ToolStripSeparator(); this.mnuFreeze = new System.Windows.Forms.ToolStripMenuItem(); this.mnuUnfreeze = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); @@ -64,6 +64,10 @@ this.mnuPaste = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator(); this.mnuSelectAll = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuViewInCpuMemory = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); + this.mnuViewInMemoryType = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuViewInDisassembly = new System.Windows.Forms.ToolStripMenuItem(); this.tlpMain.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.panelSearch.SuspendLayout(); @@ -267,6 +271,7 @@ // ctrlHexBox // this.ctrlHexBox.ByteColorProvider = null; + this.ctrlHexBox.ByteEditingMode = false; this.ctrlHexBox.ColumnInfoVisible = true; this.ctrlHexBox.Dock = System.Windows.Forms.DockStyle.Fill; this.ctrlHexBox.EnablePerByteNavigation = false; @@ -314,7 +319,11 @@ this.mnuAddToWatch, this.mnuEditBreakpoint, this.mnuEditLabel, - this.toolStripMenuItem2, + this.sepViewActions, + this.mnuViewInCpuMemory, + this.mnuViewInMemoryType, + this.mnuViewInDisassembly, + this.toolStripMenuItem6, this.mnuFreeze, this.mnuUnfreeze, this.toolStripMenuItem3, @@ -325,7 +334,7 @@ this.toolStripMenuItem5, this.mnuSelectAll}); this.ctxMenuStrip.Name = "ctxMenuStrip"; - this.ctxMenuStrip.Size = new System.Drawing.Size(175, 254); + this.ctxMenuStrip.Size = new System.Drawing.Size(187, 348); this.ctxMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.ctxMenuStrip_Opening); // // mnuMarkSelectionAs @@ -335,14 +344,14 @@ this.mnuMarkAsData, this.mnuMarkAsUnidentifiedData}); this.mnuMarkSelectionAs.Name = "mnuMarkSelectionAs"; - this.mnuMarkSelectionAs.Size = new System.Drawing.Size(174, 22); + this.mnuMarkSelectionAs.Size = new System.Drawing.Size(186, 22); this.mnuMarkSelectionAs.Text = "Mark selection as..."; // // mnuMarkAsCode // this.mnuMarkAsCode.Image = global::Mesen.GUI.Properties.Resources.Accept; this.mnuMarkAsCode.Name = "mnuMarkAsCode"; - this.mnuMarkAsCode.Size = new System.Drawing.Size(235, 22); + this.mnuMarkAsCode.Size = new System.Drawing.Size(199, 22); this.mnuMarkAsCode.Text = "Verified Code"; this.mnuMarkAsCode.Click += new System.EventHandler(this.mnuMarkAsCode_Click); // @@ -350,7 +359,7 @@ // this.mnuMarkAsData.Image = global::Mesen.GUI.Properties.Resources.VerifiedData; this.mnuMarkAsData.Name = "mnuMarkAsData"; - this.mnuMarkAsData.Size = new System.Drawing.Size(235, 22); + this.mnuMarkAsData.Size = new System.Drawing.Size(199, 22); this.mnuMarkAsData.Text = "Verified Data"; this.mnuMarkAsData.Click += new System.EventHandler(this.mnuMarkAsData_Click); // @@ -358,20 +367,20 @@ // this.mnuMarkAsUnidentifiedData.Image = global::Mesen.GUI.Properties.Resources.UnidentifiedData; this.mnuMarkAsUnidentifiedData.Name = "mnuMarkAsUnidentifiedData"; - this.mnuMarkAsUnidentifiedData.Size = new System.Drawing.Size(235, 22); + this.mnuMarkAsUnidentifiedData.Size = new System.Drawing.Size(199, 22); this.mnuMarkAsUnidentifiedData.Text = "Unidentified Code/Data"; this.mnuMarkAsUnidentifiedData.Click += new System.EventHandler(this.mnuMarkAsUnidentifiedData_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(171, 6); + this.toolStripMenuItem1.Size = new System.Drawing.Size(183, 6); // // mnuAddToWatch // this.mnuAddToWatch.Image = global::Mesen.GUI.Properties.Resources.Add; this.mnuAddToWatch.Name = "mnuAddToWatch"; - this.mnuAddToWatch.Size = new System.Drawing.Size(174, 22); + this.mnuAddToWatch.Size = new System.Drawing.Size(186, 22); this.mnuAddToWatch.Text = "Add to Watch"; this.mnuAddToWatch.Click += new System.EventHandler(this.mnuAddToWatch_Click); // @@ -379,7 +388,7 @@ // this.mnuEditBreakpoint.Image = global::Mesen.GUI.Properties.Resources.BreakpointEnableDisable; this.mnuEditBreakpoint.Name = "mnuEditBreakpoint"; - this.mnuEditBreakpoint.Size = new System.Drawing.Size(174, 22); + this.mnuEditBreakpoint.Size = new System.Drawing.Size(186, 22); this.mnuEditBreakpoint.Text = "Edit Breakpoint"; this.mnuEditBreakpoint.Click += new System.EventHandler(this.mnuEditBreakpoint_Click); // @@ -387,20 +396,20 @@ // this.mnuEditLabel.Image = global::Mesen.GUI.Properties.Resources.EditLabel; this.mnuEditLabel.Name = "mnuEditLabel"; - this.mnuEditLabel.Size = new System.Drawing.Size(174, 22); + this.mnuEditLabel.Size = new System.Drawing.Size(186, 22); this.mnuEditLabel.Text = "Edit Label"; this.mnuEditLabel.Click += new System.EventHandler(this.mnuEditLabel_Click); // - // toolStripMenuItem2 + // sepViewActions // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(171, 6); + this.sepViewActions.Name = "sepViewActions"; + this.sepViewActions.Size = new System.Drawing.Size(183, 6); // // mnuFreeze // this.mnuFreeze.Image = global::Mesen.GUI.Properties.Resources.Stop; this.mnuFreeze.Name = "mnuFreeze"; - this.mnuFreeze.Size = new System.Drawing.Size(174, 22); + this.mnuFreeze.Size = new System.Drawing.Size(186, 22); this.mnuFreeze.Text = "Freeze"; this.mnuFreeze.Click += new System.EventHandler(this.mnuFreeze_Click); // @@ -408,33 +417,33 @@ // this.mnuUnfreeze.Image = global::Mesen.GUI.Properties.Resources.Play; this.mnuUnfreeze.Name = "mnuUnfreeze"; - this.mnuUnfreeze.Size = new System.Drawing.Size(174, 22); + this.mnuUnfreeze.Size = new System.Drawing.Size(186, 22); this.mnuUnfreeze.Text = "Unfreeze"; this.mnuUnfreeze.Click += new System.EventHandler(this.mnuUnfreeze_Click); // // toolStripMenuItem3 // this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(171, 6); + this.toolStripMenuItem3.Size = new System.Drawing.Size(183, 6); // // mnuUndo // this.mnuUndo.Image = global::Mesen.GUI.Properties.Resources.Undo; this.mnuUndo.Name = "mnuUndo"; - this.mnuUndo.Size = new System.Drawing.Size(174, 22); + this.mnuUndo.Size = new System.Drawing.Size(186, 22); this.mnuUndo.Text = "Undo"; this.mnuUndo.Click += new System.EventHandler(this.mnuUndo_Click); // // toolStripMenuItem4 // this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(171, 6); + this.toolStripMenuItem4.Size = new System.Drawing.Size(183, 6); // // mnuCopy // this.mnuCopy.Image = global::Mesen.GUI.Properties.Resources.Copy; this.mnuCopy.Name = "mnuCopy"; - this.mnuCopy.Size = new System.Drawing.Size(174, 22); + this.mnuCopy.Size = new System.Drawing.Size(186, 22); this.mnuCopy.Text = "Copy"; this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click); // @@ -442,23 +451,52 @@ // this.mnuPaste.Image = global::Mesen.GUI.Properties.Resources.Paste; this.mnuPaste.Name = "mnuPaste"; - this.mnuPaste.Size = new System.Drawing.Size(174, 22); + this.mnuPaste.Size = new System.Drawing.Size(186, 22); this.mnuPaste.Text = "Paste"; this.mnuPaste.Click += new System.EventHandler(this.mnuPaste_Click); // // toolStripMenuItem5 // this.toolStripMenuItem5.Name = "toolStripMenuItem5"; - this.toolStripMenuItem5.Size = new System.Drawing.Size(171, 6); + this.toolStripMenuItem5.Size = new System.Drawing.Size(183, 6); // // mnuSelectAll // this.mnuSelectAll.Image = global::Mesen.GUI.Properties.Resources.SelectAll; this.mnuSelectAll.Name = "mnuSelectAll"; - this.mnuSelectAll.Size = new System.Drawing.Size(174, 22); + this.mnuSelectAll.Size = new System.Drawing.Size(186, 22); this.mnuSelectAll.Text = "Select All"; this.mnuSelectAll.Click += new System.EventHandler(this.mnuSelectAll_Click); // + // mnuViewInCpuMemory + // + this.mnuViewInCpuMemory.Image = global::Mesen.GUI.Properties.Resources.SwitchView; + this.mnuViewInCpuMemory.Name = "mnuViewInCpuMemory"; + this.mnuViewInCpuMemory.Size = new System.Drawing.Size(186, 22); + this.mnuViewInCpuMemory.Text = "View in CPU memory"; + this.mnuViewInCpuMemory.Click += new System.EventHandler(this.mnuViewInCpuMemory_Click); + // + // toolStripMenuItem6 + // + this.toolStripMenuItem6.Name = "toolStripMenuItem6"; + this.toolStripMenuItem6.Size = new System.Drawing.Size(183, 6); + // + // mnuViewInMemoryType + // + this.mnuViewInMemoryType.Image = global::Mesen.GUI.Properties.Resources.SwitchView; + this.mnuViewInMemoryType.Name = "mnuViewInMemoryType"; + this.mnuViewInMemoryType.Size = new System.Drawing.Size(186, 22); + this.mnuViewInMemoryType.Text = "View in {0} memory"; + this.mnuViewInMemoryType.Click += new System.EventHandler(this.mnuViewInMemoryType_Click); + // + // mnuViewInDisassembly + // + this.mnuViewInDisassembly.Image = global::Mesen.GUI.Properties.Resources.Bug; + this.mnuViewInDisassembly.Name = "mnuViewInDisassembly"; + this.mnuViewInDisassembly.Size = new System.Drawing.Size(186, 22); + this.mnuViewInDisassembly.Text = "View in disassembly"; + this.mnuViewInDisassembly.Click += new System.EventHandler(this.mnuViewInDisassembly_Click); + // // ctrlHexViewer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -514,7 +552,7 @@ private System.Windows.Forms.ToolStripMenuItem mnuEditBreakpoint; private System.Windows.Forms.ToolStripMenuItem mnuEditLabel; private System.Windows.Forms.ToolStripMenuItem mnuFreeze; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripSeparator sepViewActions; private System.Windows.Forms.ToolStripMenuItem mnuUnfreeze; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; private System.Windows.Forms.ToolStripMenuItem mnuCopy; @@ -526,5 +564,9 @@ private System.Windows.Forms.ToolStripMenuItem mnuMarkAsUnidentifiedData; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem5; + private System.Windows.Forms.ToolStripMenuItem mnuViewInCpuMemory; + private System.Windows.Forms.ToolStripMenuItem mnuViewInDisassembly; + private System.Windows.Forms.ToolStripMenuItem mnuViewInMemoryType; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6; } } diff --git a/GUI.NET/Debugger/Controls/ctrlHexViewer.cs b/GUI.NET/Debugger/Controls/ctrlHexViewer.cs index 5ba4b7bf..f7033c8f 100644 --- a/GUI.NET/Debugger/Controls/ctrlHexViewer.cs +++ b/GUI.NET/Debugger/Controls/ctrlHexViewer.cs @@ -11,6 +11,7 @@ using Mesen.GUI.Config; using Be.Windows.Forms; using Mesen.GUI.Controls; using static Be.Windows.Forms.DynamicByteProvider; +using Mesen.GUI.Forms; namespace Mesen.GUI.Debugger.Controls { @@ -60,6 +61,10 @@ namespace Mesen.GUI.Debugger.Controls mnuMarkAsCode.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsCode)); mnuMarkAsData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsData)); mnuMarkAsUnidentifiedData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsUnidentified)); + + mnuViewInCpuMemory.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInCpuMemory)); + mnuViewInDisassembly.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInDisassembly)); + mnuViewInMemoryType.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInMemoryType)); } public byte[] GetData() @@ -461,6 +466,8 @@ namespace Mesen.GUI.Debugger.Controls private int SelectionStartAddress { get { return (int)ctrlHexBox.SelectionStart; } } private int SelectionEndAddress { get { return (int)(ctrlHexBox.SelectionStart + (ctrlHexBox.SelectionLength == 0 ? 0 : (ctrlHexBox.SelectionLength - 1))); } } + public frmMemoryViewer MemoryViewer { get; internal set; } + private void MarkSelectionAs(int start, int end, CdlPrgFlags type) { if(_memoryType == DebugMemoryType.CpuMemory) { @@ -559,6 +566,38 @@ namespace Mesen.GUI.Debugger.Controls mnuEditBreakpoint.Text = $"Edit Breakpoint ({addressRange})"; mnuAddToWatch.Text = $"Add to Watch ({addressRange})"; + mnuViewInDisassembly.Text = $"View in disassembly ({address})"; + + bool viewInCpuMemoryVisible = (_memoryType == DebugMemoryType.PrgRom || _memoryType == DebugMemoryType.WorkRam || _memoryType == DebugMemoryType.SaveRam); + bool viewInMemoryTypeVisible = _memoryType == DebugMemoryType.CpuMemory; + mnuViewInCpuMemory.Visible = viewInCpuMemoryVisible; + mnuViewInMemoryType.Visible = viewInMemoryTypeVisible; + mnuViewInDisassembly.Visible = (viewInCpuMemoryVisible || viewInMemoryTypeVisible); + sepViewActions.Visible = (viewInCpuMemoryVisible || viewInMemoryTypeVisible); + + if(viewInMemoryTypeVisible) { + frmDebugger debugger = DebugWindowManager.GetDebugger(); + AddressTypeInfo addressInfo = new AddressTypeInfo(); + InteropEmu.DebugGetAbsoluteAddressAndType(startAddress, addressInfo); + mnuViewInMemoryType.Text = $"View in " + ResourceHelper.GetEnumText(addressInfo.Type) + $" ({address})"; + mnuViewInDisassembly.Enabled = debugger != null; + bool viewInMemoryTypeEnabled = addressInfo.Address >= 0 && (addressInfo.Type == AddressType.PrgRom || addressInfo.Type == AddressType.WorkRam || addressInfo.Type == AddressType.SaveRam); + mnuViewInMemoryType.Enabled = viewInMemoryTypeEnabled; + mnuViewInMemoryType.Visible = viewInMemoryTypeEnabled; + mnuViewInCpuMemory.Enabled = false; + } else if(viewInCpuMemoryVisible) { + frmDebugger debugger = DebugWindowManager.GetDebugger(); + int relativeAddress = InteropEmu.DebugGetRelativeAddress(startAddress, _memoryType.ToAddressType()); + mnuViewInCpuMemory.Text = $"View in CPU memory ({address})"; + mnuViewInCpuMemory.Enabled = relativeAddress >= 0; + mnuViewInDisassembly.Enabled = debugger != null && relativeAddress >= 0; + mnuViewInMemoryType.Enabled = false; + } else { + mnuViewInMemoryType.Enabled = false; + mnuViewInCpuMemory.Enabled = false; + mnuViewInDisassembly.Enabled = false; + } + if(this._memoryType == DebugMemoryType.CpuMemory) { bool[] freezeState = InteropEmu.DebugGetFreezeState((UInt16)startAddress, (UInt16)(endAddress - startAddress + 1)); mnuFreeze.Enabled = !freezeState.All((frozen) => frozen); @@ -643,5 +682,35 @@ namespace Mesen.GUI.Debugger.Controls InteropEmu.DebugPerformUndo(); this.RefreshData(_memoryType); } + + private void mnuViewInCpuMemory_Click(object sender, EventArgs e) + { + int relativeAddress = InteropEmu.DebugGetRelativeAddress((UInt32)SelectionStartAddress, _memoryType.ToAddressType()); + if(relativeAddress >= 0) { + MemoryViewer.ShowAddress(relativeAddress, DebugMemoryType.CpuMemory); + } + } + + private void mnuViewInMemoryType_Click(object sender, EventArgs e) + { + AddressTypeInfo addressInfo = new AddressTypeInfo(); + InteropEmu.DebugGetAbsoluteAddressAndType((UInt32)SelectionStartAddress, addressInfo); + if(addressInfo.Address >= 0 && (addressInfo.Type == AddressType.PrgRom || addressInfo.Type == AddressType.WorkRam || addressInfo.Type == AddressType.SaveRam)) { + MemoryViewer.ShowAddress(addressInfo.Address, addressInfo.Type.ToMemoryType()); + } + } + + private void mnuViewInDisassembly_Click(object sender, EventArgs e) + { + frmDebugger debugger = DebugWindowManager.GetDebugger(); + if(debugger != null) { + if(_memoryType == DebugMemoryType.CpuMemory) { + debugger.ScrollToAddress(SelectionStartAddress); + } else if(_memoryType == DebugMemoryType.PrgRom || _memoryType == DebugMemoryType.WorkRam || _memoryType == DebugMemoryType.SaveRam) { + int relativeAddress = InteropEmu.DebugGetRelativeAddress((UInt32)SelectionStartAddress, _memoryType.ToAddressType()); + debugger.ScrollToAddress(relativeAddress); + } + } + } } } diff --git a/GUI.NET/Debugger/Controls/ctrlHexViewer.resx b/GUI.NET/Debugger/Controls/ctrlHexViewer.resx index 8890e1ac..26cc44ce 100644 --- a/GUI.NET/Debugger/Controls/ctrlHexViewer.resx +++ b/GUI.NET/Debugger/Controls/ctrlHexViewer.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - 107, 17 diff --git a/GUI.NET/Debugger/Controls/ctrlLabelList.cs b/GUI.NET/Debugger/Controls/ctrlLabelList.cs index e0dbb941..2b5909fe 100644 --- a/GUI.NET/Debugger/Controls/ctrlLabelList.cs +++ b/GUI.NET/Debugger/Controls/ctrlLabelList.cs @@ -10,6 +10,7 @@ using System.Windows.Forms; using System.Collections; using Mesen.GUI.Controls; using Mesen.GUI.Config; +using Mesen.GUI.Forms; namespace Mesen.GUI.Debugger.Controls { @@ -199,13 +200,7 @@ namespace Mesen.GUI.Debugger.Controls CodeLabel label = (CodeLabel)item.SubItems[1].Tag; if(label.AddressType != AddressType.Register && label.AddressType != AddressType.InternalRam) { - string memoryType = ""; - switch(label.AddressType) { - case AddressType.PrgRom: memoryType = "PRG ROM"; break; - case AddressType.SaveRam: memoryType = "Save RAM"; break; - case AddressType.WorkRam: memoryType = "Work RAM"; break; - } - mnuViewInMemoryType.Text = "View in " + memoryType; + mnuViewInMemoryType.Text = "View in " + ResourceHelper.GetEnumText(label.AddressType); mnuViewInMemoryType.Enabled = true; } else { mnuViewInMemoryType.Enabled = false; diff --git a/GUI.NET/Debugger/frmDbgPreferences.cs b/GUI.NET/Debugger/frmDbgPreferences.cs index edb9aaae..57edcff1 100644 --- a/GUI.NET/Debugger/frmDbgPreferences.cs +++ b/GUI.NET/Debugger/frmDbgPreferences.cs @@ -55,7 +55,10 @@ namespace Mesen.GUI.Debugger GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_EditBreakpoint)), GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_EditLabel)), GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_Import)), - GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_Export)) + GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_Export)), + GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInCpuMemory)), + GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInMemoryType)), + GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInDisassembly)) }; ctrlDbgShortcutsScriptWindow.Shortcuts = new FieldInfo[] { diff --git a/GUI.NET/Debugger/frmDebugger.cs b/GUI.NET/Debugger/frmDebugger.cs index 57255e23..b7e277ae 100644 --- a/GUI.NET/Debugger/frmDebugger.cs +++ b/GUI.NET/Debugger/frmDebugger.cs @@ -866,6 +866,11 @@ namespace Mesen.GUI.Debugger ctrlSourceViewerSplit.RefreshViewer(); } + public void ScrollToAddress(int address) + { + _lastCodeWindow.ScrollToLineNumber(address); + } + private void ctrlDebuggerCode_Enter(object sender, EventArgs e) { _lastCodeWindow = (ICodeViewer)sender; diff --git a/GUI.NET/Debugger/frmMemoryViewer.cs b/GUI.NET/Debugger/frmMemoryViewer.cs index 4ea105ad..d0651364 100644 --- a/GUI.NET/Debugger/frmMemoryViewer.cs +++ b/GUI.NET/Debugger/frmMemoryViewer.cs @@ -77,6 +77,7 @@ namespace Mesen.GUI.Debugger this.InitTblMappings(); this.ctrlHexViewer.StringViewVisible = mnuShowCharacters.Checked; + this.ctrlHexViewer.MemoryViewer = this; UpdateImportButton(); InitMemoryTypeDropdown(true);