Debugger: Ability to customize all keyboard shortcuts

This commit is contained in:
Sour 2018-03-10 09:58:24 -05:00
parent 64ae52322a
commit e6014830f2
51 changed files with 2018 additions and 376 deletions

View file

@ -464,14 +464,6 @@ enum class EmulatorShortcut
LoadStateFromFile,
OpenFile,
OpenDebugger,
OpenAssembler,
OpenPpuViewer,
OpenMemoryTools,
OpenScriptWindow,
OpenTraceLogger,
OpenApuViewer,
OpenEventViewer,
ShortcutCount
};

View file

@ -274,6 +274,8 @@ namespace Mesen.GUI.Config
public float AssemblerFontSize = BaseControl.DefaultFontSize;
public int AssemblerZoom = 100;
public DebuggerShortcutsConfig Shortcuts = new DebuggerShortcutsConfig();
public DebugInfo()
{
LeftView = new DebugViewInfo();

View file

@ -0,0 +1,322 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using System.Windows.Forms;
using Mesen.GUI.Forms;
using static Mesen.GUI.Forms.BaseForm;
namespace Mesen.GUI.Config
{
public class DebuggerShortcutsConfig
{
//Shared
[ShortcutName("Increase Font Size")]
public XmlKeys IncreaseFontSize = Keys.Control | Keys.Oemplus;
[ShortcutName("Decrease Font Size")]
public XmlKeys DecreaseFontSize = Keys.Control | Keys.OemMinus;
[ShortcutName("Reset Font Size")]
public XmlKeys ResetFontSize = Keys.Control | Keys.D0;
[ShortcutName("Go To...")]
public XmlKeys GoTo = Keys.Control | Keys.G;
[ShortcutName("Find")]
public XmlKeys Find = Keys.Control | Keys.F;
[ShortcutName("Find Next")]
public XmlKeys FindNext = Keys.F3;
[ShortcutName("Find Previous")]
public XmlKeys FindPrev = Keys.Shift | Keys.F3;
[ShortcutName("Undo")]
public XmlKeys Undo = Keys.Control | Keys.Z;
[ShortcutName("Copy")]
public XmlKeys Copy = Keys.Control | Keys.C;
[ShortcutName("Cut")]
public XmlKeys Cut = Keys.Control | Keys.X;
[ShortcutName("Paste")]
public XmlKeys Paste = Keys.Control | Keys.V;
[ShortcutName("Select All")]
public XmlKeys SelectAll = Keys.Control | Keys.A;
[ShortcutName("Refresh")]
public XmlKeys Refresh = Keys.F5;
[ShortcutName("Mark Selection as Code")]
public XmlKeys MarkAsCode = Keys.Control | Keys.D1;
[ShortcutName("Mark Selection as Data")]
public XmlKeys MarkAsData = Keys.Control | Keys.D2;
[ShortcutName("Mark Selection as Unidentified Code/Data")]
public XmlKeys MarkAsUnidentified = Keys.Control | Keys.D3;
[ShortcutName("Open APU Viewer")]
public XmlKeys OpenApuViewer = Keys.Control | Keys.U;
[ShortcutName("Open Assembler")]
public XmlKeys OpenAssembler = Keys.Control | Keys.K;
[ShortcutName("Open Debugger")]
public XmlKeys OpenDebugger = Keys.Control | Keys.D;
[ShortcutName("Open Memory Tools")]
public XmlKeys OpenMemoryTools = Keys.Control | Keys.M;
[ShortcutName("Open NES Event Viewer")]
public XmlKeys OpenEventViewer = Keys.Control | Keys.E;
[ShortcutName("Open PPU Viewer")]
public XmlKeys OpenPpuViewer = Keys.Control | Keys.P;
[ShortcutName("Open Script Window")]
public XmlKeys OpenScriptWindow = Keys.Control | Keys.N;
[ShortcutName("Open Trace Logger")]
public XmlKeys OpenTraceLogger = Keys.Control | Keys.J;
//Debugger window
[ShortcutName("Continue")]
public XmlKeys Continue = Keys.F5;
[ShortcutName("Break")]
public XmlKeys Break = Keys.Control | Keys.Alt | Keys.Cancel;
[ShortcutName("Step Into")]
public XmlKeys StepInto = Keys.F11;
[ShortcutName("Step Over")]
public XmlKeys StepOver = Keys.F10;
[ShortcutName("Step Out")]
public XmlKeys StepOut = Keys.Shift | Keys.F11;
[ShortcutName("Step Back")]
public XmlKeys StepBack = Keys.Shift | Keys.F10;
[ShortcutName("Run one PPU Cycle")]
public XmlKeys RunPpuCycle = Keys.F6;
[ShortcutName("Run one scanline")]
public XmlKeys RunPpuScanline = Keys.F7;
[ShortcutName("Run one frame")]
public XmlKeys RunPpuFrame = Keys.F8;
[ShortcutName("Break In...")]
public XmlKeys BreakIn = Keys.Control | Keys.B;
[ShortcutName("Find Occurrences")]
public XmlKeys FindOccurrences = Keys.Control | Keys.Shift | Keys.F;
[ShortcutName("Go To Program Counter")]
public XmlKeys GoToProgramCounter = Keys.Alt | Keys.Multiply;
[ShortcutName("Toggle Verified Data Display")]
public XmlKeys ToggleVerifiedData = Keys.Alt | Keys.D1;
[ShortcutName("Toggle Unidentified Code/Data Display")]
public XmlKeys ToggleUnidentifiedCodeData = Keys.Alt | Keys.D2;
[ShortcutName("Code Window: Set Next Statement")]
public XmlKeys CodeWindow_SetNextStatement = Keys.Control | Keys.Shift | Keys.F10;
[ShortcutName("Code Window: Edit Subroutine")]
public XmlKeys CodeWindow_EditSubroutine = Keys.F4;
[ShortcutName("Code Window: Edit Selected Code")]
public XmlKeys CodeWindow_EditSelectedCode = Keys.None;
[ShortcutName("Code Window: Edit in Memory Viewer")]
public XmlKeys CodeWindow_EditInMemoryViewer = Keys.F1;
[ShortcutName("Code Window: Edit Label")]
public XmlKeys CodeWindow_EditLabel = Keys.F2;
[ShortcutName("Code Window: Navigate Back")]
public XmlKeys CodeWindow_NavigateBack = Keys.Alt | Keys.Left;
[ShortcutName("Code Window: Navigate Forward")]
public XmlKeys CodeWindow_NavigateForward = Keys.Alt | Keys.Right;
[ShortcutName("Code Window: Toggle Breakpoint")]
public XmlKeys CodeWindow_ToggleBreakpoint = Keys.F9;
[ShortcutName("Code Window: Disable/Enable Breakpoint")]
public XmlKeys CodeWindow_DisableEnableBreakpoint = Keys.Control | Keys.F9;
[ShortcutName("Function List: Edit Label")]
public XmlKeys FunctionList_EditLabel = Keys.F2;
[ShortcutName("Function List: Add Breakpoint")]
public XmlKeys FunctionList_AddBreakpoint = Keys.None;
[ShortcutName("Function List: Find Occurrences")]
public XmlKeys FunctionList_FindOccurrences = Keys.None;
[ShortcutName("Label List: Add Label")]
public XmlKeys LabelList_Add = Keys.Insert;
[ShortcutName("Label List: Edit Label")]
public XmlKeys LabelList_Edit = Keys.F2;
[ShortcutName("Label List: Delete Label")]
public XmlKeys LabelList_Delete = Keys.Delete;
[ShortcutName("Label List: Add Breakpoint")]
public XmlKeys LabelList_AddBreakpoint = Keys.None;
[ShortcutName("Label List: Add to Watch")]
public XmlKeys LabelList_AddToWatch = Keys.None;
[ShortcutName("Label List: Find Occurrences")]
public XmlKeys LabelList_FindOccurrences = Keys.None;
[ShortcutName("Breakpoint List: Add Breakpoint")]
public XmlKeys BreakpointList_Add = Keys.Insert;
[ShortcutName("Breakpoint List: Edit Breakpoint")]
public XmlKeys BreakpointList_Edit = Keys.F2;
[ShortcutName("Breakpoint List: Go To Location")]
public XmlKeys BreakpointList_GoToLocation = Keys.None;
[ShortcutName("Breakpoint List: Delete Breakpoint")]
public XmlKeys BreakpointList_Delete = Keys.Delete;
[ShortcutName("Watch List: Delete")]
public XmlKeys WatchList_Delete = Keys.Delete;
[ShortcutName("Save Rom")]
public XmlKeys SaveRom = Keys.Control | Keys.S;
[ShortcutName("Save Rom As...")]
public XmlKeys SaveRomAs = Keys.None;
[ShortcutName("Save edits as IPS patch...")]
public XmlKeys SaveEditAsIps = Keys.None;
[ShortcutName("Revert PRG/CHR changes")]
public XmlKeys RevertPrgChrChanges = Keys.None;
//Memory Tools
[ShortcutName("Freeze")]
public XmlKeys MemoryViewer_Freeze = Keys.Control | Keys.Q;
[ShortcutName("Unfreeze")]
public XmlKeys MemoryViewer_Unfreeze = Keys.Control | Keys.W;
[ShortcutName("Add to Watch")]
public XmlKeys MemoryViewer_AddToWatch = Keys.None;
[ShortcutName("Edit Breakpoint")]
public XmlKeys MemoryViewer_EditBreakpoint = Keys.None;
[ShortcutName("Edit Label")]
public XmlKeys MemoryViewer_EditLabel = Keys.None;
[ShortcutName("Import")]
public XmlKeys MemoryViewer_Import = Keys.Control | Keys.O;
[ShortcutName("Export")]
public XmlKeys MemoryViewer_Export = Keys.Control | Keys.S;
//Script Window
[ShortcutName("Open Script")]
public XmlKeys ScriptWindow_OpenScript = Keys.Control | Keys.N;
[ShortcutName("Save Script")]
public XmlKeys ScriptWindow_SaveScript = Keys.Control | Keys.S;
[ShortcutName("Run Script")]
public XmlKeys ScriptWindow_RunScript = Keys.F5;
[ShortcutName("Stop Script")]
public XmlKeys ScriptWindow_StopScript = Keys.Escape;
public static string GetShortcutDisplay(Keys keys)
{
if(keys == Keys.None) {
return "";
} else {
string keyString = new KeysConverter().ConvertToString(keys);
return keyString.Replace("+None", "").Replace("Oemplus", "+").Replace("Oemtilde", "Tilde").Replace("OemMinus", "-").Replace("Cancel", "Break").Replace("Escape", "Esc");
}
}
private static Dictionary<WeakReference<ToolStripMenuItem>, string> _bindings = new Dictionary<WeakReference<ToolStripMenuItem>, string>();
private static Dictionary<WeakReference<ToolStripMenuItem>, Control> _parents = new Dictionary<WeakReference<ToolStripMenuItem>, Control>();
public static void RegisterMenuItem(ToolStripMenuItem item, Control parent, string fieldName)
{
var weakRef = new WeakReference<ToolStripMenuItem>(item);
_bindings[weakRef] = fieldName;
_parents[weakRef] = parent;
//Remove old references
foreach(WeakReference<ToolStripMenuItem> itemRef in _bindings.Keys.ToArray()) {
ToolStripMenuItem menuItem;
if(!itemRef.TryGetTarget(out menuItem)) {
_bindings.Remove(itemRef);
_parents.Remove(itemRef);
}
}
}
public static void UpdateMenus()
{
foreach(WeakReference<ToolStripMenuItem> itemRef in _bindings.Keys) {
ToolStripMenuItem item;
if(itemRef.TryGetTarget(out item)) {
string fieldName = _bindings[itemRef];
Control parent = _parents[itemRef];
UpdateShortcutItem(item, parent, fieldName);
}
}
}
private static void ClearProcessCmdKeyHandler(ToolStripMenuItem item, Control parent)
{
Form parentForm = parent.FindForm();
if(parentForm is BaseForm) {
(parentForm as BaseForm).OnProcessCmdKey -= (ProcessCmdKeyHandler)item.Tag;
}
item.Tag = null;
}
public static void UpdateShortcutItem(ToolStripMenuItem item, Control parent, string fieldName)
{
if(item.Tag is ProcessCmdKeyHandler) {
ClearProcessCmdKeyHandler(item, parent);
}
Keys keys = (XmlKeys)typeof(DebuggerShortcutsConfig).GetField(fieldName).GetValue(ConfigManager.Config.DebugInfo.Shortcuts);
if(keys != Keys.None && !ToolStripManager.IsValidShortcut(keys)) {
//Support normally invalid shortcut keys as a shortcut
item.ShortcutKeys = Keys.None;
item.ShortcutKeyDisplayString = GetShortcutDisplay(keys);
Form parentForm = parent.FindForm();
if(parentForm is BaseForm) {
ProcessCmdKeyHandler onProcessCmdKeyHandler = (Keys keyData) => {
if(keyData == keys) {
item.PerformClick();
return true;
}
return false;
};
item.Tag = onProcessCmdKeyHandler;
(parentForm as BaseForm).OnProcessCmdKey += onProcessCmdKeyHandler;
}
} else {
item.ShortcutKeys = keys;
item.ShortcutKeyDisplayString = GetShortcutDisplay(keys);
}
}
}
public static class ToolStripMenuItemExtensions
{
public static void InitShortcut(this ToolStripMenuItem item, Control parent, string fieldName)
{
DebuggerShortcutsConfig.UpdateShortcutItem(item, parent, fieldName);
DebuggerShortcutsConfig.RegisterMenuItem(item, parent, fieldName);
}
}
public class XmlKeys
{
private Keys _keys = Keys.None;
public XmlKeys() { }
public XmlKeys(Keys k) { _keys = k; }
public static implicit operator Keys(XmlKeys k)
{
return k._keys;
}
public static implicit operator XmlKeys(Keys k)
{
return new XmlKeys(k);
}
[XmlAttribute]
public string Value
{
get { return _keys.ToString(); }
set
{
try {
Enum.TryParse<Keys>(value, out _keys);
} catch(Exception) {
_keys = Keys.None;
}
}
}
}
public class ShortcutNameAttribute : Attribute
{
public string Name { get; private set; }
public ShortcutNameAttribute(string name)
{
this.Name = name;
}
}
}

View file

@ -122,15 +122,6 @@ namespace Mesen.GUI.Config
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.SetScale5x, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Alt"), Key2 = InteropEmu.GetKeyCode("5") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.SetScale6x, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Alt"), Key2 = InteropEmu.GetKeyCode("6") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenAssembler, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("A") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenDebugger, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("D") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenMemoryTools, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("M") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenPpuViewer, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("P") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenScriptWindow, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("J") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenTraceLogger, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("N") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenApuViewer, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("U") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenEventViewer, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("E") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.OpenFile, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("O") }));
ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.SaveStateSlot1, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Shift"), Key2 = InteropEmu.GetKeyCode("F1") }));

View file

@ -64,7 +64,6 @@
//
this.mnuAddBreakpoint.Image = global::Mesen.GUI.Properties.Resources.Add;
this.mnuAddBreakpoint.Name = "mnuAddBreakpoint";
this.mnuAddBreakpoint.ShortcutKeys = System.Windows.Forms.Keys.Insert;
this.mnuAddBreakpoint.Size = new System.Drawing.Size(149, 22);
this.mnuAddBreakpoint.Text = "Add...";
this.mnuAddBreakpoint.Click += new System.EventHandler(this.mnuAddBreakpoint_Click);
@ -73,7 +72,6 @@
//
this.mnuEditBreakpoint.Image = global::Mesen.GUI.Properties.Resources.Edit;
this.mnuEditBreakpoint.Name = "mnuEditBreakpoint";
this.mnuEditBreakpoint.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.mnuEditBreakpoint.Size = new System.Drawing.Size(149, 22);
this.mnuEditBreakpoint.Text = "Edit";
this.mnuEditBreakpoint.Click += new System.EventHandler(this.mnuEditBreakpoint_Click);
@ -82,7 +80,6 @@
//
this.mnuRemoveBreakpoint.Image = global::Mesen.GUI.Properties.Resources.Close;
this.mnuRemoveBreakpoint.Name = "mnuRemoveBreakpoint";
this.mnuRemoveBreakpoint.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.mnuRemoveBreakpoint.Size = new System.Drawing.Size(149, 22);
this.mnuRemoveBreakpoint.Text = "Remove";
this.mnuRemoveBreakpoint.Click += new System.EventHandler(this.mnuRemoveBreakpoint_Click);

View file

@ -33,10 +33,20 @@ namespace Mesen.GUI.Debugger.Controls
mnuRemoveBreakpoint.Enabled = false;
mnuEditBreakpoint.Enabled = false;
mnuGoToLocation.Enabled = false;
InitShortcuts();
}
}
void BreakpointManager_OnBreakpointChanged(object sender, EventArgs e)
private void InitShortcuts()
{
mnuAddBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakpointList_Add));
mnuEditBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakpointList_Edit));
mnuRemoveBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakpointList_Delete));
mnuGoToLocation.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakpointList_GoToLocation));
}
private void BreakpointManager_OnBreakpointChanged(object sender, EventArgs e)
{
if(this.InvokeRequired) {
this.BeginInvoke((Action)(() => RefreshList()));

View file

@ -467,7 +467,6 @@
//
this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopyToClipboard.Name = "mnuCopyToClipboard";
this.mnuCopyToClipboard.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.mnuCopyToClipboard.Size = new System.Drawing.Size(247, 22);
this.mnuCopyToClipboard.Text = "Copy image to clipboard";
this.mnuCopyToClipboard.Click += new System.EventHandler(this.mnuCopyToClipboard_Click);

View file

@ -57,6 +57,8 @@ namespace Mesen.GUI.Debugger.Controls
this.chkAutoPalette.Checked = ConfigManager.Config.DebugInfo.ChrViewerUseAutoPalette;
this.chkLargeSprites.Checked = ConfigManager.Config.DebugInfo.ChrViewerUseLargeSprites;
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
}
}

View file

