Debugger: Nametable viewer - Added "Add breakpoint" right-click option
This commit is contained in:
parent
4c9e297034
commit
62c2541642
2 changed files with 36 additions and 1 deletions
|
@ -33,6 +33,7 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.picNametable = new System.Windows.Forms.PictureBox();
|
||||
this.ctxMenu = new Mesen.GUI.Controls.ctrlMesenContextMenuStrip(this.components);
|
||||
this.mnuAddBreakpoint = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuEditInMemoryViewer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuShowInChrViewer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
|
@ -125,6 +126,7 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
// ctxMenu
|
||||
//
|
||||
this.ctxMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.mnuAddBreakpoint,
|
||||
this.mnuEditInMemoryViewer,
|
||||
this.mnuShowInChrViewer,
|
||||
this.toolStripMenuItem1,
|
||||
|
@ -134,9 +136,17 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
this.mnuCopyToClipboard,
|
||||
this.mnuExportToPng});
|
||||
this.ctxMenu.Name = "ctxMenu";
|
||||
this.ctxMenu.Size = new System.Drawing.Size(261, 148);
|
||||
this.ctxMenu.Size = new System.Drawing.Size(261, 170);
|
||||
this.ctxMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ctxMenu_Opening);
|
||||
//
|
||||
// mnuAddBreakpoint
|
||||
//
|
||||
this.mnuAddBreakpoint.Image = global::Mesen.GUI.Properties.Resources.Breakpoint;
|
||||
this.mnuAddBreakpoint.Name = "mnuAddBreakpoint";
|
||||
this.mnuAddBreakpoint.Size = new System.Drawing.Size(260, 22);
|
||||
this.mnuAddBreakpoint.Text = "Add breakpoint";
|
||||
this.mnuAddBreakpoint.Click += new System.EventHandler(this.mnuToggleBreakpoint_Click);
|
||||
//
|
||||
// mnuEditInMemoryViewer
|
||||
//
|
||||
this.mnuEditInMemoryViewer.Image = global::Mesen.GUI.Properties.Resources.CheatCode;
|
||||
|
@ -669,5 +679,6 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
private System.Windows.Forms.ToolStripMenuItem mnuEditInMemoryViewer;
|
||||
private System.Windows.Forms.Label lblHighlight;
|
||||
private System.Windows.Forms.CheckBox chkIgnoreRedundantWrites;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuAddBreakpoint;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
if(!IsDesignMode) {
|
||||
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
|
||||
mnuEditInMemoryViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditInMemoryViewer));
|
||||
mnuAddBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -437,6 +438,9 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
|
||||
private void ctxMenu_Opening(object sender, CancelEventArgs e)
|
||||
{
|
||||
mnuAddBreakpoint.Text = "Add breakpoint ($" + _currentPpuAddress.ToString("X4") + ")";
|
||||
mnuEditInMemoryViewer.Text = "Edit in Memory Viewer ($" + _currentPpuAddress.ToString("X4") + ")";
|
||||
mnuAddBreakpoint.Enabled = DebugWindowManager.GetDebugger() != null;
|
||||
mnuCopyNametableHdPack.Visible = Control.ModifierKeys == Keys.Shift;
|
||||
_copyData = ToHdPackFormat(_nametableIndex, _tileY * 32 + _tileX);
|
||||
}
|
||||
|
@ -507,6 +511,26 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
DebugWindowManager.OpenMemoryViewer(_currentPpuAddress, DebugMemoryType.PpuMemory);
|
||||
}
|
||||
|
||||
private void mnuToggleBreakpoint_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(DebugWindowManager.GetDebugger() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
PpuAddressTypeInfo addressInfo = InteropEmu.DebugGetPpuAbsoluteAddressAndType((uint)_currentPpuAddress);
|
||||
|
||||
BreakpointManager.EditBreakpoint(new Breakpoint() {
|
||||
MemoryType = addressInfo.Type.ToMemoryType(),
|
||||
BreakOnExec = false,
|
||||
BreakOnRead = true,
|
||||
BreakOnWrite = true,
|
||||
Address = (UInt32)addressInfo.Address,
|
||||
StartAddress = (UInt32)addressInfo.Address,
|
||||
EndAddress = (UInt32)addressInfo.Address,
|
||||
AddressType = BreakpointAddressType.SingleAddress
|
||||
});
|
||||
}
|
||||
|
||||
private void picNametable_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
if(this.ParentForm.ContainsFocus) {
|
||||
|
|
Loading…
Add table
Reference in a new issue