@ -0,0 +1,175 @@
namespace Mesen.GUI.Debugger
{
partial class ctrlDbgShortcuts
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.gridShortcuts = new System.Windows.Forms.DataGridView();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.pnlConflictWarning = new System.Windows.Forms.Panel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.picWarning = new System.Windows.Forms.PictureBox();
this.lblShortcutWarning = new System.Windows.Forms.Label();
this.colShortcut = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colKeys = new System.Windows.Forms.DataGridViewButtonColumn();
((System.ComponentModel.ISupportInitialize)(this.gridShortcuts)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.pnlConflictWarning.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picWarning)).BeginInit();
this.SuspendLayout();
//
// gridShortcuts
//
this.gridShortcuts.AllowUserToAddRows = false;
this.gridShortcuts.AllowUserToDeleteRows = false;
this.gridShortcuts.AllowUserToResizeColumns = false;
this.gridShortcuts.AllowUserToResizeRows = false;
this.gridShortcuts.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
this.gridShortcuts.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridShortcuts.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colShortcut,
this.colKeys});
this.gridShortcuts.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridShortcuts.Location = new System.Drawing.Point(0, 32);
this.gridShortcuts.Margin = new System.Windows.Forms.Padding(0);
this.gridShortcuts.MultiSelect = false;
this.gridShortcuts.Name = "gridShortcuts";
this.gridShortcuts.RowHeadersVisible = false;
this.gridShortcuts.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.gridShortcuts.Size = new System.Drawing.Size(448, 216);
this.gridShortcuts.TabIndex = 2;
this.gridShortcuts.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.gridShortcuts_CellMouseDown);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.pnlConflictWarning, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.gridShortcuts, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(448, 248);
this.tableLayoutPanel1.TabIndex = 3;
//
// pnlConflictWarning
//
this.pnlConflictWarning.BackColor = System.Drawing.Color.WhiteSmoke;
this.pnlConflictWarning.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pnlConflictWarning.Controls.Add(this.tableLayoutPanel2);
this.pnlConflictWarning.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlConflictWarning.Location = new System.Drawing.Point(0, 0);
this.pnlConflictWarning.Margin = new System.Windows.Forms.Padding(0, 0, 0, 2);
this.pnlConflictWarning.Name = "pnlConflictWarning";
this.pnlConflictWarning.Size = new System.Drawing.Size(448, 30);
this.pnlConflictWarning.TabIndex = 20;
this.pnlConflictWarning.Visible = false;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.picWarning, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.lblShortcutWarning, 1, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(446, 28);
this.tableLayoutPanel2.TabIndex = 0;
//
// picWarning
//
this.picWarning.Anchor = System.Windows.Forms.AnchorStyles.None;
this.picWarning.Image = global::Mesen.GUI.Properties.Resources.Warning;
this.picWarning.Location = new System.Drawing.Point(3, 6);
this.picWarning.Name = "picWarning";
this.picWarning.Size = new System.Drawing.Size(16, 16);
this.picWarning.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.picWarning.TabIndex = 0;
this.picWarning.TabStop = false;
//
// lblShortcutWarning
//
this.lblShortcutWarning.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblShortcutWarning.Location = new System.Drawing.Point(25, 0);
this.lblShortcutWarning.Name = "lblShortcutWarning";
this.lblShortcutWarning.Size = new System.Drawing.Size(418, 28);
this.lblShortcutWarning.TabIndex = 1;
this.lblShortcutWarning.Text = "Warning: Your current configuration contains conflicting key bindings. If this is" +
" not intentional, please review and correct your key bindings.";
//
// colShortcut
//
this.colShortcut.HeaderText = "Shortcut";
this.colShortcut.Name = "colShortcut";
this.colShortcut.ReadOnly = true;
this.colShortcut.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.colShortcut.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.colShortcut.Width = 233;
//
// colKeys
//
this.colKeys.HeaderText = "Keys";
this.colKeys.Name = "colKeys";
this.colKeys.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.colKeys.Width = 110;
//
// ctrlDbgShortcuts
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "ctrlDbgShortcuts";
this.Size = new System.Drawing.Size(448, 248);
((System.ComponentModel.ISupportInitialize)(this.gridShortcuts)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.pnlConflictWarning.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picWarning)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView gridShortcuts;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel pnlConflictWarning;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.PictureBox picWarning;
private System.Windows.Forms.Label lblShortcutWarning;
private System.Windows.Forms.DataGridViewTextBoxColumn colShortcut;
private System.Windows.Forms.DataGridViewButtonColumn colKeys;
}
}

View file

@ -0,0 +1,70 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
using Mesen.GUI.Config;
using System.Reflection;
using Mesen.GUI.Controls;
using System.Collections.Generic;
namespace Mesen.GUI.Debugger
{
public partial class ctrlDbgShortcuts : BaseControl
{
private FieldInfo[] _shortcuts;
public ctrlDbgShortcuts()
{
InitializeComponent();
}
public FieldInfo[] Shortcuts
{
set
{
_shortcuts = value;
InitializeGrid();
}
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
this.colShortcut.Width = (int)(this.Width / 2.1);
this.colKeys.Width = (int)(this.Width / 2.1);
}
public void InitializeGrid()
{
HashSet<string> keyCombinations = new HashSet<string>();
gridShortcuts.Rows.Clear();
foreach(FieldInfo shortcut in _shortcuts) {
int i = gridShortcuts.Rows.Add();
gridShortcuts.Rows[i].Cells[0].Tag = shortcut;
gridShortcuts.Rows[i].Cells[0].Value = shortcut.GetCustomAttribute<ShortcutNameAttribute>()?.Name ?? shortcut.Name;
gridShortcuts.Rows[i].Cells[1].Value = DebuggerShortcutsConfig.GetShortcutDisplay(((XmlKeys)shortcut.GetValue(ConfigManager.Config.DebugInfo.Shortcuts)));
}
}
private void gridShortcuts_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
{
//Right-click on buttons to clear mappings
if(gridShortcuts.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) {
DataGridViewButtonCell button = gridShortcuts.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewButtonCell;
if(button != null) {
if(e.Button == MouseButtons.Right) {
button.Value = "";
_shortcuts[e.RowIndex].SetValue(ConfigManager.Config.DebugInfo.Shortcuts, (XmlKeys)Keys.None);
} else if(e.Button == MouseButtons.Left) {
using(frmDbgShortcutGetKey frm = new frmDbgShortcutGetKey()) {
frm.ShowDialog();
button.Value = DebuggerShortcutsConfig.GetShortcutDisplay(frm.ShortcutKeys);
_shortcuts[e.RowIndex].SetValue(ConfigManager.Config.DebugInfo.Shortcuts, (XmlKeys)frm.ShortcutKeys);
}
}
}
}
}
}
}

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colShortcut.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colKeys.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View file

@ -37,7 +37,7 @@
this.mnuEditSelectedCode = new System.Windows.Forms.ToolStripMenuItem();
this.mnuEditSubroutine = new System.Windows.Forms.ToolStripMenuItem();
this.mnuUndoPrgChrEdit = new System.Windows.Forms.ToolStripMenuItem();
this.copySelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuCopySelection = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator();
this.mnuShowNextStatement = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSetNextStatement = new System.Windows.Forms.ToolStripMenuItem();
@ -99,7 +99,7 @@
this.mnuEditSelectedCode,
this.mnuEditSubroutine,
this.mnuUndoPrgChrEdit,
this.copySelectionToolStripMenuItem,
this.mnuCopySelection,
this.toolStripMenuItem7,
this.mnuShowNextStatement,
this.mnuSetNextStatement,
@ -175,7 +175,6 @@
//
this.mnuEditSubroutine.Image = global::Mesen.GUI.Properties.Resources.Edit;
this.mnuEditSubroutine.Name = "mnuEditSubroutine";
this.mnuEditSubroutine.ShortcutKeys = System.Windows.Forms.Keys.F4;
this.mnuEditSubroutine.Size = new System.Drawing.Size(258, 22);
this.mnuEditSubroutine.Text = "Edit Subroutine";
this.mnuEditSubroutine.Click += new System.EventHandler(this.mnuEditSubroutine_Click);
@ -184,19 +183,17 @@
//
this.mnuUndoPrgChrEdit.Image = global::Mesen.GUI.Properties.Resources.Undo;
this.mnuUndoPrgChrEdit.Name = "mnuUndoPrgChrEdit";
this.mnuUndoPrgChrEdit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
this.mnuUndoPrgChrEdit.Size = new System.Drawing.Size(258, 22);
this.mnuUndoPrgChrEdit.Text = "Undo PRG/CHR Edit";
this.mnuUndoPrgChrEdit.Click += new System.EventHandler(this.mnuUndoPrgChrEdit_Click);
//
// copySelectionToolStripMenuItem
// mnuCopySelection
//
this.copySelectionToolStripMenuItem.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.copySelectionToolStripMenuItem.Name = "copySelectionToolStripMenuItem";
this.copySelectionToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.copySelectionToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
this.copySelectionToolStripMenuItem.Text = "Copy Selection";
this.copySelectionToolStripMenuItem.Click += new System.EventHandler(this.copySelectionToolStripMenuItem_Click);
this.mnuCopySelection.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopySelection.Name = "mnuCopySelection";
this.mnuCopySelection.Size = new System.Drawing.Size(258, 22);
this.mnuCopySelection.Text = "Copy Selection";
this.mnuCopySelection.Click += new System.EventHandler(this.mnuCopySelection_Click);
//
// toolStripMenuItem7
//
@ -207,7 +204,6 @@
//
this.mnuShowNextStatement.Name = "mnuShowNextStatement";
this.mnuShowNextStatement.ShortcutKeyDisplayString = "Alt+*";
this.mnuShowNextStatement.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.Multiply)));
this.mnuShowNextStatement.Size = new System.Drawing.Size(258, 22);
this.mnuShowNextStatement.Text = "Show Next Statement";
this.mnuShowNextStatement.Click += new System.EventHandler(this.mnuShowNextStatement_Click);
@ -215,8 +211,6 @@
// mnuSetNextStatement
//
this.mnuSetNextStatement.Name = "mnuSetNextStatement";
this.mnuSetNextStatement.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.F10)));
this.mnuSetNextStatement.Size = new System.Drawing.Size(258, 22);
this.mnuSetNextStatement.Text = "Set Next Statement";
this.mnuSetNextStatement.Click += new System.EventHandler(this.mnuSetNextStatement_Click);
@ -318,7 +312,6 @@
//
this.mnuEditLabel.Image = global::Mesen.GUI.Properties.Resources.EditLabel;
this.mnuEditLabel.Name = "mnuEditLabel";
this.mnuEditLabel.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.mnuEditLabel.Size = new System.Drawing.Size(258, 22);
this.mnuEditLabel.Text = "Edit Label";
this.mnuEditLabel.Click += new System.EventHandler(this.mnuEditLabel_Click);
@ -327,7 +320,6 @@
//
this.mnuEditInMemoryViewer.Image = global::Mesen.GUI.Properties.Resources.CheatCode;
this.mnuEditInMemoryViewer.Name = "mnuEditInMemoryViewer";
this.mnuEditInMemoryViewer.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.mnuEditInMemoryViewer.Size = new System.Drawing.Size(258, 22);
this.mnuEditInMemoryViewer.Text = "Edit in Memory Viewer";
this.mnuEditInMemoryViewer.Click += new System.EventHandler(this.mnuEditInMemoryViewer_Click);
@ -393,7 +385,6 @@
//
this.mnuNavigateBackward.Image = global::Mesen.GUI.Properties.Resources.NavigateBack;
this.mnuNavigateBackward.Name = "mnuNavigateBackward";
this.mnuNavigateBackward.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.Left)));
this.mnuNavigateBackward.Size = new System.Drawing.Size(258, 22);
this.mnuNavigateBackward.Text = "Navigate Backward";
this.mnuNavigateBackward.Click += new System.EventHandler(this.mnuNavigateBackward_Click);
@ -402,7 +393,6 @@
//
this.mnuNavigateForward.Image = global::Mesen.GUI.Properties.Resources.NavigateForward;
this.mnuNavigateForward.Name = "mnuNavigateForward";
this.mnuNavigateForward.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.Right)));
this.mnuNavigateForward.Size = new System.Drawing.Size(258, 22);
this.mnuNavigateForward.Text = "Navigate Forward";
this.mnuNavigateForward.Click += new System.EventHandler(this.mnuNavigateForward_Click);
@ -634,7 +624,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem7;
private System.Windows.Forms.ToolStripMenuItem mnuEditSubroutine;
private System.Windows.Forms.ToolStripMenuItem mnuEditSelectedCode;
private System.Windows.Forms.ToolStripMenuItem copySelectionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mnuCopySelection;
private System.Windows.Forms.ToolStripMenuItem mnuEditInMemoryViewer;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem mnuShowInSplitView;

View file

@ -48,6 +48,31 @@ namespace Mesen.GUI.Debugger
InitializeComponent();
this.lstSearchResult.Font = new System.Drawing.Font(BaseControl.MonospaceFontFamily, 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
splitContainer.Panel2Collapsed = true;
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
if(!designMode) {
this.InitShortcuts();
}
}
private void InitShortcuts()
{
mnuEditInMemoryViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditInMemoryViewer));
mnuEditLabel.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditLabel));
mnuEditSelectedCode.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditSelectedCode));
mnuEditSubroutine.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_EditSubroutine));
mnuNavigateBackward.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_NavigateBack));
mnuNavigateForward.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_NavigateForward));
mnuSetNextStatement.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_SetNextStatement));
mnuShowNextStatement.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToProgramCounter));
mnuToggleBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint));
mnuUndoPrgChrEdit.InitShortcut(this, nameof(DebuggerShortcutsConfig.Undo));
mnuCopySelection.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
mnuMarkAsCode.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsCode));
mnuMarkAsData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsData));
mnuMarkAsUnidentifiedData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsUnidentified));
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@ -609,10 +634,10 @@ namespace Mesen.GUI.Debugger
}
}
protected override bool ProcessKeyMessage(ref Message m)
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
this.UpdateContextMenuItemVisibility(mnuAddToWatch.Visible);
return base.ProcessKeyMessage(ref m);
return base.ProcessCmdKey(ref msg, keyData);
}
public void UpdateContextMenuItemVisibility(bool visible)
@ -941,7 +966,7 @@ namespace Mesen.GUI.Debugger
}
}
private void copySelectionToolStripMenuItem_Click(object sender, EventArgs e)
private void mnuCopySelection_Click(object sender, EventArgs e)
{
this.ctrlCodeViewer.CopySelection(ConfigManager.Config.DebugInfo.CopyAddresses, ConfigManager.Config.DebugInfo.CopyByteCode);
}

View file

@ -61,6 +61,7 @@
this.lstFunctions.TabIndex = 2;
this.lstFunctions.UseCompatibleStateImageBehavior = false;
this.lstFunctions.View = System.Windows.Forms.View.Details;
this.lstFunctions.SelectedIndexChanged += new System.EventHandler(this.lstFunctions_SelectedIndexChanged);
this.lstFunctions.DoubleClick += new System.EventHandler(this.lstFunctions_DoubleClick);
//
// colFunctionLabel
@ -87,14 +88,12 @@
this.toolStripMenuItem2,
this.mnuFindOccurrences});
this.contextMenuStrip.Name = "contextMenuStrip";
this.contextMenuStrip.Size = new System.Drawing.Size(167, 104);
this.contextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip_Opening);
this.contextMenuStrip.Size = new System.Drawing.Size(167, 82);
//
// mnuEditLabel
//
this.mnuEditLabel.Image = global::Mesen.GUI.Properties.Resources.EditLabel;
this.mnuEditLabel.Name = "mnuEditLabel";
this.mnuEditLabel.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.mnuEditLabel.Size = new System.Drawing.Size(166, 22);
this.mnuEditLabel.Text = "Edit Label";
this.mnuEditLabel.Click += new System.EventHandler(this.mnuEditLabel_Click);

View file

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Collections;
using Mesen.GUI.Controls;
using Mesen.GUI.Config;
namespace Mesen.GUI.Debugger.Controls
{
@ -20,6 +21,18 @@ namespace Mesen.GUI.Debugger.Controls
public ctrlFunctionList()
{
InitializeComponent();
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
if(!designMode) {
this.InitShortcuts();
}
}
private void InitShortcuts()
{
mnuEditLabel.InitShortcut(this, nameof(DebuggerShortcutsConfig.FunctionList_EditLabel));
mnuAddBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.FunctionList_AddBreakpoint));
mnuFindOccurrences.InitShortcut(this, nameof(DebuggerShortcutsConfig.FunctionList_FindOccurrences));
}
private class FunctionComparer : IComparer
@ -149,8 +162,8 @@ namespace Mesen.GUI.Debugger.Controls
}
}
}
private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
private void lstFunctions_SelectedIndexChanged(object sender, EventArgs e)
{
mnuEditLabel.Enabled = lstFunctions.SelectedItems.Count == 1;
mnuFindOccurrences.Enabled = lstFunctions.SelectedItems.Count == 1;

View file

@ -326,7 +326,7 @@
this.toolStripMenuItem5,
this.mnuSelectAll});
this.ctxMenuStrip.Name = "ctxMenuStrip";
this.ctxMenuStrip.Size = new System.Drawing.Size(175, 276);
this.ctxMenuStrip.Size = new System.Drawing.Size(175, 254);
this.ctxMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.ctxMenuStrip_Opening);
//
// mnuMarkSelectionAs
@ -343,7 +343,6 @@
//
this.mnuMarkAsCode.Image = global::Mesen.GUI.Properties.Resources.Accept;
this.mnuMarkAsCode.Name = "mnuMarkAsCode";
this.mnuMarkAsCode.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D1)));
this.mnuMarkAsCode.Size = new System.Drawing.Size(235, 22);
this.mnuMarkAsCode.Text = "Verified Code";
this.mnuMarkAsCode.Click += new System.EventHandler(this.mnuMarkAsCode_Click);
@ -352,7 +351,6 @@
//
this.mnuMarkAsData.Image = global::Mesen.GUI.Properties.Resources.VerifiedData;
this.mnuMarkAsData.Name = "mnuMarkAsData";
this.mnuMarkAsData.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D2)));
this.mnuMarkAsData.Size = new System.Drawing.Size(235, 22);
this.mnuMarkAsData.Text = "Verified Data";
this.mnuMarkAsData.Click += new System.EventHandler(this.mnuMarkAsData_Click);
@ -361,7 +359,6 @@
//
this.mnuMarkAsUnidentifiedData.Image = global::Mesen.GUI.Properties.Resources.UnidentifiedData;
this.mnuMarkAsUnidentifiedData.Name = "mnuMarkAsUnidentifiedData";
this.mnuMarkAsUnidentifiedData.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D3)));
this.mnuMarkAsUnidentifiedData.Size = new System.Drawing.Size(235, 22);
this.mnuMarkAsUnidentifiedData.Text = "Unidentified Code/Data";
this.mnuMarkAsUnidentifiedData.Click += new System.EventHandler(this.mnuMarkAsUnidentifiedData_Click);
@ -404,7 +401,6 @@
//
this.mnuFreeze.Image = global::Mesen.GUI.Properties.Resources.Stop;
this.mnuFreeze.Name = "mnuFreeze";
this.mnuFreeze.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q)));
this.mnuFreeze.Size = new System.Drawing.Size(174, 22);
this.mnuFreeze.Text = "Freeze";
this.mnuFreeze.Click += new System.EventHandler(this.mnuFreeze_Click);
@ -413,7 +409,6 @@
//
this.mnuUnfreeze.Image = global::Mesen.GUI.Properties.Resources.Play;
this.mnuUnfreeze.Name = "mnuUnfreeze";
this.mnuUnfreeze.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W)));
this.mnuUnfreeze.Size = new System.Drawing.Size(174, 22);
this.mnuUnfreeze.Text = "Unfreeze";
this.mnuUnfreeze.Click += new System.EventHandler(this.mnuUnfreeze_Click);
@ -427,7 +422,6 @@
//
this.mnuUndo.Image = global::Mesen.GUI.Properties.Resources.Undo;
this.mnuUndo.Name = "mnuUndo";
this.mnuUndo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
this.mnuUndo.Size = new System.Drawing.Size(174, 22);
this.mnuUndo.Text = "Undo";
this.mnuUndo.Click += new System.EventHandler(this.mnuUndo_Click);
@ -441,7 +435,6 @@
//
this.mnuCopy.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopy.Name = "mnuCopy";
this.mnuCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.mnuCopy.Size = new System.Drawing.Size(174, 22);
this.mnuCopy.Text = "Copy";
this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click);
@ -450,7 +443,6 @@
//
this.mnuPaste.Image = global::Mesen.GUI.Properties.Resources.Paste;
this.mnuPaste.Name = "mnuPaste";
this.mnuPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.mnuPaste.Size = new System.Drawing.Size(174, 22);
this.mnuPaste.Text = "Paste";
this.mnuPaste.Click += new System.EventHandler(this.mnuPaste_Click);
@ -464,7 +456,6 @@
//
this.mnuSelectAll.Image = global::Mesen.GUI.Properties.Resources.SelectAll;
this.mnuSelectAll.Name = "mnuSelectAll";
this.mnuSelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.mnuSelectAll.Size = new System.Drawing.Size(174, 22);
this.mnuSelectAll.Text = "Select All";
this.mnuSelectAll.Click += new System.EventHandler(this.mnuSelectAll_Click);

View file

@ -25,6 +25,7 @@ namespace Mesen.GUI.Debugger.Controls
InitializeComponent();
this.BaseFont = new Font(BaseControl.MonospaceFontFamily, 10, FontStyle.Regular);
this.ctrlHexBox.ContextMenuStrip = this.ctxMenuStrip;
this.ctrlHexBox.SelectionForeColor = Color.White;
this.ctrlHexBox.SelectionBackColor = Color.FromArgb(31, 123, 205);
this.ctrlHexBox.ShadowSelectionColor = Color.FromArgb(100, 60, 128, 200);
@ -33,9 +34,29 @@ namespace Mesen.GUI.Debugger.Controls
if(LicenseManager.UsageMode != LicenseUsageMode.Designtime) {
this.cboNumberColumns.SelectedIndex = ConfigManager.Config.DebugInfo.RamColumnCount;
this.InitShortcuts();
}
}
private void InitShortcuts()
{
mnuFreeze.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_Freeze));
mnuUnfreeze.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_Unfreeze));
mnuAddToWatch.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_AddToWatch));
mnuEditBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_EditBreakpoint));
mnuEditLabel.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_EditLabel));
mnuUndo.InitShortcut(this, nameof(DebuggerShortcutsConfig.Undo));
mnuCopy.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
mnuPaste.InitShortcut(this, nameof(DebuggerShortcutsConfig.Paste));
mnuSelectAll.InitShortcut(this, nameof(DebuggerShortcutsConfig.SelectAll));
mnuMarkAsCode.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsCode));
mnuMarkAsData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsData));
mnuMarkAsUnidentifiedData.InitShortcut(this, nameof(DebuggerShortcutsConfig.MarkAsUnidentified));
}
public byte[] GetData()
{
return this._byteProvider != null ? this._byteProvider.Bytes.ToArray() : new byte[0];
@ -68,7 +89,6 @@ namespace Mesen.GUI.Debugger.Controls
};
this.ctrlHexBox.ByteProvider = _byteProvider;
this.ctrlHexBox.ContextMenuStrip = this.ctxMenuStrip;
this.ctrlHexBox.Refresh();
}
}
@ -189,12 +209,27 @@ namespace Mesen.GUI.Debugger.Controls
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch(keyData) {
case Keys.Control | Keys.F: this.OpenSearchBox(true); return true;
case Keys.Escape: this.CloseSearchBox(); return true;
case Keys.Control | Keys.Oemplus: this.TextZoom += 10; return true;
case Keys.Control | Keys.OemMinus: this.TextZoom -= 10; return true;
case Keys.Control | Keys.D0: this.TextZoom = 100; return true;
this.UpdateActionAvailability();
if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.Find) {
this.OpenSearchBox(true);
return true;
} else if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.IncreaseFontSize) {
this.TextZoom += 10;
return true;
} else if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.DecreaseFontSize) {
this.TextZoom -= 10;
return true;
} else if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.ResetFontSize) {
this.TextZoom = 100;
return true;
}
if(this.cboSearch.Focused) {
if(keyData == Keys.Escape) {
this.CloseSearchBox();
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
@ -462,6 +497,7 @@ namespace Mesen.GUI.Debugger.Controls
for(int i = SelectionStartAddress, end = SelectionEndAddress; i <= end; i++) {
InteropEmu.DebugSetFreezeState((UInt16)i, true);
}
this.ctrlHexBox.Invalidate();
}
private void mnuUnfreeze_Click(object sender, EventArgs e)
@ -469,6 +505,7 @@ namespace Mesen.GUI.Debugger.Controls
for(int i = SelectionStartAddress, end = SelectionEndAddress; i <= end; i++) {
InteropEmu.DebugSetFreezeState((UInt16)i, false);
}
this.ctrlHexBox.Invalidate();
}
private void mnuMarkAsCode_Click(object sender, EventArgs e)
@ -486,12 +523,6 @@ namespace Mesen.GUI.Debugger.Controls
this.MarkSelectionAs(SelectionStartAddress, SelectionEndAddress, CdlPrgFlags.None);
}
protected override bool ProcessKeyMessage(ref Message m)
{
this.UpdateActionAvailability();
return base.ProcessKeyMessage(ref m);
}
private void UpdateActionAvailability()
{
UInt32 startAddress = (UInt32)SelectionStartAddress;

View file

@ -56,14 +56,12 @@
this.toolStripMenuItem2,
this.mnuFindOccurrences});
this.contextMenu.Name = "contextMenu";
this.contextMenu.Size = new System.Drawing.Size(167, 170);
this.contextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.mnuActions_Opening);
this.contextMenu.Size = new System.Drawing.Size(167, 148);
//
// mnuAdd
//
this.mnuAdd.Image = global::Mesen.GUI.Properties.Resources.Add;
this.mnuAdd.Name = "mnuAdd";
this.mnuAdd.ShortcutKeys = System.Windows.Forms.Keys.Insert;
this.mnuAdd.Size = new System.Drawing.Size(166, 22);
this.mnuAdd.Text = "Add";
this.mnuAdd.Click += new System.EventHandler(this.mnuAdd_Click);
@ -72,7 +70,6 @@
//
this.mnuEdit.Image = global::Mesen.GUI.Properties.Resources.EditLabel;
this.mnuEdit.Name = "mnuEdit";
this.mnuEdit.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.mnuEdit.Size = new System.Drawing.Size(166, 22);
this.mnuEdit.Text = "Edit";
this.mnuEdit.Click += new System.EventHandler(this.mnuEdit_Click);
@ -81,7 +78,6 @@
//
this.mnuDelete.Image = global::Mesen.GUI.Properties.Resources.Close;
this.mnuDelete.Name = "mnuDelete";
this.mnuDelete.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.mnuDelete.Size = new System.Drawing.Size(166, 22);
this.mnuDelete.Text = "Delete";
this.mnuDelete.Click += new System.EventHandler(this.mnuDelete_Click);
@ -139,6 +135,7 @@
this.lstLabels.UseCompatibleStateImageBehavior = false;
this.lstLabels.View = System.Windows.Forms.View.Details;
this.lstLabels.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstLabels_ColumnClick);
this.lstLabels.SelectedIndexChanged += new System.EventHandler(this.lstLabels_SelectedIndexChanged);
this.lstLabels.DoubleClick += new System.EventHandler(this.lstLabels_DoubleClick);
//
// colFunctionLabel

View file

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Collections;
using Mesen.GUI.Controls;
using Mesen.GUI.Config;
namespace Mesen.GUI.Debugger.Controls
{
@ -42,6 +43,22 @@ namespace Mesen.GUI.Debugger.Controls
{
InitializeComponent();
lstLabels.ListViewItemSorter = new LabelComparer(0, false);
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
if(!designMode) {
this.InitShortcuts();
}
}
private void InitShortcuts()
{
mnuAdd.InitShortcut(this, nameof(DebuggerShortcutsConfig.LabelList_Add));
mnuEdit.InitShortcut(this, nameof(DebuggerShortcutsConfig.LabelList_Edit));
mnuDelete.InitShortcut(this, nameof(DebuggerShortcutsConfig.LabelList_Delete));
mnuAddToWatch.InitShortcut(this, nameof(DebuggerShortcutsConfig.LabelList_AddToWatch));
mnuAddBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.LabelList_AddBreakpoint));
mnuFindOccurrences.InitShortcut(this, nameof(DebuggerShortcutsConfig.LabelList_FindOccurrences));
}
public static void EditLabel(UInt32 address, AddressType type)
@ -143,8 +160,8 @@ namespace Mesen.GUI.Debugger.Controls
}
}
}
private void mnuActions_Opening(object sender, CancelEventArgs e)
private void lstLabels_SelectedIndexChanged(object sender, EventArgs e)
{
mnuDelete.Enabled = lstLabels.SelectedItems.Count > 0;
mnuEdit.Enabled = lstLabels.SelectedItems.Count == 1;

View file

@ -155,7 +155,6 @@
//
this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopyToClipboard.Name = "mnuCopyToClipboard";
this.mnuCopyToClipboard.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.mnuCopyToClipboard.Size = new System.Drawing.Size(260, 22);
this.mnuCopyToClipboard.Text = "Copy image to clipboard";
this.mnuCopyToClipboard.Click += new System.EventHandler(this.mnuCopyToClipboard_Click);

View file

@ -43,6 +43,8 @@ namespace Mesen.GUI.Debugger.Controls
chkShowAttributeGrid.Checked = ConfigManager.Config.DebugInfo.ShowAttributeGrid;
chkHighlightChrTile.Checked = ConfigManager.Config.DebugInfo.HighlightChrTile;
chkUseGrayscalePalette.Checked = ConfigManager.Config.DebugInfo.NtViewerUseGrayscalePalette;
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
}
}

View file

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Mesen.GUI.Controls;
using Mesen.GUI.Debugger.Controls;
using Mesen.GUI.Config;
namespace Mesen.GUI.Debugger
{
@ -224,6 +225,12 @@ namespace Mesen.GUI.Debugger
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(!this.cboSearch.Focused) {
if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.SelectAll) {
this.ctrlTextbox.SelectionStart = 0;
this.ctrlTextbox.SelectionLength = this.ctrlTextbox.LineCount;
return true;
}
switch(keyData) {
case Keys.Right | Keys.Shift:
case Keys.Down | Keys.Shift:
@ -255,11 +262,6 @@ namespace Mesen.GUI.Debugger
this.ctrlTextbox.MoveSelectionDown(this.ctrlTextbox.LineCount);
break;
case Keys.A | Keys.Control:
this.ctrlTextbox.SelectionStart = 0;
this.ctrlTextbox.SelectionLength = this.ctrlTextbox.LineCount;
break;
case Keys.Home:
this.ctrlTextbox.SelectionStart = 0;
this.ctrlTextbox.SelectionLength = 0;
@ -272,6 +274,20 @@ namespace Mesen.GUI.Debugger
}
}
if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.IncreaseFontSize) {
this.TextZoom += 10;
return true;
} else if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.DecreaseFontSize) {
this.TextZoom -= 10;
return true;
} else if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.ResetFontSize) {
this.TextZoom = 100;
return true;
} else if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.Find) {
this.OpenSearchBox(true);
return true;
}
switch(keyData) {
case Keys.PageUp | Keys.Shift:
this.ctrlTextbox.MoveSelectionUp(20);
@ -291,25 +307,12 @@ namespace Mesen.GUI.Debugger
this.ctrlTextbox.SelectionLength = 0;
return true;
case Keys.Control | Keys.F:
this.OpenSearchBox(true);
return true;
case Keys.Escape:
this.CloseSearchBox();
return true;
case Keys.Control | Keys.Oemplus:
this.TextZoom += 10;
return true;
case Keys.Control | Keys.OemMinus:
this.TextZoom -= 10;
return true;
case Keys.Control | Keys.D0:
this.TextZoom = 100;
return true;
if(this.cboSearch.Focused) {
this.CloseSearchBox();
return true;
}
break;
}
return base.ProcessCmdKey(ref msg, keyData);

View file

@ -217,7 +217,6 @@
//
this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopyToClipboard.Name = "mnuCopyToClipboard";
this.mnuCopyToClipboard.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.mnuCopyToClipboard.Size = new System.Drawing.Size(254, 22);
this.mnuCopyToClipboard.Text = "Copy image to clipboard";
this.mnuCopyToClipboard.Click += new System.EventHandler(this.mnuCopyToClipboard_Click);

View file

@ -10,6 +10,7 @@ using System.Windows.Forms;
using System.Runtime.InteropServices;
using Mesen.GUI.Controls;
using System.Drawing.Imaging;
using Mesen.GUI.Config;
namespace Mesen.GUI.Debugger.Controls
{
@ -35,6 +36,11 @@ namespace Mesen.GUI.Debugger.Controls
picPreview.Image = new Bitmap(256, 240, PixelFormat.Format32bppArgb);
picSprites.Image = new Bitmap(256, 512, PixelFormat.Format32bppArgb);
bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);
if(!designMode) {
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
}
}
public void GetData()

View file

@ -93,8 +93,6 @@
//
this.mnuRemoveWatch.Image = global::Mesen.GUI.Properties.Resources.Close;
this.mnuRemoveWatch.Name = "mnuRemoveWatch";
this.mnuRemoveWatch.ShortcutKeyDisplayString = "";
this.mnuRemoveWatch.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.mnuRemoveWatch.Size = new System.Drawing.Size(183, 22);
this.mnuRemoveWatch.Text = "Remove";
this.mnuRemoveWatch.Click += new System.EventHandler(this.mnuRemoveWatch_Click);

View file

@ -26,6 +26,8 @@ namespace Mesen.GUI.Debugger
if(!designMode) {
this.mnuHexDisplay.Checked = ConfigManager.Config.DebugInfo.HexDisplay;
WatchManager.WatchChanged += WatchManager_WatchChanged;
mnuRemoveWatch.InitShortcut(this, nameof(DebuggerShortcutsConfig.WatchList_Delete));
}
}

View file

@ -362,42 +362,38 @@
this.toolStripMenuItem5,
this.mnuSelectAll});
this.contextMenu.Name = "contextMenu";
this.contextMenu.Size = new System.Drawing.Size(165, 98);
this.contextMenu.Size = new System.Drawing.Size(123, 98);
//
// mnuCopy
//
this.mnuCopy.Name = "mnuCopy";
this.mnuCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.mnuCopy.Size = new System.Drawing.Size(164, 22);
this.mnuCopy.Size = new System.Drawing.Size(122, 22);
this.mnuCopy.Text = "Copy";
this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click);
//
// mnuCut
//
this.mnuCut.Name = "mnuCut";
this.mnuCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this.mnuCut.Size = new System.Drawing.Size(164, 22);
this.mnuCut.Size = new System.Drawing.Size(122, 22);
this.mnuCut.Text = "Cut";
this.mnuCut.Click += new System.EventHandler(this.mnuCut_Click);
//
// mnuPaste
//
this.mnuPaste.Name = "mnuPaste";
this.mnuPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.mnuPaste.Size = new System.Drawing.Size(164, 22);
this.mnuPaste.Size = new System.Drawing.Size(122, 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(161, 6);
this.toolStripMenuItem5.Size = new System.Drawing.Size(119, 6);
//
// mnuSelectAll
//
this.mnuSelectAll.Name = "mnuSelectAll";
this.mnuSelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.mnuSelectAll.Size = new System.Drawing.Size(164, 22);
this.mnuSelectAll.Size = new System.Drawing.Size(122, 22);
this.mnuSelectAll.Text = "Select All";
this.mnuSelectAll.Click += new System.EventHandler(this.mnuSelectAll_Click);
//
@ -485,39 +481,36 @@
// mnuIncreaseFontSize
//
this.mnuIncreaseFontSize.Name = "mnuIncreaseFontSize";
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "Ctrl++";
this.mnuIncreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Oemplus)));
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuIncreaseFontSize.Text = "Increase Size";
this.mnuIncreaseFontSize.Click += new System.EventHandler(this.mnuIncreaseFontSize_Click);
//
// mnuDecreaseFontSize
//
this.mnuDecreaseFontSize.Name = "mnuDecreaseFontSize";
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "Ctrl+-";
this.mnuDecreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.OemMinus)));
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuDecreaseFontSize.Text = "Decrease Size";
this.mnuDecreaseFontSize.Click += new System.EventHandler(this.mnuDecreaseFontSize_Click);
//
// mnuResetFontSize
//
this.mnuResetFontSize.Name = "mnuResetFontSize";
this.mnuResetFontSize.ShortcutKeyDisplayString = "Ctrl+0";
this.mnuResetFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D0)));
this.mnuResetFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuResetFontSize.ShortcutKeyDisplayString = "";
this.mnuResetFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuResetFontSize.Text = "Reset to Default";
this.mnuResetFontSize.Click += new System.EventHandler(this.mnuResetFontSize_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(194, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(154, 6);
//
// mnuSelectFont
//
this.mnuSelectFont.Name = "mnuSelectFont";
this.mnuSelectFont.Size = new System.Drawing.Size(197, 22);
this.mnuSelectFont.Size = new System.Drawing.Size(157, 22);
this.mnuSelectFont.Text = "Select Font...";
this.mnuSelectFont.Click += new System.EventHandler(this.mnuSelectFont_Click);
//

View file

@ -57,6 +57,20 @@ namespace Mesen.GUI.Debugger
ctrlHexBox.ByteProvider = new StaticByteProvider(new byte[0]);
txtStartAddress.Text = _startAddress.ToString("X4");
this.InitShortcuts();
}
private void InitShortcuts()
{
mnuIncreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.IncreaseFontSize));
mnuDecreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.DecreaseFontSize));
mnuResetFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.ResetFontSize));
mnuPaste.InitShortcut(this, nameof(DebuggerShortcutsConfig.Paste));
mnuCopy.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
mnuCut.InitShortcut(this, nameof(DebuggerShortcutsConfig.Cut));
mnuSelectAll.InitShortcut(this, nameof(DebuggerShortcutsConfig.SelectAll));
}
protected override void OnLoad(EventArgs e)

View file

@ -0,0 +1,188 @@
namespace Mesen.GUI.Debugger
{
partial class frmDbgPreferences
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ctrlDbgShortcutsShared = new Mesen.GUI.Debugger.ctrlDbgShortcuts();
this.tabMain = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.ctrlDbgShortcutsDebugger = new Mesen.GUI.Debugger.ctrlDbgShortcuts();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.ctrlDbgShortcutsMemoryViewer = new Mesen.GUI.Debugger.ctrlDbgShortcuts();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.ctrlDbgShortcutsScriptWindow = new Mesen.GUI.Debugger.ctrlDbgShortcuts();
this.btnReset = new System.Windows.Forms.Button();
this.baseConfigPanel.SuspendLayout();
this.tabMain.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.SuspendLayout();
//
// baseConfigPanel
//
this.baseConfigPanel.Controls.Add(this.btnReset);
this.baseConfigPanel.Location = new System.Drawing.Point(0, 460);
this.baseConfigPanel.Size = new System.Drawing.Size(605, 29);
this.baseConfigPanel.Controls.SetChildIndex(this.btnReset, 0);
//
// ctrlDbgShortcutsShared
//
this.ctrlDbgShortcutsShared.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlDbgShortcutsShared.Location = new System.Drawing.Point(3, 3);
this.ctrlDbgShortcutsShared.Name = "ctrlDbgShortcutsShared";
this.ctrlDbgShortcutsShared.Size = new System.Drawing.Size(591, 428);
this.ctrlDbgShortcutsShared.TabIndex = 2;
//
// tabMain
//
this.tabMain.Controls.Add(this.tabPage1);
this.tabMain.Controls.Add(this.tabPage2);
this.tabMain.Controls.Add(this.tabPage3);
this.tabMain.Controls.Add(this.tabPage4);
this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabMain.Location = new System.Drawing.Point(0, 0);
this.tabMain.Name = "tabMain";
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(605, 460);
this.tabMain.TabIndex = 3;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.ctrlDbgShortcutsShared);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(597, 434);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Shared";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.ctrlDbgShortcutsDebugger);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(597, 434);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Debugger";
this.tabPage2.UseVisualStyleBackColor = true;
//
// ctrlDbgShortcutsDebugger
//
this.ctrlDbgShortcutsDebugger.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlDbgShortcutsDebugger.Location = new System.Drawing.Point(3, 3);
this.ctrlDbgShortcutsDebugger.Name = "ctrlDbgShortcutsDebugger";
this.ctrlDbgShortcutsDebugger.Size = new System.Drawing.Size(591, 428);
this.ctrlDbgShortcutsDebugger.TabIndex = 3;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.ctrlDbgShortcutsMemoryViewer);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(597, 434);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Memory Viewer";
this.tabPage3.UseVisualStyleBackColor = true;
//
// ctrlDbgShortcutsMemoryViewer
//
this.ctrlDbgShortcutsMemoryViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlDbgShortcutsMemoryViewer.Location = new System.Drawing.Point(3, 3);
this.ctrlDbgShortcutsMemoryViewer.Name = "ctrlDbgShortcutsMemoryViewer";
this.ctrlDbgShortcutsMemoryViewer.Size = new System.Drawing.Size(591, 428);
this.ctrlDbgShortcutsMemoryViewer.TabIndex = 3;
//
// tabPage4
//
this.tabPage4.Controls.Add(this.ctrlDbgShortcutsScriptWindow);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(597, 434);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "Script Window";
this.tabPage4.UseVisualStyleBackColor = true;
//
// ctrlDbgShortcutsScriptWindow
//
this.ctrlDbgShortcutsScriptWindow.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlDbgShortcutsScriptWindow.Location = new System.Drawing.Point(3, 3);
this.ctrlDbgShortcutsScriptWindow.Name = "ctrlDbgShortcutsScriptWindow";
this.ctrlDbgShortcutsScriptWindow.Size = new System.Drawing.Size(591, 428);
this.ctrlDbgShortcutsScriptWindow.TabIndex = 3;
//
// btnReset
//
this.btnReset.Location = new System.Drawing.Point(4, 3);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(111, 23);
this.btnReset.TabIndex = 3;
this.btnReset.Text = "Reset to Defaults";
this.btnReset.UseVisualStyleBackColor = true;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// frmDbgPreferences
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(605, 489);
this.Controls.Add(this.tabMain);
this.Name = "frmDbgPreferences";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Configure Shortcut Keys";
this.Controls.SetChildIndex(this.baseConfigPanel, 0);
this.Controls.SetChildIndex(this.tabMain, 0);
this.baseConfigPanel.ResumeLayout(false);
this.tabMain.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private ctrlDbgShortcuts ctrlDbgShortcutsShared;
private System.Windows.Forms.TabControl tabMain;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private ctrlDbgShortcuts ctrlDbgShortcutsDebugger;
private System.Windows.Forms.TabPage tabPage3;
private ctrlDbgShortcuts ctrlDbgShortcutsMemoryViewer;
private System.Windows.Forms.TabPage tabPage4;
private ctrlDbgShortcuts ctrlDbgShortcutsScriptWindow;
private System.Windows.Forms.Button btnReset;
}
}

View file

@ -0,0 +1,137 @@
using Mesen.GUI.Config;
using Mesen.GUI.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesen.GUI.Debugger
{
public partial class frmDbgPreferences : BaseConfigForm
{
public frmDbgPreferences()
{
InitializeComponent();
ctrlDbgShortcutsShared.Shortcuts = new FieldInfo[24] {
GetMember(nameof(DebuggerShortcutsConfig.IncreaseFontSize)),
GetMember(nameof(DebuggerShortcutsConfig.DecreaseFontSize)),
GetMember(nameof(DebuggerShortcutsConfig.ResetFontSize)),
GetMember(nameof(DebuggerShortcutsConfig.GoTo)),
GetMember(nameof(DebuggerShortcutsConfig.Find)),
GetMember(nameof(DebuggerShortcutsConfig.FindNext)),
GetMember(nameof(DebuggerShortcutsConfig.FindPrev)),
GetMember(nameof(DebuggerShortcutsConfig.Undo)),
GetMember(nameof(DebuggerShortcutsConfig.Cut)),
GetMember(nameof(DebuggerShortcutsConfig.Copy)),
GetMember(nameof(DebuggerShortcutsConfig.Paste)),
GetMember(nameof(DebuggerShortcutsConfig.SelectAll)),
GetMember(nameof(DebuggerShortcutsConfig.Refresh)),
GetMember(nameof(DebuggerShortcutsConfig.MarkAsCode)),
GetMember(nameof(DebuggerShortcutsConfig.MarkAsData)),
GetMember(nameof(DebuggerShortcutsConfig.MarkAsUnidentified)),
GetMember(nameof(DebuggerShortcutsConfig.OpenApuViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenAssembler)),
GetMember(nameof(DebuggerShortcutsConfig.OpenDebugger)),
GetMember(nameof(DebuggerShortcutsConfig.OpenMemoryTools)),
GetMember(nameof(DebuggerShortcutsConfig.OpenEventViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenPpuViewer)),
GetMember(nameof(DebuggerShortcutsConfig.OpenScriptWindow)),
GetMember(nameof(DebuggerShortcutsConfig.OpenTraceLogger))
};
ctrlDbgShortcutsMemoryViewer.Shortcuts = new FieldInfo[7] {
GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_Freeze)),
GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_Unfreeze)),
GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_AddToWatch)),
GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_EditBreakpoint)),
GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_EditLabel)),
GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_Import)),
GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_Export))
};
ctrlDbgShortcutsScriptWindow.Shortcuts = new FieldInfo[4] {
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_OpenScript)),
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_SaveScript)),
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_RunScript)),
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_StopScript))
};
ctrlDbgShortcutsDebugger.Shortcuts = new FieldInfo[41] {
GetMember(nameof(DebuggerShortcutsConfig.Continue)),
GetMember(nameof(DebuggerShortcutsConfig.Break)),
GetMember(nameof(DebuggerShortcutsConfig.StepInto)),
GetMember(nameof(DebuggerShortcutsConfig.StepOver)),
GetMember(nameof(DebuggerShortcutsConfig.StepOut)),
GetMember(nameof(DebuggerShortcutsConfig.StepBack)),
GetMember(nameof(DebuggerShortcutsConfig.RunPpuCycle)),
GetMember(nameof(DebuggerShortcutsConfig.RunPpuScanline)),
GetMember(nameof(DebuggerShortcutsConfig.RunPpuFrame)),
GetMember(nameof(DebuggerShortcutsConfig.BreakIn)),
GetMember(nameof(DebuggerShortcutsConfig.FindOccurrences)),
GetMember(nameof(DebuggerShortcutsConfig.GoToProgramCounter)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_SetNextStatement)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_EditSubroutine)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_EditSelectedCode)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_EditInMemoryViewer)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_EditLabel)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_NavigateBack)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_NavigateForward)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint)),
GetMember(nameof(DebuggerShortcutsConfig.CodeWindow_DisableEnableBreakpoint)),
GetMember(nameof(DebuggerShortcutsConfig.FunctionList_EditLabel)),
GetMember(nameof(DebuggerShortcutsConfig.FunctionList_AddBreakpoint)),
GetMember(nameof(DebuggerShortcutsConfig.FunctionList_FindOccurrences)),
GetMember(nameof(DebuggerShortcutsConfig.LabelList_Add)),
GetMember(nameof(DebuggerShortcutsConfig.LabelList_Edit)),
GetMember(nameof(DebuggerShortcutsConfig.LabelList_Delete)),
GetMember(nameof(DebuggerShortcutsConfig.LabelList_AddBreakpoint)),
GetMember(nameof(DebuggerShortcutsConfig.LabelList_AddToWatch)),
GetMember(nameof(DebuggerShortcutsConfig.LabelList_FindOccurrences)),
GetMember(nameof(DebuggerShortcutsConfig.BreakpointList_Add)),
GetMember(nameof(DebuggerShortcutsConfig.BreakpointList_Edit)),
GetMember(nameof(DebuggerShortcutsConfig.BreakpointList_GoToLocation)),
GetMember(nameof(DebuggerShortcutsConfig.BreakpointList_Delete)),
GetMember(nameof(DebuggerShortcutsConfig.WatchList_Delete)),
GetMember(nameof(DebuggerShortcutsConfig.SaveRom)),
GetMember(nameof(DebuggerShortcutsConfig.SaveRomAs)),
GetMember(nameof(DebuggerShortcutsConfig.SaveEditAsIps)),
GetMember(nameof(DebuggerShortcutsConfig.RevertPrgChrChanges)),
GetMember(nameof(DebuggerShortcutsConfig.ToggleVerifiedData)),
GetMember(nameof(DebuggerShortcutsConfig.ToggleUnidentifiedCodeData))
};
}
private FieldInfo GetMember(string name)
{
return typeof(DebuggerShortcutsConfig).GetField(name);
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
base.OnFormClosed(e);
if(DialogResult == DialogResult.OK) {
DebuggerShortcutsConfig.UpdateMenus();
}
}
private void btnReset_Click(object sender, EventArgs e)
{
DebuggerShortcutsConfig defaults = new DebuggerShortcutsConfig();
foreach(FieldInfo field in typeof(DebuggerShortcutsConfig).GetFields()) {
field.SetValue(ConfigManager.Config.DebugInfo.Shortcuts, field.GetValue(defaults));
}
ctrlDbgShortcutsDebugger.InitializeGrid();
ctrlDbgShortcutsMemoryViewer.InitializeGrid();
ctrlDbgShortcutsScriptWindow.InitializeGrid();
ctrlDbgShortcutsShared.InitializeGrid();
}
}
}

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -0,0 +1,114 @@
namespace Mesen.GUI.Debugger
{
partial class frmDbgShortcutGetKey
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.lblSetKeyMessage = new System.Windows.Forms.Label();
this.lblCurrentKeys = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.AutoSize = true;
this.groupBox1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.groupBox1.Controls.Add(this.tableLayoutPanel1);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(3, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(391, 105);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.AutoSize = true;
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.lblSetKeyMessage, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.lblCurrentKeys, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(385, 86);
this.tableLayoutPanel1.TabIndex = 2;
//
// lblSetKeyMessage
//
this.lblSetKeyMessage.AutoSize = true;
this.lblSetKeyMessage.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblSetKeyMessage.Location = new System.Drawing.Point(3, 0);
this.lblSetKeyMessage.Name = "lblSetKeyMessage";
this.lblSetKeyMessage.Size = new System.Drawing.Size(379, 43);
this.lblSetKeyMessage.TabIndex = 0;
this.lblSetKeyMessage.Text = "Press any key on your keyboard to set a new binding.";
this.lblSetKeyMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblCurrentKeys
//
this.lblCurrentKeys.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblCurrentKeys.Location = new System.Drawing.Point(3, 43);
this.lblCurrentKeys.Name = "lblCurrentKeys";
this.lblCurrentKeys.Size = new System.Drawing.Size(379, 43);
this.lblCurrentKeys.TabIndex = 1;
this.lblCurrentKeys.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// frmDbgShortcutGetKey
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(397, 108);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "frmDbgShortcutGetKey";
this.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Set key binding...";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label lblSetKeyMessage;
private System.Windows.Forms.Label lblCurrentKeys;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}

View file

@ -0,0 +1,58 @@
using Mesen.GUI.Config;
using Mesen.GUI.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesen.GUI.Debugger
{
public partial class frmDbgShortcutGetKey : BaseForm
{
private Keys[] _ignoredKeys = new Keys[9] {
Keys.LMenu, Keys.RMenu, Keys.Menu, Keys.LShiftKey, Keys.RShiftKey, Keys.ShiftKey, Keys.LControlKey, Keys.RControlKey, Keys.ControlKey
};
private Keys _shortcutKeys = Keys.None;
public Keys ShortcutKeys { get => _shortcutKeys; set => _shortcutKeys = value; }
public frmDbgShortcutGetKey()
{
InitializeComponent();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
foreach(Keys ignoredKey in _ignoredKeys) {
if((keyData & (Keys)0xFF) == ignoredKey) {
keyData ^= ignoredKey;
}
}
_shortcutKeys = keyData;
lblCurrentKeys.Text = DebuggerShortcutsConfig.GetShortcutDisplay(keyData);
return true;
}
protected override void OnKeyDown(KeyEventArgs e)
{
}
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
this.Close();
}
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
}
}
}

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -147,12 +147,13 @@ namespace Mesen.GUI.Debugger
this.mnuConfigureColors = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSplitView = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
this.mnuHidePauseIcon = new System.Windows.Forms.ToolStripMenuItem();
this.mnuPpuPartialDraw = new System.Windows.Forms.ToolStripMenuItem();
this.mnuPpuShowPreviousFrame = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem19 = new System.Windows.Forms.ToolStripSeparator();
this.mnuRefreshWatchWhileRunning = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
this.mnuPreferences = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuApuViewer = new System.Windows.Forms.ToolStripMenuItem();
this.mnuAssembler = new System.Windows.Forms.ToolStripMenuItem();
@ -336,7 +337,7 @@ namespace Mesen.GUI.Debugger
this.tlpFunctionLabelLists.RowCount = 2;
this.tlpFunctionLabelLists.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpFunctionLabelLists.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tlpFunctionLabelLists.Size = new System.Drawing.Size(415, 400);
this.tlpFunctionLabelLists.Size = new System.Drawing.Size(418, 400);
this.tlpFunctionLabelLists.TabIndex = 5;
//
// grpLabels
@ -345,7 +346,7 @@ namespace Mesen.GUI.Debugger
this.grpLabels.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpLabels.Location = new System.Drawing.Point(3, 203);
this.grpLabels.Name = "grpLabels";
this.grpLabels.Size = new System.Drawing.Size(409, 194);
this.grpLabels.Size = new System.Drawing.Size(412, 194);
this.grpLabels.TabIndex = 6;
this.grpLabels.TabStop = false;
this.grpLabels.Text = "Labels";
@ -355,7 +356,7 @@ namespace Mesen.GUI.Debugger
this.ctrlLabelList.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlLabelList.Location = new System.Drawing.Point(3, 16);
this.ctrlLabelList.Name = "ctrlLabelList";
this.ctrlLabelList.Size = new System.Drawing.Size(403, 175);
this.ctrlLabelList.Size = new System.Drawing.Size(406, 175);
this.ctrlLabelList.TabIndex = 0;
this.ctrlLabelList.OnFindOccurrence += new System.EventHandler(this.ctrlLabelList_OnFindOccurrence);
this.ctrlLabelList.OnLabelSelected += new System.EventHandler(this.ctrlLabelList_OnLabelSelected);
@ -366,7 +367,7 @@ namespace Mesen.GUI.Debugger
this.grpFunctions.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpFunctions.Location = new System.Drawing.Point(3, 3);
this.grpFunctions.Name = "grpFunctions";
this.grpFunctions.Size = new System.Drawing.Size(409, 194);
this.grpFunctions.Size = new System.Drawing.Size(412, 194);
this.grpFunctions.TabIndex = 5;
this.grpFunctions.TabStop = false;
this.grpFunctions.Text = "Functions";
@ -376,7 +377,7 @@ namespace Mesen.GUI.Debugger
this.ctrlFunctionList.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlFunctionList.Location = new System.Drawing.Point(3, 16);
this.ctrlFunctionList.Name = "ctrlFunctionList";
this.ctrlFunctionList.Size = new System.Drawing.Size(403, 175);
this.ctrlFunctionList.Size = new System.Drawing.Size(406, 175);
this.ctrlFunctionList.TabIndex = 0;
this.ctrlFunctionList.OnFindOccurrence += new System.EventHandler(this.ctrlFunctionList_OnFindOccurrence);
this.ctrlFunctionList.OnFunctionSelected += new System.EventHandler(this.ctrlFunctionList_OnFunctionSelected);
@ -504,7 +505,6 @@ namespace Mesen.GUI.Debugger
//
this.mnuSaveRom.Image = global::Mesen.GUI.Properties.Resources.Floppy;
this.mnuSaveRom.Name = "mnuSaveRom";
this.mnuSaveRom.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.mnuSaveRom.Size = new System.Drawing.Size(208, 22);
this.mnuSaveRom.Text = "Save ROM";
this.mnuSaveRom.Click += new System.EventHandler(this.mnuSaveRom_Click);
@ -665,8 +665,7 @@ namespace Mesen.GUI.Debugger
this.mnuContinue.Enabled = false;
this.mnuContinue.Image = global::Mesen.GUI.Properties.Resources.Play;
this.mnuContinue.Name = "mnuContinue";
this.mnuContinue.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.mnuContinue.Size = new System.Drawing.Size(258, 22);
this.mnuContinue.Size = new System.Drawing.Size(212, 22);
this.mnuContinue.Text = "Continue";
this.mnuContinue.Click += new System.EventHandler(this.mnuContinue_Click);
//
@ -675,10 +674,8 @@ namespace Mesen.GUI.Debugger
this.mnuBreak.Enabled = false;
this.mnuBreak.Image = global::Mesen.GUI.Properties.Resources.Pause;
this.mnuBreak.Name = "mnuBreak";
this.mnuBreak.ShortcutKeyDisplayString = "Ctrl+Alt+Break";
this.mnuBreak.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt)
| System.Windows.Forms.Keys.Cancel)));
this.mnuBreak.Size = new System.Drawing.Size(258, 22);
this.mnuBreak.ShortcutKeyDisplayString = "";
this.mnuBreak.Size = new System.Drawing.Size(212, 22);
this.mnuBreak.Text = "Break";
this.mnuBreak.Click += new System.EventHandler(this.mnuBreak_Click);
//
@ -686,8 +683,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuStepInto.Image = global::Mesen.GUI.Properties.Resources.StepInto;
this.mnuStepInto.Name = "mnuStepInto";
this.mnuStepInto.ShortcutKeys = System.Windows.Forms.Keys.F11;
this.mnuStepInto.Size = new System.Drawing.Size(258, 22);
this.mnuStepInto.Size = new System.Drawing.Size(212, 22);
this.mnuStepInto.Text = "Step Into";
this.mnuStepInto.Click += new System.EventHandler(this.mnuStepInto_Click);
//
@ -695,8 +691,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuStepOver.Image = global::Mesen.GUI.Properties.Resources.StepOver;
this.mnuStepOver.Name = "mnuStepOver";
this.mnuStepOver.ShortcutKeys = System.Windows.Forms.Keys.F10;
this.mnuStepOver.Size = new System.Drawing.Size(258, 22);
this.mnuStepOver.Size = new System.Drawing.Size(212, 22);
this.mnuStepOver.Text = "Step Over";
this.mnuStepOver.Click += new System.EventHandler(this.mnuStepOver_Click);
//
@ -704,8 +699,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuStepOut.Image = global::Mesen.GUI.Properties.Resources.StepOut;
this.mnuStepOut.Name = "mnuStepOut";
this.mnuStepOut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F11)));
this.mnuStepOut.Size = new System.Drawing.Size(258, 22);
this.mnuStepOut.Size = new System.Drawing.Size(212, 22);
this.mnuStepOut.Text = "Step Out";
this.mnuStepOut.Click += new System.EventHandler(this.mnuStepOut_Click);
//
@ -713,22 +707,20 @@ namespace Mesen.GUI.Debugger
//
this.mnuStepBack.Image = global::Mesen.GUI.Properties.Resources.StepBack;
this.mnuStepBack.Name = "mnuStepBack";
this.mnuStepBack.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F10)));
this.mnuStepBack.Size = new System.Drawing.Size(258, 22);
this.mnuStepBack.Size = new System.Drawing.Size(212, 22);
this.mnuStepBack.Text = "Step Back";
this.mnuStepBack.Click += new System.EventHandler(this.mnuStepBack_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(255, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(209, 6);
//
// mnuToggleBreakpoint
//
this.mnuToggleBreakpoint.Image = global::Mesen.GUI.Properties.Resources.Breakpoint;
this.mnuToggleBreakpoint.Name = "mnuToggleBreakpoint";
this.mnuToggleBreakpoint.ShortcutKeys = System.Windows.Forms.Keys.F9;
this.mnuToggleBreakpoint.Size = new System.Drawing.Size(258, 22);
this.mnuToggleBreakpoint.Size = new System.Drawing.Size(212, 22);
this.mnuToggleBreakpoint.Text = "Toggle Breakpoint";
this.mnuToggleBreakpoint.Click += new System.EventHandler(this.mnuToggleBreakpoint_Click);
//
@ -736,22 +728,20 @@ namespace Mesen.GUI.Debugger
//
this.mnuDisableEnableBreakpoint.Image = global::Mesen.GUI.Properties.Resources.BreakpointDisabled;
this.mnuDisableEnableBreakpoint.Name = "mnuDisableEnableBreakpoint";
this.mnuDisableEnableBreakpoint.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F9)));
this.mnuDisableEnableBreakpoint.Size = new System.Drawing.Size(258, 22);
this.mnuDisableEnableBreakpoint.Size = new System.Drawing.Size(212, 22);
this.mnuDisableEnableBreakpoint.Text = "Disable/Enable Breakpoint";
this.mnuDisableEnableBreakpoint.Click += new System.EventHandler(this.mnuDisableEnableBreakpoint_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(255, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(209, 6);
//
// mnuRunPpuCycle
//
this.mnuRunPpuCycle.Image = global::Mesen.GUI.Properties.Resources.RunPpuCycle;
this.mnuRunPpuCycle.Name = "mnuRunPpuCycle";
this.mnuRunPpuCycle.ShortcutKeys = System.Windows.Forms.Keys.F6;
this.mnuRunPpuCycle.Size = new System.Drawing.Size(258, 22);
this.mnuRunPpuCycle.Size = new System.Drawing.Size(212, 22);
this.mnuRunPpuCycle.Text = "Run one PPU cycle";
this.mnuRunPpuCycle.Click += new System.EventHandler(this.mnuRunPpuCycle_Click);
//
@ -759,8 +749,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuRunScanline.Image = global::Mesen.GUI.Properties.Resources.RunPpuScanline;
this.mnuRunScanline.Name = "mnuRunScanline";
this.mnuRunScanline.ShortcutKeys = System.Windows.Forms.Keys.F7;
this.mnuRunScanline.Size = new System.Drawing.Size(258, 22);
this.mnuRunScanline.Size = new System.Drawing.Size(212, 22);
this.mnuRunScanline.Text = "Run one scanline";
this.mnuRunScanline.Click += new System.EventHandler(this.mnuRunScanline_Click);
//
@ -768,21 +757,19 @@ namespace Mesen.GUI.Debugger
//
this.mnuRunOneFrame.Image = global::Mesen.GUI.Properties.Resources.RunPpuFrame;
this.mnuRunOneFrame.Name = "mnuRunOneFrame";
this.mnuRunOneFrame.ShortcutKeys = System.Windows.Forms.Keys.F8;
this.mnuRunOneFrame.Size = new System.Drawing.Size(258, 22);
this.mnuRunOneFrame.Size = new System.Drawing.Size(212, 22);
this.mnuRunOneFrame.Text = "Run one frame";
this.mnuRunOneFrame.Click += new System.EventHandler(this.mnuRunOneFrame_Click);
//
// toolStripMenuItem8
//
this.toolStripMenuItem8.Name = "toolStripMenuItem8";
this.toolStripMenuItem8.Size = new System.Drawing.Size(255, 6);
this.toolStripMenuItem8.Size = new System.Drawing.Size(209, 6);
//
// mnuBreakIn
//
this.mnuBreakIn.Name = "mnuBreakIn";
this.mnuBreakIn.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.B)));
this.mnuBreakIn.Size = new System.Drawing.Size(258, 22);
this.mnuBreakIn.Size = new System.Drawing.Size(212, 22);
this.mnuBreakIn.Text = "Break in...";
this.mnuBreakIn.Click += new System.EventHandler(this.mnuBreakIn_Click);
//
@ -803,8 +790,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuFind.Image = global::Mesen.GUI.Properties.Resources.Find;
this.mnuFind.Name = "mnuFind";
this.mnuFind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.mnuFind.Size = new System.Drawing.Size(255, 22);
this.mnuFind.Size = new System.Drawing.Size(183, 22);
this.mnuFind.Text = "Find...";
this.mnuFind.Click += new System.EventHandler(this.mnuFind_Click);
//
@ -812,8 +798,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuFindNext.Image = global::Mesen.GUI.Properties.Resources.NextArrow;
this.mnuFindNext.Name = "mnuFindNext";
this.mnuFindNext.ShortcutKeys = System.Windows.Forms.Keys.F3;
this.mnuFindNext.Size = new System.Drawing.Size(255, 22);
this.mnuFindNext.Size = new System.Drawing.Size(183, 22);
this.mnuFindNext.Text = "Find Next";
this.mnuFindNext.Click += new System.EventHandler(this.mnuFindNext_Click);
//
@ -821,22 +806,19 @@ namespace Mesen.GUI.Debugger
//
this.mnuFindPrev.Image = global::Mesen.GUI.Properties.Resources.PreviousArrow;
this.mnuFindPrev.Name = "mnuFindPrev";
this.mnuFindPrev.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F3)));
this.mnuFindPrev.Size = new System.Drawing.Size(255, 22);
this.mnuFindPrev.Size = new System.Drawing.Size(183, 22);
this.mnuFindPrev.Text = "Find Previous";
this.mnuFindPrev.Click += new System.EventHandler(this.mnuFindPrev_Click);
//
// toolStripMenuItem9
//
this.toolStripMenuItem9.Name = "toolStripMenuItem9";
this.toolStripMenuItem9.Size = new System.Drawing.Size(252, 6);
this.toolStripMenuItem9.Size = new System.Drawing.Size(180, 6);
//
// mnuFindAllOccurrences
//
this.mnuFindAllOccurrences.Name = "mnuFindAllOccurrences";
this.mnuFindAllOccurrences.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.F)));
this.mnuFindAllOccurrences.Size = new System.Drawing.Size(255, 22);
this.mnuFindAllOccurrences.Size = new System.Drawing.Size(183, 22);
this.mnuFindAllOccurrences.Text = "Find All Occurrences";
this.mnuFindAllOccurrences.Click += new System.EventHandler(this.mnuFindAllOccurrences_Click);
//
@ -851,53 +833,52 @@ namespace Mesen.GUI.Debugger
this.toolStripMenuItem23,
this.mnuGoToProgramCount});
this.mnuGoTo.Name = "mnuGoTo";
this.mnuGoTo.Size = new System.Drawing.Size(255, 22);
this.mnuGoTo.Size = new System.Drawing.Size(183, 22);
this.mnuGoTo.Text = "Go To...";
//
// mnuGoToAddress
//
this.mnuGoToAddress.Name = "mnuGoToAddress";
this.mnuGoToAddress.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
this.mnuGoToAddress.Size = new System.Drawing.Size(201, 22);
this.mnuGoToAddress.Size = new System.Drawing.Size(166, 22);
this.mnuGoToAddress.Text = "Address";
this.mnuGoToAddress.Click += new System.EventHandler(this.mnuGoToAddress_Click);
//
// toolStripMenuItem22
//
this.toolStripMenuItem22.Name = "toolStripMenuItem22";
this.toolStripMenuItem22.Size = new System.Drawing.Size(198, 6);
this.toolStripMenuItem22.Size = new System.Drawing.Size(163, 6);
//
// mnuGoToIrqHandler
//
this.mnuGoToIrqHandler.Name = "mnuGoToIrqHandler";
this.mnuGoToIrqHandler.Size = new System.Drawing.Size(201, 22);
this.mnuGoToIrqHandler.Size = new System.Drawing.Size(166, 22);
this.mnuGoToIrqHandler.Text = "IRQ Handler";
this.mnuGoToIrqHandler.Click += new System.EventHandler(this.mnuGoToIrqHandler_Click);
//
// mnuGoToNmiHandler
//
this.mnuGoToNmiHandler.Name = "mnuGoToNmiHandler";
this.mnuGoToNmiHandler.Size = new System.Drawing.Size(201, 22);
this.mnuGoToNmiHandler.Size = new System.Drawing.Size(166, 22);
this.mnuGoToNmiHandler.Text = "NMI Handler";
this.mnuGoToNmiHandler.Click += new System.EventHandler(this.mnuGoToNmiHandler_Click);
//
// mnuGoToResetHandler
//
this.mnuGoToResetHandler.Name = "mnuGoToResetHandler";
this.mnuGoToResetHandler.Size = new System.Drawing.Size(201, 22);
this.mnuGoToResetHandler.Size = new System.Drawing.Size(166, 22);
this.mnuGoToResetHandler.Text = "Reset Handler";
this.mnuGoToResetHandler.Click += new System.EventHandler(this.mnuGoToResetHandler_Click);
//
// toolStripMenuItem23
//
this.toolStripMenuItem23.Name = "toolStripMenuItem23";
this.toolStripMenuItem23.Size = new System.Drawing.Size(198, 6);
this.toolStripMenuItem23.Size = new System.Drawing.Size(163, 6);
//
// mnuGoToProgramCount
//
this.mnuGoToProgramCount.Name = "mnuGoToProgramCount";
this.mnuGoToProgramCount.ShortcutKeyDisplayString = "Alt+*";
this.mnuGoToProgramCount.Size = new System.Drawing.Size(201, 22);
this.mnuGoToProgramCount.ShortcutKeyDisplayString = "";
this.mnuGoToProgramCount.Size = new System.Drawing.Size(166, 22);
this.mnuGoToProgramCount.Text = "Program Counter";
this.mnuGoToProgramCount.Click += new System.EventHandler(this.mnuGoToProgramCount_Click);
//
@ -913,12 +894,13 @@ namespace Mesen.GUI.Debugger
this.mnuConfigureColors,
this.mnuSplitView,
this.toolStripMenuItem11,
this.toolStripMenuItem6,
this.mnuHidePauseIcon,
this.mnuPpuPartialDraw,
this.mnuPpuShowPreviousFrame,
this.toolStripMenuItem19,
this.mnuRefreshWatchWhileRunning});
this.mnuRefreshWatchWhileRunning,
this.toolStripMenuItem6,
this.mnuPreferences});
this.mnuOptions.Name = "mnuOptions";
this.mnuOptions.Size = new System.Drawing.Size(61, 20);
this.mnuOptions.Text = "Options";
@ -987,7 +969,7 @@ namespace Mesen.GUI.Debugger
this.mnuShowDisassembledCode.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnuShowDisassembledCode.Enabled = false;
this.mnuShowDisassembledCode.Name = "mnuShowDisassembledCode";
this.mnuShowDisassembledCode.Size = new System.Drawing.Size(235, 22);
this.mnuShowDisassembledCode.Size = new System.Drawing.Size(199, 22);
this.mnuShowDisassembledCode.Text = "Disassembled Code";
//
// mnuShowVerifiedData
@ -995,8 +977,7 @@ namespace Mesen.GUI.Debugger
this.mnuShowVerifiedData.CheckOnClick = true;
this.mnuShowVerifiedData.Image = global::Mesen.GUI.Properties.Resources.VerifiedData;
this.mnuShowVerifiedData.Name = "mnuShowVerifiedData";
this.mnuShowVerifiedData.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D1)));
this.mnuShowVerifiedData.Size = new System.Drawing.Size(235, 22);
this.mnuShowVerifiedData.Size = new System.Drawing.Size(199, 22);
this.mnuShowVerifiedData.Text = "Verified Data";
this.mnuShowVerifiedData.Click += new System.EventHandler(this.mnuShowVerifiedData_Click);
//
@ -1005,8 +986,7 @@ namespace Mesen.GUI.Debugger
this.mnuShowUnidentifiedData.CheckOnClick = true;
this.mnuShowUnidentifiedData.Image = global::Mesen.GUI.Properties.Resources.UnidentifiedData;
this.mnuShowUnidentifiedData.Name = "mnuShowUnidentifiedData";
this.mnuShowUnidentifiedData.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.D2)));
this.mnuShowUnidentifiedData.Size = new System.Drawing.Size(235, 22);
this.mnuShowUnidentifiedData.Size = new System.Drawing.Size(199, 22);
this.mnuShowUnidentifiedData.Text = "Unidentified Code/Data";
this.mnuShowUnidentifiedData.Click += new System.EventHandler(this.mnuShowUnidentifiedData_Click);
//
@ -1146,7 +1126,7 @@ namespace Mesen.GUI.Debugger
this.toolStripMenuItem18,
this.mnuShowCodePreview,
this.mnuShowOpCodeTooltips});
this.mnuShowOptions.Image = global::Mesen.GUI.Properties.Resources.Cog;
this.mnuShowOptions.Image = global::Mesen.GUI.Properties.Resources.DipSwitches;
this.mnuShowOptions.Name = "mnuShowOptions";
this.mnuShowOptions.Size = new System.Drawing.Size(266, 22);
this.mnuShowOptions.Text = "Show...";
@ -1254,39 +1234,36 @@ namespace Mesen.GUI.Debugger
// mnuIncreaseFontSize
//
this.mnuIncreaseFontSize.Name = "mnuIncreaseFontSize";
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "Ctrl++";
this.mnuIncreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Oemplus)));
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuIncreaseFontSize.Text = "Increase Size";
this.mnuIncreaseFontSize.Click += new System.EventHandler(this.mnuIncreaseFontSize_Click);
//
// mnuDecreaseFontSize
//
this.mnuDecreaseFontSize.Name = "mnuDecreaseFontSize";
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "Ctrl+-";
this.mnuDecreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.OemMinus)));
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuDecreaseFontSize.Text = "Decrease Size";
this.mnuDecreaseFontSize.Click += new System.EventHandler(this.mnuDecreaseFontSize_Click);
//
// mnuResetFontSize
//
this.mnuResetFontSize.Name = "mnuResetFontSize";
this.mnuResetFontSize.ShortcutKeyDisplayString = "Ctrl+0";
this.mnuResetFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D0)));
this.mnuResetFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuResetFontSize.ShortcutKeyDisplayString = "";
this.mnuResetFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuResetFontSize.Text = "Reset to Default";
this.mnuResetFontSize.Click += new System.EventHandler(this.mnuResetFontSize_Click);
//
// toolStripMenuItem21
//
this.toolStripMenuItem21.Name = "toolStripMenuItem21";
this.toolStripMenuItem21.Size = new System.Drawing.Size(194, 6);
this.toolStripMenuItem21.Size = new System.Drawing.Size(154, 6);
//
// mnuSelectFont
//
this.mnuSelectFont.Name = "mnuSelectFont";
this.mnuSelectFont.Size = new System.Drawing.Size(197, 22);
this.mnuSelectFont.Size = new System.Drawing.Size(157, 22);
this.mnuSelectFont.Text = "Select Font...";
this.mnuSelectFont.Click += new System.EventHandler(this.mnuSelectFont_Click);
//
@ -1312,11 +1289,6 @@ namespace Mesen.GUI.Debugger
this.toolStripMenuItem11.Name = "toolStripMenuItem11";
this.toolStripMenuItem11.Size = new System.Drawing.Size(263, 6);
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(263, 6);
//
// mnuHidePauseIcon
//
this.mnuHidePauseIcon.CheckOnClick = true;
@ -1354,6 +1326,19 @@ namespace Mesen.GUI.Debugger
this.mnuRefreshWatchWhileRunning.Text = "Refresh watch while running";
this.mnuRefreshWatchWhileRunning.Click += new System.EventHandler(this.mnuRefreshWatchWhileRunning_Click);
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(263, 6);
//
// mnuPreferences
//
this.mnuPreferences.Image = global::Mesen.GUI.Properties.Resources.Cog;
this.mnuPreferences.Name = "mnuPreferences";
this.mnuPreferences.Size = new System.Drawing.Size(266, 22);
this.mnuPreferences.Text = "Configure shortcut keys...";
this.mnuPreferences.Click += new System.EventHandler(this.mnuPreferences_Click);
//
// toolsToolStripMenuItem
//
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -1376,8 +1361,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuApuViewer.Image = global::Mesen.GUI.Properties.Resources.Audio;
this.mnuApuViewer.Name = "mnuApuViewer";
this.mnuApuViewer.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
this.mnuApuViewer.Size = new System.Drawing.Size(205, 22);
this.mnuApuViewer.Size = new System.Drawing.Size(171, 22);
this.mnuApuViewer.Text = "APU Viewer";
this.mnuApuViewer.Click += new System.EventHandler(this.mnuApuViewer_Click);
//
@ -1385,8 +1369,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuAssembler.Image = global::Mesen.GUI.Properties.Resources.Chip;
this.mnuAssembler.Name = "mnuAssembler";
this.mnuAssembler.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.K)));
this.mnuAssembler.Size = new System.Drawing.Size(205, 22);
this.mnuAssembler.Size = new System.Drawing.Size(171, 22);
this.mnuAssembler.Text = "Assembler";
this.mnuAssembler.Click += new System.EventHandler(this.mnuAssembler_Click);
//
@ -1394,8 +1377,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuMemoryViewer.Image = global::Mesen.GUI.Properties.Resources.CheatCode;
this.mnuMemoryViewer.Name = "mnuMemoryViewer";
this.mnuMemoryViewer.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.M)));
this.mnuMemoryViewer.Size = new System.Drawing.Size(205, 22);
this.mnuMemoryViewer.Size = new System.Drawing.Size(171, 22);
this.mnuMemoryViewer.Text = "Memory Tools";
this.mnuMemoryViewer.Click += new System.EventHandler(this.mnuMemoryViewer_Click);
//
@ -1403,8 +1385,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuEventViewer.Image = global::Mesen.GUI.Properties.Resources.NesEventViewer;
this.mnuEventViewer.Name = "mnuEventViewer";
this.mnuEventViewer.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.mnuEventViewer.Size = new System.Drawing.Size(205, 22);
this.mnuEventViewer.Size = new System.Drawing.Size(171, 22);
this.mnuEventViewer.Text = "NES Event Viewer";
this.mnuEventViewer.Click += new System.EventHandler(this.mnuEventViewer_Click);
//
@ -1412,8 +1393,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuPpuViewer.Image = global::Mesen.GUI.Properties.Resources.Video;
this.mnuPpuViewer.Name = "mnuPpuViewer";
this.mnuPpuViewer.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
this.mnuPpuViewer.Size = new System.Drawing.Size(205, 22);
this.mnuPpuViewer.Size = new System.Drawing.Size(171, 22);
this.mnuPpuViewer.Text = "PPU Viewer";
this.mnuPpuViewer.Click += new System.EventHandler(this.mnuNametableViewer_Click);
//
@ -1421,8 +1401,7 @@ namespace Mesen.GUI.Debugger
//
this.mnuScriptWindow.Image = global::Mesen.GUI.Properties.Resources.Script;
this.mnuScriptWindow.Name = "mnuScriptWindow";
this.mnuScriptWindow.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.J)));
this.mnuScriptWindow.Size = new System.Drawing.Size(205, 22);
this.mnuScriptWindow.Size = new System.Drawing.Size(171, 22);
this.mnuScriptWindow.Text = "Script Window";
this.mnuScriptWindow.Click += new System.EventHandler(this.mnuScriptWindow_Click);
//
@ -1430,28 +1409,27 @@ namespace Mesen.GUI.Debugger
//
this.mnuTraceLogger.Image = global::Mesen.GUI.Properties.Resources.LogWindow;
this.mnuTraceLogger.Name = "mnuTraceLogger";
this.mnuTraceLogger.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.mnuTraceLogger.Size = new System.Drawing.Size(205, 22);
this.mnuTraceLogger.Size = new System.Drawing.Size(171, 22);
this.mnuTraceLogger.Text = "Trace Logger";
this.mnuTraceLogger.Click += new System.EventHandler(this.mnuTraceLogger_Click);
//
// toolStripMenuItem13
//
this.toolStripMenuItem13.Name = "toolStripMenuItem13";
this.toolStripMenuItem13.Size = new System.Drawing.Size(202, 6);
this.toolStripMenuItem13.Size = new System.Drawing.Size(168, 6);
//
// mnuEditHeader
//
this.mnuEditHeader.Image = global::Mesen.GUI.Properties.Resources.Edit;
this.mnuEditHeader.Name = "mnuEditHeader";
this.mnuEditHeader.Size = new System.Drawing.Size(205, 22);
this.mnuEditHeader.Size = new System.Drawing.Size(171, 22);
this.mnuEditHeader.Text = "Edit iNES Header";
this.mnuEditHeader.Click += new System.EventHandler(this.mnuEditHeader_Click);
//
// toolStripMenuItem17
//
this.toolStripMenuItem17.Name = "toolStripMenuItem17";
this.toolStripMenuItem17.Size = new System.Drawing.Size(202, 6);
this.toolStripMenuItem17.Size = new System.Drawing.Size(168, 6);
//
// mnuCodeDataLogger
//
@ -1464,7 +1442,7 @@ namespace Mesen.GUI.Debugger
this.toolStripMenuItem5,
this.mnuCdlGenerateRom});
this.mnuCodeDataLogger.Name = "mnuCodeDataLogger";
this.mnuCodeDataLogger.Size = new System.Drawing.Size(205, 22);
this.mnuCodeDataLogger.Size = new System.Drawing.Size(171, 22);
this.mnuCodeDataLogger.Text = "Code/Data Logger";
//
// autoLoadsaveCDLFileToolStripMenuItem
@ -1736,7 +1714,6 @@ namespace Mesen.GUI.Debugger
private Controls.ctrlMemoryMapping ctrlPpuMemoryMapping;
private System.Windows.Forms.ToolStripMenuItem mnuShowCpuMemoryMapping;
private System.Windows.Forms.ToolStripMenuItem mnuShowPpuMemoryMapping;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6;
private System.Windows.Forms.TableLayoutPanel tlpFunctionLabelLists;
private System.Windows.Forms.GroupBox grpLabels;
private System.Windows.Forms.GroupBox grpFunctions;
@ -1823,5 +1800,7 @@ namespace Mesen.GUI.Debugger
private System.Windows.Forms.ToolStripMenuItem mnuCopyOptions;
private System.Windows.Forms.ToolStripMenuItem mnuCopyAddresses;
private System.Windows.Forms.ToolStripMenuItem mnuCopyByteCode;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6;
private System.Windows.Forms.ToolStripMenuItem mnuPreferences;
}
}

View file

@ -55,6 +55,7 @@ namespace Mesen.GUI.Debugger
ctrlDebuggerCode.BaseFont = font;
ctrlDebuggerCodeSplit.BaseFont = font;
this.InitShortcuts();
this.InitToolbar();
this.UpdateWorkspace();
@ -159,6 +160,48 @@ namespace Mesen.GUI.Debugger
tmrCdlRatios.Start();
}
private void InitShortcuts()
{
mnuIncreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.IncreaseFontSize));
mnuDecreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.DecreaseFontSize));
mnuResetFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.ResetFontSize));
mnuSaveRom.InitShortcut(this, nameof(DebuggerShortcutsConfig.SaveRom));
mnuSaveRomAs.InitShortcut(this, nameof(DebuggerShortcutsConfig.SaveRomAs));
mnuSaveAsIps.InitShortcut(this, nameof(DebuggerShortcutsConfig.SaveEditAsIps));
mnuRevertChanges.InitShortcut(this, nameof(DebuggerShortcutsConfig.RevertPrgChrChanges));
mnuContinue.InitShortcut(this, nameof(DebuggerShortcutsConfig.Continue));
mnuBreak.InitShortcut(this, nameof(DebuggerShortcutsConfig.Break));
mnuBreakIn.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakIn));
mnuStepBack.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepBack));
mnuStepOut.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepOut));
mnuStepInto.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepInto));
mnuStepOver.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepOver));
mnuRunPpuCycle.InitShortcut(this, nameof(DebuggerShortcutsConfig.RunPpuCycle));
mnuRunScanline.InitShortcut(this, nameof(DebuggerShortcutsConfig.RunPpuScanline));
mnuRunOneFrame.InitShortcut(this, nameof(DebuggerShortcutsConfig.RunPpuFrame));
mnuGoToAddress.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoTo));
mnuFind.InitShortcut(this, nameof(DebuggerShortcutsConfig.Find));
mnuFindNext.InitShortcut(this, nameof(DebuggerShortcutsConfig.FindNext));
mnuFindPrev.InitShortcut(this, nameof(DebuggerShortcutsConfig.FindPrev));
mnuFindAllOccurrences.InitShortcut(this, nameof(DebuggerShortcutsConfig.FindOccurrences));
mnuShowVerifiedData.InitShortcut(this, nameof(DebuggerShortcutsConfig.ToggleVerifiedData));
mnuShowUnidentifiedData.InitShortcut(this, nameof(DebuggerShortcutsConfig.ToggleUnidentifiedCodeData));
mnuApuViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenApuViewer));
mnuAssembler.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenAssembler));
mnuEventViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenEventViewer));
mnuMemoryViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenMemoryTools));
mnuPpuViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenPpuViewer));
mnuScriptWindow.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenScriptWindow));
mnuTraceLogger.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenTraceLogger));
}
private void InitToolbar()
{
AddItemsToToolbar(
@ -186,10 +229,11 @@ namespace Mesen.GUI.Debugger
if(item.Image == null) {
newItem.Text = item.Text;
}
newItem.ToolTipText = (caption ?? item.Text) + (item.ShortcutKeys != Keys.None ? $" ({new KeysConverter().ConvertToString(item.ShortcutKeys)})" : "");
newItem.ToolTipText = (caption ?? item.Text) + (item.ShortcutKeys != Keys.None ? $" ({DebuggerShortcutsConfig.GetShortcutDisplay(item.ShortcutKeys)})" : "");
newItem.Click += (s, e) => item.PerformClick();
newItem.Checked = item.Checked;
newItem.Enabled = item.Enabled;
newItem.MouseEnter += (s, e) => newItem.ToolTipText = (caption ?? item.Text) + (item.ShortcutKeys != Keys.None ? $" ({DebuggerShortcutsConfig.GetShortcutDisplay(item.ShortcutKeys)})" : "");
item.EnabledChanged += (s, e) => newItem.Enabled = item.Enabled;
item.CheckedChanged += (s, e) => newItem.Checked = item.Checked;
item.VisibleChanged += (s, e) => newItem.Visible = item.Visible;
@ -1223,5 +1267,12 @@ namespace Mesen.GUI.Debugger
ctrlDebuggerCode.BaseFont = FontDialogHelper.SelectFont(ctrlDebuggerCode.Font);
ctrlDebuggerCodeSplit.BaseFont = ctrlDebuggerCode.BaseFont;
}
private void mnuPreferences_Click(object sender, EventArgs e)
{
using(frmDbgPreferences frm = new frmDbgPreferences()) {
frm.ShowDialog(sender, this);
}
}
}
}

View file

@ -192,7 +192,6 @@
//
this.mnuImport.Image = global::Mesen.GUI.Properties.Resources.Import;
this.mnuImport.Name = "mnuImport";
this.mnuImport.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.mnuImport.Size = new System.Drawing.Size(181, 22);
this.mnuImport.Text = "Import";
this.mnuImport.Click += new System.EventHandler(this.mnuImport_Click);
@ -201,7 +200,6 @@
//
this.mnuExport.Image = global::Mesen.GUI.Properties.Resources.Export;
this.mnuExport.Name = "mnuExport";
this.mnuExport.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.mnuExport.Size = new System.Drawing.Size(181, 22);
this.mnuExport.Text = "Export";
this.mnuExport.Click += new System.EventHandler(this.mnuExport_Click);
@ -277,7 +275,7 @@
//
this.mnuHighlightExecution.CheckOnClick = true;
this.mnuHighlightExecution.Name = "mnuHighlightExecution";
this.mnuHighlightExecution.Size = new System.Drawing.Size(133, 22);
this.mnuHighlightExecution.Size = new System.Drawing.Size(152, 22);
this.mnuHighlightExecution.Text = "Execution";
this.mnuHighlightExecution.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
//
@ -285,7 +283,7 @@
//
this.mnuHighlightWrites.CheckOnClick = true;
this.mnuHighlightWrites.Name = "mnuHighlightWrites";
this.mnuHighlightWrites.Size = new System.Drawing.Size(133, 22);
this.mnuHighlightWrites.Size = new System.Drawing.Size(152, 22);
this.mnuHighlightWrites.Text = "Writes";
this.mnuHighlightWrites.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
//
@ -293,14 +291,14 @@
//
this.mnuHightlightReads.CheckOnClick = true;
this.mnuHightlightReads.Name = "mnuHightlightReads";
this.mnuHightlightReads.Size = new System.Drawing.Size(133, 22);
this.mnuHightlightReads.Size = new System.Drawing.Size(152, 22);
this.mnuHightlightReads.Text = "Reads";
this.mnuHightlightReads.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(130, 6);
this.toolStripMenuItem6.Size = new System.Drawing.Size(149, 6);
//
// fadeSpeedToolStripMenuItem
//
@ -312,7 +310,7 @@
this.toolStripMenuItem7,
this.mnuCustomFadeSpeed});
this.fadeSpeedToolStripMenuItem.Name = "fadeSpeedToolStripMenuItem";
this.fadeSpeedToolStripMenuItem.Size = new System.Drawing.Size(133, 22);
this.fadeSpeedToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.fadeSpeedToolStripMenuItem.Text = "Fade speed";
//
// mnuFadeSlow
@ -498,8 +496,7 @@
// mnuIncreaseFontSize
//
this.mnuIncreaseFontSize.Name = "mnuIncreaseFontSize";
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "Ctrl++";
this.mnuIncreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Oemplus)));
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(217, 22);
this.mnuIncreaseFontSize.Text = "Increase";
this.mnuIncreaseFontSize.Click += new System.EventHandler(this.mnuIncreaseFontSize_Click);
@ -507,8 +504,7 @@
// mnuDecreaseFontSize
//
this.mnuDecreaseFontSize.Name = "mnuDecreaseFontSize";
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "Ctrl+-";
this.mnuDecreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.OemMinus)));
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(217, 22);
this.mnuDecreaseFontSize.Text = "Decrease";
this.mnuDecreaseFontSize.Click += new System.EventHandler(this.mnuDecreaseFontSize_Click);
@ -516,8 +512,7 @@
// mnuResetFontSize
//
this.mnuResetFontSize.Name = "mnuResetFontSize";
this.mnuResetFontSize.ShortcutKeyDisplayString = "Ctrl+0";
this.mnuResetFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D0)));
this.mnuResetFontSize.ShortcutKeyDisplayString = "";
this.mnuResetFontSize.Size = new System.Drawing.Size(217, 22);
this.mnuResetFontSize.Text = "Reset to Default";
this.mnuResetFontSize.Click += new System.EventHandler(this.mnuResetFontSize_Click);
@ -588,7 +583,6 @@
//
this.mnuRefresh.Image = global::Mesen.GUI.Properties.Resources.Reset;
this.mnuRefresh.Name = "mnuRefresh";
this.mnuRefresh.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.mnuRefresh.Size = new System.Drawing.Size(256, 22);
this.mnuRefresh.Text = "Refresh";
this.mnuRefresh.Click += new System.EventHandler(this.mnuRefresh_Click);
@ -659,8 +653,7 @@
//
this.mnuFind.Image = global::Mesen.GUI.Properties.Resources.Find;
this.mnuFind.Name = "mnuFind";
this.mnuFind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.mnuFind.Size = new System.Drawing.Size(196, 22);
this.mnuFind.Size = new System.Drawing.Size(152, 22);
this.mnuFind.Text = "Find...";
this.mnuFind.Click += new System.EventHandler(this.mnuFind_Click);
//
@ -668,8 +661,7 @@
//
this.mnuFindNext.Image = global::Mesen.GUI.Properties.Resources.NextArrow;
this.mnuFindNext.Name = "mnuFindNext";
this.mnuFindNext.ShortcutKeys = System.Windows.Forms.Keys.F3;
this.mnuFindNext.Size = new System.Drawing.Size(196, 22);
this.mnuFindNext.Size = new System.Drawing.Size(152, 22);
this.mnuFindNext.Text = "Find Next";
this.mnuFindNext.Click += new System.EventHandler(this.mnuFindNext_Click);
//
@ -677,16 +669,14 @@
//
this.mnuFindPrev.Image = global::Mesen.GUI.Properties.Resources.PreviousArrow;
this.mnuFindPrev.Name = "mnuFindPrev";
this.mnuFindPrev.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F3)));
this.mnuFindPrev.Size = new System.Drawing.Size(196, 22);
this.mnuFindPrev.Size = new System.Drawing.Size(152, 22);
this.mnuFindPrev.Text = "Find Previous";
this.mnuFindPrev.Click += new System.EventHandler(this.mnuFindPrev_Click);
//
// mnuGoTo
//
this.mnuGoTo.Name = "mnuGoTo";
this.mnuGoTo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
this.mnuGoTo.Size = new System.Drawing.Size(196, 22);
this.mnuGoTo.Size = new System.Drawing.Size(152, 22);
this.mnuGoTo.Text = "Go To...";
this.mnuGoTo.Click += new System.EventHandler(this.mnuGoTo_Click);
//
@ -738,12 +728,14 @@
//
// ctrlMemoryAccessCounters
//
this.ctrlMemoryAccessCounters.BaseFont = new System.Drawing.Font("Consolas", 12F);
this.ctrlMemoryAccessCounters.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlMemoryAccessCounters.Location = new System.Drawing.Point(0, 0);
this.ctrlMemoryAccessCounters.Margin = new System.Windows.Forms.Padding(0);
this.ctrlMemoryAccessCounters.Name = "ctrlMemoryAccessCounters";
this.ctrlMemoryAccessCounters.Size = new System.Drawing.Size(606, 343);
this.ctrlMemoryAccessCounters.TabIndex = 0;
this.ctrlMemoryAccessCounters.TextZoom = 100;
//
// tpgProfiler
//

View file

@ -30,6 +30,7 @@ namespace Mesen.GUI.Debugger
InitializeComponent();
this._selectedTab = this.tabMain.SelectedTab;
this.InitShortcuts();
}
protected override void OnLoad(EventArgs e)
@ -102,6 +103,23 @@ namespace Mesen.GUI.Debugger
DebugWorkspaceManager.SaveWorkspace();
}
private void InitShortcuts()
{
mnuIncreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.IncreaseFontSize));
mnuDecreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.DecreaseFontSize));
mnuResetFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.ResetFontSize));
mnuImport.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_Import));
mnuExport.InitShortcut(this, nameof(DebuggerShortcutsConfig.MemoryViewer_Export));
mnuRefresh.InitShortcut(this, nameof(DebuggerShortcutsConfig.Refresh));
mnuGoTo.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoTo));
mnuFind.InitShortcut(this, nameof(DebuggerShortcutsConfig.Find));
mnuFindNext.InitShortcut(this, nameof(DebuggerShortcutsConfig.FindNext));
mnuFindPrev.InitShortcut(this, nameof(DebuggerShortcutsConfig.FindPrev));
}
private void InitMemoryTypeDropdown()
{
cboMemoryType.Items.Add(ResourceHelper.GetEnumText(DebugMemoryType.CpuMemory));

View file

@ -105,15 +105,14 @@ namespace Mesen.GUI.Debugger
//
this.mnuRefresh.Image = global::Mesen.GUI.Properties.Resources.Reset;
this.mnuRefresh.Name = "mnuRefresh";
this.mnuRefresh.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.mnuRefresh.Size = new System.Drawing.Size(141, 22);
this.mnuRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuRefresh.Text = "Refresh";
this.mnuRefresh.Click += new System.EventHandler(this.mnuRefresh_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(138, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
//
// mnuAutoRefresh
//
@ -121,7 +120,7 @@ namespace Mesen.GUI.Debugger
this.mnuAutoRefresh.CheckOnClick = true;
this.mnuAutoRefresh.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnuAutoRefresh.Name = "mnuAutoRefresh";
this.mnuAutoRefresh.Size = new System.Drawing.Size(141, 22);
this.mnuAutoRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuAutoRefresh.Text = "Auto-refresh";
this.mnuAutoRefresh.Click += new System.EventHandler(this.mnuAutoRefresh_Click);
//

View file

@ -28,6 +28,13 @@ namespace Mesen.GUI.Debugger
this._selectedTab = this.tpgNametableViewer;
this.mnuAutoRefresh.Checked = ConfigManager.Config.DebugInfo.PpuAutoRefresh;
this.ctrlNametableViewer.Connect(this.ctrlChrViewer);
this.InitShortcuts();
}
private void InitShortcuts()
{
mnuRefresh.InitShortcut(this, nameof(DebuggerShortcutsConfig.Refresh));
}
protected override void OnLoad(EventArgs e)
@ -164,7 +171,7 @@ namespace Mesen.GUI.Debugger
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(!this.nudScanline.ContainsFocus && !this.nudCycle.ContainsFocus) {
if(keyData == (Keys.Control | Keys.C)) {
if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.Copy) {
if(this.tabMain.SelectedTab == tpgNametableViewer) {
ctrlNametableViewer.CopyToClipboard();
} else if(this.tabMain.SelectedTab == tpgChrViewer) {

View file

@ -47,6 +47,8 @@
this.mnuIncreaseFontSize = new System.Windows.Forms.ToolStripMenuItem();
this.mnuDecreaseFontSize = new System.Windows.Forms.ToolStripMenuItem();
this.mnuResetFontSize = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
this.mnuSelectFont = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
this.mnuShowLogWindow = new System.Windows.Forms.ToolStripMenuItem();
this.scriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -78,8 +80,6 @@
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.lblScriptActive = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
this.mnuSelectFont = new System.Windows.Forms.ToolStripMenuItem();
this.mnuMain.SuspendLayout();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.txtScriptContent)).BeginInit();
@ -122,8 +122,7 @@
//
this.mnuNewScript.Image = global::Mesen.GUI.Properties.Resources.Script;
this.mnuNewScript.Name = "mnuNewScript";
this.mnuNewScript.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.mnuNewScript.Size = new System.Drawing.Size(221, 22);
this.mnuNewScript.Size = new System.Drawing.Size(178, 22);
this.mnuNewScript.Text = "New Script Window";
this.mnuNewScript.Click += new System.EventHandler(this.mnuNewScript_Click);
//
@ -131,8 +130,7 @@
//
this.mnuOpen.Image = global::Mesen.GUI.Properties.Resources.FolderOpen;
this.mnuOpen.Name = "mnuOpen";
this.mnuOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.mnuOpen.Size = new System.Drawing.Size(221, 22);
this.mnuOpen.Size = new System.Drawing.Size(178, 22);
this.mnuOpen.Text = "Open";
this.mnuOpen.Click += new System.EventHandler(this.mnuOpen_Click);
//
@ -140,39 +138,38 @@
//
this.mnuSave.Image = global::Mesen.GUI.Properties.Resources.Floppy;
this.mnuSave.Name = "mnuSave";
this.mnuSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.mnuSave.Size = new System.Drawing.Size(221, 22);
this.mnuSave.Size = new System.Drawing.Size(178, 22);
this.mnuSave.Text = "Save";
this.mnuSave.Click += new System.EventHandler(this.btnSave_Click);
//
// mnuSaveAs
//
this.mnuSaveAs.Name = "mnuSaveAs";
this.mnuSaveAs.Size = new System.Drawing.Size(221, 22);
this.mnuSaveAs.Size = new System.Drawing.Size(178, 22);
this.mnuSaveAs.Text = "Save as...";
this.mnuSaveAs.Click += new System.EventHandler(this.mnuSaveAs_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(218, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(175, 6);
//
// mnuRecentScripts
//
this.mnuRecentScripts.Name = "mnuRecentScripts";
this.mnuRecentScripts.Size = new System.Drawing.Size(221, 22);
this.mnuRecentScripts.Size = new System.Drawing.Size(178, 22);
this.mnuRecentScripts.Text = "Recent Scripts";
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(218, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(175, 6);
//
// mnuClose
//
this.mnuClose.Image = global::Mesen.GUI.Properties.Resources.Exit;
this.mnuClose.Name = "mnuClose";
this.mnuClose.Size = new System.Drawing.Size(221, 22);
this.mnuClose.Size = new System.Drawing.Size(178, 22);
this.mnuClose.Text = "Close";
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
//
@ -203,30 +200,39 @@
// mnuIncreaseFontSize
//
this.mnuIncreaseFontSize.Name = "mnuIncreaseFontSize";
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "Ctrl++";
this.mnuIncreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Oemplus)));
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuIncreaseFontSize.Text = "Increase Size";
this.mnuIncreaseFontSize.Click += new System.EventHandler(this.mnuIncreaseFontSize_Click);
//
// mnuDecreaseFontSize
//
this.mnuDecreaseFontSize.Name = "mnuDecreaseFontSize";
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "Ctrl+-";
this.mnuDecreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.OemMinus)));
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuDecreaseFontSize.Text = "Decrease Size";
this.mnuDecreaseFontSize.Click += new System.EventHandler(this.mnuDecreaseFontSize_Click);
//
// mnuResetFontSize
//
this.mnuResetFontSize.Name = "mnuResetFontSize";
this.mnuResetFontSize.ShortcutKeyDisplayString = "Ctrl+0";
this.mnuResetFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D0)));
this.mnuResetFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuResetFontSize.ShortcutKeyDisplayString = "";
this.mnuResetFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuResetFontSize.Text = "Reset to Default";
this.mnuResetFontSize.Click += new System.EventHandler(this.mnuResetFontSize_Click);
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(154, 6);
//
// mnuSelectFont
//
this.mnuSelectFont.Name = "mnuSelectFont";
this.mnuSelectFont.Size = new System.Drawing.Size(157, 22);
this.mnuSelectFont.Text = "Select Font...";
this.mnuSelectFont.Click += new System.EventHandler(this.mnuSelectFont_Click);
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
@ -257,7 +263,6 @@
//
this.mnuRun.Image = global::Mesen.GUI.Properties.Resources.Play;
this.mnuRun.Name = "mnuRun";
this.mnuRun.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.mnuRun.Size = new System.Drawing.Size(258, 22);
this.mnuRun.Text = "Run";
this.mnuRun.Click += new System.EventHandler(this.mnuRun_Click);
@ -266,7 +271,7 @@
//
this.mnuStop.Image = global::Mesen.GUI.Properties.Resources.Stop;
this.mnuStop.Name = "mnuStop";
this.mnuStop.ShortcutKeyDisplayString = "Esc";
this.mnuStop.ShortcutKeyDisplayString = "";
this.mnuStop.Size = new System.Drawing.Size(258, 22);
this.mnuStop.Text = "Stop";
this.mnuStop.Click += new System.EventHandler(this.mnuStop_Click);
@ -343,7 +348,7 @@
this.btnOpen.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnOpen.Name = "btnOpen";
this.btnOpen.Size = new System.Drawing.Size(23, 22);
this.btnOpen.Text = "Open (Ctrl-O)";
this.btnOpen.Text = "Open";
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
//
// btnSave
@ -353,7 +358,7 @@
this.btnSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(23, 22);
this.btnSave.Text = "Save (Ctrl-S)";
this.btnSave.Text = "Save";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// toolStripSeparator1
@ -368,7 +373,7 @@
this.btnRun.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnRun.Name = "btnRun";
this.btnRun.Size = new System.Drawing.Size(23, 22);
this.btnRun.Text = "Run (F5)";
this.btnRun.Text = "Run";
this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
//
// btnStop
@ -435,42 +440,38 @@
this.toolStripMenuItem5,
this.mnuSelectAll});
this.contextMenu.Name = "contextMenu";
this.contextMenu.Size = new System.Drawing.Size(165, 98);
this.contextMenu.Size = new System.Drawing.Size(123, 98);
//
// mnuCopy
//
this.mnuCopy.Name = "mnuCopy";
this.mnuCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.mnuCopy.Size = new System.Drawing.Size(164, 22);
this.mnuCopy.Size = new System.Drawing.Size(122, 22);
this.mnuCopy.Text = "Copy";
this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click);
//
// mnuCut
//
this.mnuCut.Name = "mnuCut";
this.mnuCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this.mnuCut.Size = new System.Drawing.Size(164, 22);
this.mnuCut.Size = new System.Drawing.Size(122, 22);
this.mnuCut.Text = "Cut";
this.mnuCut.Click += new System.EventHandler(this.mnuCut_Click);
//
// mnuPaste
//
this.mnuPaste.Name = "mnuPaste";
this.mnuPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.mnuPaste.Size = new System.Drawing.Size(164, 22);
this.mnuPaste.Size = new System.Drawing.Size(122, 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(161, 6);
this.toolStripMenuItem5.Size = new System.Drawing.Size(119, 6);
//
// mnuSelectAll
//
this.mnuSelectAll.Name = "mnuSelectAll";
this.mnuSelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.mnuSelectAll.Size = new System.Drawing.Size(164, 22);
this.mnuSelectAll.Size = new System.Drawing.Size(122, 22);
this.mnuSelectAll.Text = "Select All";
this.mnuSelectAll.Click += new System.EventHandler(this.mnuSelectAll_Click);
//
@ -540,18 +541,6 @@
this.lblScriptActive.Text = "Script is running";
this.lblScriptActive.Visible = false;
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(194, 6);
//
// mnuSelectFont
//
this.mnuSelectFont.Name = "mnuSelectFont";
this.mnuSelectFont.Size = new System.Drawing.Size(197, 22);
this.mnuSelectFont.Text = "Select Font...";
this.mnuSelectFont.Click += new System.EventHandler(this.mnuSelectFont_Click);
//
// frmScript
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View file

@ -109,9 +109,29 @@ namespace Mesen.GUI.Debugger
if(!this.DesignMode) {
this._notifListener = new InteropEmu.NotificationListener();
this._notifListener.OnNotification += this._notifListener_OnNotification;
this.InitShortcuts();
}
}
private void InitShortcuts()
{
mnuOpen.InitShortcut(this, nameof(DebuggerShortcutsConfig.ScriptWindow_OpenScript));
mnuSave.InitShortcut(this, nameof(DebuggerShortcutsConfig.ScriptWindow_SaveScript));
mnuNewScript.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenScriptWindow));
mnuRun.InitShortcut(this, nameof(DebuggerShortcutsConfig.ScriptWindow_RunScript));
mnuStop.InitShortcut(this, nameof(DebuggerShortcutsConfig.ScriptWindow_StopScript));
mnuIncreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.IncreaseFontSize));
mnuDecreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.DecreaseFontSize));
mnuResetFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.ResetFontSize));
mnuPaste.InitShortcut(this, nameof(DebuggerShortcutsConfig.Paste));
mnuCopy.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
mnuCut.InitShortcut(this, nameof(DebuggerShortcutsConfig.Cut));
mnuSelectAll.InitShortcut(this, nameof(DebuggerShortcutsConfig.SelectAll));
}
private void _notifListener_OnNotification(InteropEmu.NotificationEventArgs e)
{
if(e.NotificationType == InteropEmu.ConsoleNotificationType.GameStopped) {
@ -152,14 +172,6 @@ namespace Mesen.GUI.Debugger
base.OnClosing(e);
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(keyData == Keys.Escape) {
StopScript();
}
return base.ProcessCmdKey(ref msg, keyData);
}
private void LoadScript()
{
using(OpenFileDialog ofd = new OpenFileDialog()) {

View file

@ -425,6 +425,7 @@
this.txtTraceLog.HideSelection = false;
this.txtTraceLog.Location = new System.Drawing.Point(3, 16);
this.txtTraceLog.Name = "txtTraceLog";
this.txtTraceLog.ShowCompactPrgAddresses = false;
this.txtTraceLog.ShowContentNotes = false;
this.txtTraceLog.ShowLineNumberNotes = false;
this.txtTraceLog.ShowMemoryValues = false;
@ -471,45 +472,42 @@
this.mnuSelectFont});
this.fontSizeToolStripMenuItem.Image = global::Mesen.GUI.Properties.Resources.Font;
this.fontSizeToolStripMenuItem.Name = "fontSizeToolStripMenuItem";
this.fontSizeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.fontSizeToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.fontSizeToolStripMenuItem.Text = "Font Options";
//
// mnuIncreaseFontSize
//
this.mnuIncreaseFontSize.Name = "mnuIncreaseFontSize";
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "Ctrl++";
this.mnuIncreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Oemplus)));
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuIncreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuIncreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuIncreaseFontSize.Text = "Increase Size";
this.mnuIncreaseFontSize.Click += new System.EventHandler(this.mnuIncreaseFontSize_Click);
//
// mnuDecreaseFontSize
//
this.mnuDecreaseFontSize.Name = "mnuDecreaseFontSize";
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "Ctrl+-";
this.mnuDecreaseFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.OemMinus)));
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuDecreaseFontSize.ShortcutKeyDisplayString = "";
this.mnuDecreaseFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuDecreaseFontSize.Text = "Decrease Size";
this.mnuDecreaseFontSize.Click += new System.EventHandler(this.mnuDecreaseFontSize_Click);
//
// mnuResetFontSize
//
this.mnuResetFontSize.Name = "mnuResetFontSize";
this.mnuResetFontSize.ShortcutKeyDisplayString = "Ctrl+0";
this.mnuResetFontSize.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D0)));
this.mnuResetFontSize.Size = new System.Drawing.Size(197, 22);
this.mnuResetFontSize.ShortcutKeyDisplayString = "";
this.mnuResetFontSize.Size = new System.Drawing.Size(157, 22);
this.mnuResetFontSize.Text = "Reset to Default";
this.mnuResetFontSize.Click += new System.EventHandler(this.mnuResetFontSize_Click);
//
// toolStripMenuItem12
//
this.toolStripMenuItem12.Name = "toolStripMenuItem12";
this.toolStripMenuItem12.Size = new System.Drawing.Size(194, 6);
this.toolStripMenuItem12.Size = new System.Drawing.Size(154, 6);
//
// mnuSelectFont
//
this.mnuSelectFont.Name = "mnuSelectFont";
this.mnuSelectFont.Size = new System.Drawing.Size(197, 22);
this.mnuSelectFont.Size = new System.Drawing.Size(157, 22);
this.mnuSelectFont.Text = "Select Font...";
this.mnuSelectFont.Click += new System.EventHandler(this.mnuSelectFont_Click);
//
@ -521,7 +519,7 @@
this.mnu10000Lines,
this.mnu30000Lines});
this.logLinesToolStripMenuItem.Name = "logLinesToolStripMenuItem";
this.logLinesToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.logLinesToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
this.logLinesToolStripMenuItem.Text = "Line Count";
//
// mnu100Lines
@ -560,20 +558,19 @@
this.mnuAutoRefresh.CheckOnClick = true;
this.mnuAutoRefresh.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnuAutoRefresh.Name = "mnuAutoRefresh";
this.mnuAutoRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuAutoRefresh.Size = new System.Drawing.Size(143, 22);
this.mnuAutoRefresh.Text = "Auto-refresh";
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(140, 6);
//
// mnuRefresh
//
this.mnuRefresh.Image = global::Mesen.GUI.Properties.Resources.Reset;
this.mnuRefresh.Name = "mnuRefresh";
this.mnuRefresh.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.mnuRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuRefresh.Size = new System.Drawing.Size(143, 22);
this.mnuRefresh.Text = "Refresh";
this.mnuRefresh.Click += new System.EventHandler(this.mnuRefresh_Click);
//

View file

@ -56,6 +56,16 @@ namespace Mesen.GUI.Debugger
this.toolTip.SetToolTip(this.picExpressionWarning, "Condition contains invalid syntax or symbols.");
this.toolTip.SetToolTip(this.picHelp, "When a condition is given, instructions will only be logged by the trace logger if the condition returns a value not equal to 0 or false." + Environment.NewLine + Environment.NewLine + frmBreakpoint.GetConditionTooltip(false));
this.InitShortcuts();
}
private void InitShortcuts()
{
mnuIncreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.IncreaseFontSize));
mnuDecreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.DecreaseFontSize));
mnuResetFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.ResetFontSize));
mnuRefresh.InitShortcut(this, nameof(DebuggerShortcutsConfig.Refresh));
}
protected override void OnLoad(EventArgs e)
@ -145,19 +155,16 @@ namespace Mesen.GUI.Debugger
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch(keyData) {
case Keys.C | Keys.Control:
if(_previousTrace != null && !this.txtCondition.Focused && txtTraceLog.SelectionStart >= 0) {
string[] lines = _previousTrace.Split('\n');
StringBuilder sb = new StringBuilder();
for(int i = txtTraceLog.SelectionStart, end = txtTraceLog.SelectionStart + txtTraceLog.SelectionLength; i <= end && i < lines.Length; i++) {
sb.AppendLine(lines[i]);
}
Clipboard.SetText(sb.ToString());
return true;
if(keyData == ConfigManager.Config.DebugInfo.Shortcuts.Copy) {
if(_previousTrace != null && !this.txtCondition.Focused && txtTraceLog.SelectionStart >= 0) {
string[] lines = _previousTrace.Split('\n');
StringBuilder sb = new StringBuilder();
for(int i = txtTraceLog.SelectionStart, end = txtTraceLog.SelectionStart + txtTraceLog.SelectionLength; i <= end && i < lines.Length; i++) {
sb.AppendLine(lines[i]);
}
break;
Clipboard.SetText(sb.ToString());
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}

View file

@ -15,12 +15,24 @@ namespace Mesen.GUI.Forms
private System.ComponentModel.IContainer components;
private bool _iconSet = false;
public delegate bool ProcessCmdKeyHandler(Keys keyData);
public event ProcessCmdKeyHandler OnProcessCmdKey;
public BaseForm()
{
InitializeComponent();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
bool? result = OnProcessCmdKey?.Invoke(keyData);
if(result == true) {
return true;
} else {
return base.ProcessCmdKey(ref msg, keyData);
}
}
public void Show(object sender, IWin32Window owner = null)
{
if(sender is ToolStripMenuItem) {

View file

@ -82,15 +82,7 @@ namespace Mesen.GUI.Forms.Config
EmulatorShortcut.DecreaseSpeed,
EmulatorShortcut.OpenFile,
EmulatorShortcut.OpenDebugger,
EmulatorShortcut.OpenAssembler,
EmulatorShortcut.OpenApuViewer,
EmulatorShortcut.OpenMemoryTools,
EmulatorShortcut.OpenEventViewer,
EmulatorShortcut.OpenPpuViewer,
EmulatorShortcut.OpenScriptWindow,
EmulatorShortcut.OpenTraceLogger,
EmulatorShortcut.MoveToNextStateSlot,
EmulatorShortcut.MoveToPreviousStateSlot,
EmulatorShortcut.SaveState,

View file

@ -347,50 +347,50 @@ namespace Mesen.GUI.Forms
//
this.mnuOpen.Image = global::Mesen.GUI.Properties.Resources.FolderOpen;
this.mnuOpen.Name = "mnuOpen";
this.mnuOpen.Size = new System.Drawing.Size(152, 22);
this.mnuOpen.Size = new System.Drawing.Size(136, 22);
this.mnuOpen.Text = "Open";
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem4.Size = new System.Drawing.Size(133, 6);
//
// mnuSaveState
//
this.mnuSaveState.Name = "mnuSaveState";
this.mnuSaveState.Size = new System.Drawing.Size(152, 22);
this.mnuSaveState.Size = new System.Drawing.Size(136, 22);
this.mnuSaveState.Text = "Save State";
this.mnuSaveState.DropDownOpening += new System.EventHandler(this.mnuSaveState_DropDownOpening);
//
// mnuLoadState
//
this.mnuLoadState.Name = "mnuLoadState";
this.mnuLoadState.Size = new System.Drawing.Size(152, 22);
this.mnuLoadState.Size = new System.Drawing.Size(136, 22);
this.mnuLoadState.Text = "Load State";
this.mnuLoadState.DropDownOpening += new System.EventHandler(this.mnuLoadState_DropDownOpening);
//
// toolStripMenuItem7
//
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
this.toolStripMenuItem7.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem7.Size = new System.Drawing.Size(133, 6);
//
// mnuRecentFiles
//
this.mnuRecentFiles.Name = "mnuRecentFiles";
this.mnuRecentFiles.Size = new System.Drawing.Size(152, 22);
this.mnuRecentFiles.Size = new System.Drawing.Size(136, 22);
this.mnuRecentFiles.Text = "Recent Files";
this.mnuRecentFiles.DropDownOpening += new System.EventHandler(this.mnuRecentFiles_DropDownOpening);
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem6.Size = new System.Drawing.Size(133, 6);
//
// mnuExit
//
this.mnuExit.Image = global::Mesen.GUI.Properties.Resources.Exit;
this.mnuExit.Name = "mnuExit";
this.mnuExit.Size = new System.Drawing.Size(152, 22);
this.mnuExit.Size = new System.Drawing.Size(136, 22);
this.mnuExit.Text = "Exit";
//
// mnuGame
@ -1413,6 +1413,7 @@ namespace Mesen.GUI.Forms
this.mnuDebugger.Name = "mnuDebugger";
this.mnuDebugger.Size = new System.Drawing.Size(182, 22);
this.mnuDebugger.Text = "Debugger";
this.mnuDebugger.Click += new System.EventHandler(this.mnuDebugger_Click);
//
// mnuLogWindow
//
@ -1473,6 +1474,7 @@ namespace Mesen.GUI.Forms
this.mnuApuViewer.Name = "mnuApuViewer";
this.mnuApuViewer.Size = new System.Drawing.Size(165, 22);
this.mnuApuViewer.Text = "APU Viewer";
this.mnuApuViewer.Click += new System.EventHandler(this.mnuApuViewer_Click);
//
// mnuAssembler
//
@ -1480,6 +1482,7 @@ namespace Mesen.GUI.Forms
this.mnuAssembler.Name = "mnuAssembler";
this.mnuAssembler.Size = new System.Drawing.Size(165, 22);
this.mnuAssembler.Text = "Assembler";
this.mnuAssembler.Click += new System.EventHandler(this.mnuAssembler_Click);
//
// mnuDebugDebugger
//
@ -1487,6 +1490,7 @@ namespace Mesen.GUI.Forms
this.mnuDebugDebugger.Name = "mnuDebugDebugger";
this.mnuDebugDebugger.Size = new System.Drawing.Size(165, 22);
this.mnuDebugDebugger.Text = "Debugger";
this.mnuDebugDebugger.Click += new System.EventHandler(this.mnuDebugDebugger_Click);
//
// mnuMemoryViewer
//
@ -1494,6 +1498,7 @@ namespace Mesen.GUI.Forms
this.mnuMemoryViewer.Name = "mnuMemoryViewer";
this.mnuMemoryViewer.Size = new System.Drawing.Size(165, 22);
this.mnuMemoryViewer.Text = "Memory Tools";
this.mnuMemoryViewer.Click += new System.EventHandler(this.mnuMemoryViewer_Click);
//
// mnuEventViewer
//
@ -1501,6 +1506,7 @@ namespace Mesen.GUI.Forms
this.mnuEventViewer.Name = "mnuEventViewer";
this.mnuEventViewer.Size = new System.Drawing.Size(165, 22);
this.mnuEventViewer.Text = "NES Event Viewer";
this.mnuEventViewer.Click += new System.EventHandler(this.mnuEventViewer_Click);
//
// mnuPpuViewer
//
@ -1508,6 +1514,7 @@ namespace Mesen.GUI.Forms
this.mnuPpuViewer.Name = "mnuPpuViewer";
this.mnuPpuViewer.Size = new System.Drawing.Size(165, 22);
this.mnuPpuViewer.Text = "PPU Viewer";
this.mnuPpuViewer.Click += new System.EventHandler(this.mnuPpuViewer_Click);
//
// mnuScriptWindow
//
@ -1515,6 +1522,7 @@ namespace Mesen.GUI.Forms
this.mnuScriptWindow.Name = "mnuScriptWindow";
this.mnuScriptWindow.Size = new System.Drawing.Size(165, 22);
this.mnuScriptWindow.Text = "Script Window";
this.mnuScriptWindow.Click += new System.EventHandler(this.mnuScriptWindow_Click);
//
// mnuTraceLogger
//
@ -1522,6 +1530,7 @@ namespace Mesen.GUI.Forms
this.mnuTraceLogger.Name = "mnuTraceLogger";
this.mnuTraceLogger.Size = new System.Drawing.Size(165, 22);
this.mnuTraceLogger.Text = "Trace Logger";
this.mnuTraceLogger.Click += new System.EventHandler(this.mnuTraceLogger_Click);
//
// toolStripMenuItem25
//

View file

@ -209,5 +209,50 @@ namespace Mesen.GUI.Forms
{
InteropEmu.NetPlaySelectController(0xFF);
}
private void mnuApuViewer_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.ApuViewer);
}
private void mnuAssembler_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.Assembler);
}
private void mnuDebugger_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.Debugger);
}
private void mnuDebugDebugger_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.Debugger);
}
private void mnuMemoryViewer_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.MemoryViewer);
}
private void mnuEventViewer_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.EventViewer);
}
private void mnuPpuViewer_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.PpuViewer);
}
private void mnuScriptWindow_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.ScriptWindow);
}
private void mnuTraceLogger_Click(object sender, EventArgs e)
{
DebugWindowManager.OpenDebugWindow(DebugWindow.TraceLogger);
}
}
}

View file

@ -662,15 +662,15 @@ namespace Mesen.GUI.Forms
BindShortcut(mnuTakeScreenshot, EmulatorShortcut.TakeScreenshot, runningNotNsf);
BindShortcut(mnuRandomGame, EmulatorShortcut.LoadRandomGame);
BindShortcut(mnuDebugDebugger, EmulatorShortcut.OpenDebugger, runningNotClient);
BindShortcut(mnuDebugger, EmulatorShortcut.OpenDebugger, runningNotClient);
BindShortcut(mnuApuViewer, EmulatorShortcut.OpenApuViewer, runningNotClient);
BindShortcut(mnuAssembler, EmulatorShortcut.OpenAssembler, runningNotClient);
BindShortcut(mnuMemoryViewer, EmulatorShortcut.OpenMemoryTools, runningNotClient);
BindShortcut(mnuEventViewer, EmulatorShortcut.OpenEventViewer, runningNotClient);
BindShortcut(mnuPpuViewer, EmulatorShortcut.OpenPpuViewer, runningNotClient);
BindShortcut(mnuScriptWindow, EmulatorShortcut.OpenScriptWindow, runningNotClient);
BindShortcut(mnuTraceLogger, EmulatorShortcut.OpenTraceLogger, runningNotClient);
mnuDebugDebugger.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenDebugger));
mnuDebugger.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenDebugger));
mnuApuViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenApuViewer));
mnuAssembler.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenAssembler));
mnuMemoryViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenMemoryTools));
mnuEventViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenEventViewer));
mnuPpuViewer.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenPpuViewer));
mnuScriptWindow.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenScriptWindow));
mnuTraceLogger.InitShortcut(this, nameof(DebuggerShortcutsConfig.OpenTraceLogger));
}
private void BindShortcut(ToolStripMenuItem item, EmulatorShortcut shortcut, Func<bool> isActionEnabled = null)
@ -764,15 +764,6 @@ namespace Mesen.GUI.Forms
case EmulatorShortcut.TakeScreenshot: InteropEmu.TakeScreenshot(); break;
case EmulatorShortcut.LoadRandomGame: LoadRandomGame(); break;
case EmulatorShortcut.OpenApuViewer: DebugWindowManager.OpenDebugWindow(DebugWindow.ApuViewer); break;
case EmulatorShortcut.OpenAssembler: DebugWindowManager.OpenDebugWindow(DebugWindow.Assembler); break;
case EmulatorShortcut.OpenDebugger: DebugWindowManager.OpenDebugWindow(DebugWindow.Debugger); break;
case EmulatorShortcut.OpenTraceLogger: DebugWindowManager.OpenDebugWindow(DebugWindow.TraceLogger); break;
case EmulatorShortcut.OpenPpuViewer: DebugWindowManager.OpenDebugWindow(DebugWindow.PpuViewer); break;
case EmulatorShortcut.OpenMemoryTools: DebugWindowManager.OpenDebugWindow(DebugWindow.MemoryViewer); break;
case EmulatorShortcut.OpenEventViewer: DebugWindowManager.OpenDebugWindow(DebugWindow.EventViewer); break;
case EmulatorShortcut.OpenScriptWindow: DebugWindowManager.OpenDebugWindow(DebugWindow.ScriptWindow); break;
case EmulatorShortcut.LoadStateFromFile: LoadStateFromFile(); break;
case EmulatorShortcut.SaveStateToFile: SaveStateToFile(); break;
@ -984,6 +975,9 @@ namespace Mesen.GUI.Forms
mnuStopRecordTapeFile.Enabled = tapeRecording;
mnuDebugger.Visible = !devMode;
mnuDebugger.Enabled = !devMode;
mnuDebugDebugger.Enabled = devMode;
mnuHdPackEditor.Enabled = !netPlay && running;
mnuNetPlay.Enabled = !InteropEmu.IsNsf();

View file

@ -238,6 +238,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Config\DebuggerShortcutsConfig.cs" />
<Compile Include="Config\MovieRecordInfo.cs" />
<Compile Include="Config\ConfigAttributes.cs" />
<Compile Include="Config\AviRecordInfo.cs" />
@ -385,6 +386,12 @@
<Compile Include="Debugger\Controls\ctrlCodeScrollbar.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Debugger\Controls\ctrlDbgShortcuts.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Debugger\Controls\ctrlDbgShortcuts.Designer.cs">
<DependentUpon>ctrlDbgShortcuts.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\Controls\ctrlFlagStatus.cs">
<SubType>UserControl</SubType>
</Compile>
@ -586,6 +593,12 @@
<Compile Include="Debugger\frmAssembler.Designer.cs">
<DependentUpon>frmAssembler.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\frmDbgPreferences.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Debugger\frmDbgPreferences.Designer.cs">
<DependentUpon>frmDbgPreferences.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\frmEventViewerColors.cs">
<SubType>Form</SubType>
</Compile>
@ -604,6 +617,12 @@
<Compile Include="Debugger\frmEventViewer.Designer.cs">
<DependentUpon>frmEventViewer.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\frmDbgShortcutGetKey.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Debugger\frmDbgShortcutGetKey.Designer.cs">
<DependentUpon>frmDbgShortcutGetKey.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\frmOpCodeTooltip.cs">
<SubType>Form</SubType>
</Compile>
@ -1148,6 +1167,9 @@
<EmbeddedResource Include="Debugger\Controls\ApuViewer\ctrlSquareInfo.resx">
<DependentUpon>ctrlSquareInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\Controls\ctrlDbgShortcuts.resx">
<DependentUpon>ctrlDbgShortcuts.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\Controls\ctrlFlagStatus.resx">
<DependentUpon>ctrlFlagStatus.cs</DependentUpon>
</EmbeddedResource>
@ -1270,6 +1292,9 @@
<EmbeddedResource Include="Debugger\frmAssembler.resx">
<DependentUpon>frmAssembler.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\frmDbgPreferences.resx">
<DependentUpon>frmDbgPreferences.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\frmEventViewerColors.resx">
<DependentUpon>frmEventViewerColors.cs</DependentUpon>
</EmbeddedResource>
@ -1279,6 +1304,9 @@
<EmbeddedResource Include="Debugger\frmEventViewer.resx">
<DependentUpon>frmEventViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\frmDbgShortcutGetKey.resx">
<DependentUpon>frmDbgShortcutGetKey.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\frmOpCodeTooltip.resx">
<DependentUpon>frmOpCodeTooltip.cs</DependentUpon>
</EmbeddedResource>

View file

@ -1761,7 +1761,10 @@ namespace Mesen.GUI
LoadStateFromFile,
OpenFile,
OpenDebugger,
//Deprecated shortcuts
OpenDebugger = 0xFFFF,
OpenAssembler,
OpenPpuViewer,
OpenMemoryTools,