Debugger - convert to IToolFormAutoConfig
This commit is contained in:
parent
b8be890343
commit
67d03c12c7
|
@ -538,10 +538,6 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public BindingCollection HotkeyBindings = new BindingCollection();
|
public BindingCollection HotkeyBindings = new BindingCollection();
|
||||||
|
|
||||||
// Generic Debugger
|
|
||||||
public ToolDialogSettings GenericDebuggerSettings = new ToolDialogSettings();
|
|
||||||
public bool GenericDebuggerAutoload = false;
|
|
||||||
|
|
||||||
// Analog Hotkey values
|
// Analog Hotkey values
|
||||||
public int Analog_LargeChange = 10;
|
public int Analog_LargeChange = 10;
|
||||||
public int Analog_SmallChange = 1;
|
public int Analog_SmallChange = 1;
|
||||||
|
|
|
@ -407,11 +407,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GlobalWin.Tools.Load<SNESGraphicsDebugger>();
|
GlobalWin.Tools.Load<SNESGraphicsDebugger>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Global.Config.GenericDebuggerAutoload)
|
|
||||||
{
|
|
||||||
GlobalWin.Tools.Load<GenericDebugger>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Global.Config.DisplayStatusBar == false)
|
if (Global.Config.DisplayStatusBar == false)
|
||||||
{
|
{
|
||||||
MainStatusBar.Visible = false;
|
MainStatusBar.Visible = false;
|
||||||
|
|
|
@ -37,13 +37,6 @@
|
||||||
this.StepIntoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.StepIntoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.StepOverMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.StepOverMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.StepOutMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.StepOutMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.OptionsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.AutoloadMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
|
||||||
this.RestoreDefaultsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.RegistersGroupBox = new System.Windows.Forms.GroupBox();
|
this.RegistersGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
this.RegisterPanel = new BizHawk.Client.EmuHawk.RegisterBoxControl();
|
this.RegisterPanel = new BizHawk.Client.EmuHawk.RegisterBoxControl();
|
||||||
this.BreakpointsGroupBox = new System.Windows.Forms.GroupBox();
|
this.BreakpointsGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
|
@ -68,8 +61,7 @@
|
||||||
this.menuStrip1.ClickThrough = true;
|
this.menuStrip1.ClickThrough = true;
|
||||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.fileToolStripMenuItem,
|
this.fileToolStripMenuItem,
|
||||||
this.DebugSubMenu,
|
this.DebugSubMenu});
|
||||||
this.OptionsSubMenu});
|
|
||||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||||
this.menuStrip1.Name = "menuStrip1";
|
this.menuStrip1.Name = "menuStrip1";
|
||||||
this.menuStrip1.Size = new System.Drawing.Size(767, 24);
|
this.menuStrip1.Size = new System.Drawing.Size(767, 24);
|
||||||
|
@ -88,7 +80,7 @@
|
||||||
//
|
//
|
||||||
this.ExitMenuItem.Name = "ExitMenuItem";
|
this.ExitMenuItem.Name = "ExitMenuItem";
|
||||||
this.ExitMenuItem.ShortcutKeyDisplayString = "Alt+F4";
|
this.ExitMenuItem.ShortcutKeyDisplayString = "Alt+F4";
|
||||||
this.ExitMenuItem.Size = new System.Drawing.Size(145, 22);
|
this.ExitMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||||
this.ExitMenuItem.Text = "&Close";
|
this.ExitMenuItem.Text = "&Close";
|
||||||
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
|
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
@ -130,60 +122,6 @@
|
||||||
this.StepOutMenuItem.Text = "Step Ou&t";
|
this.StepOutMenuItem.Text = "Step Ou&t";
|
||||||
this.StepOutMenuItem.Click += new System.EventHandler(this.StepOutMenuItem_Click);
|
this.StepOutMenuItem.Click += new System.EventHandler(this.StepOutMenuItem_Click);
|
||||||
//
|
//
|
||||||
// OptionsSubMenu
|
|
||||||
//
|
|
||||||
this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
|
||||||
this.AutoloadMenuItem,
|
|
||||||
this.SaveWindowPositionMenuItem,
|
|
||||||
this.AlwaysOnTopMenuItem,
|
|
||||||
this.FloatingWindowMenuItem,
|
|
||||||
this.toolStripSeparator1,
|
|
||||||
this.RestoreDefaultsMenuItem});
|
|
||||||
this.OptionsSubMenu.Name = "OptionsSubMenu";
|
|
||||||
this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20);
|
|
||||||
this.OptionsSubMenu.Text = "&Options";
|
|
||||||
this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened);
|
|
||||||
//
|
|
||||||
// AutoloadMenuItem
|
|
||||||
//
|
|
||||||
this.AutoloadMenuItem.Name = "AutoloadMenuItem";
|
|
||||||
this.AutoloadMenuItem.Size = new System.Drawing.Size(191, 22);
|
|
||||||
this.AutoloadMenuItem.Text = "Autoload";
|
|
||||||
this.AutoloadMenuItem.Click += new System.EventHandler(this.AutoloadMenuItem_Click);
|
|
||||||
//
|
|
||||||
// SaveWindowPositionMenuItem
|
|
||||||
//
|
|
||||||
this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem";
|
|
||||||
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(191, 22);
|
|
||||||
this.SaveWindowPositionMenuItem.Text = "Save Window Position";
|
|
||||||
this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click);
|
|
||||||
//
|
|
||||||
// AlwaysOnTopMenuItem
|
|
||||||
//
|
|
||||||
this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
|
|
||||||
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(191, 22);
|
|
||||||
this.AlwaysOnTopMenuItem.Text = "Always On Top";
|
|
||||||
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
|
|
||||||
//
|
|
||||||
// FloatingWindowMenuItem
|
|
||||||
//
|
|
||||||
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
|
|
||||||
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(191, 22);
|
|
||||||
this.FloatingWindowMenuItem.Text = "Floating Window";
|
|
||||||
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
|
|
||||||
//
|
|
||||||
// toolStripSeparator1
|
|
||||||
//
|
|
||||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
|
||||||
this.toolStripSeparator1.Size = new System.Drawing.Size(188, 6);
|
|
||||||
//
|
|
||||||
// RestoreDefaultsMenuItem
|
|
||||||
//
|
|
||||||
this.RestoreDefaultsMenuItem.Name = "RestoreDefaultsMenuItem";
|
|
||||||
this.RestoreDefaultsMenuItem.Size = new System.Drawing.Size(191, 22);
|
|
||||||
this.RestoreDefaultsMenuItem.Text = "Restore Defaults";
|
|
||||||
this.RestoreDefaultsMenuItem.Click += new System.EventHandler(this.RestoreDefaultsMenuItem_Click);
|
|
||||||
//
|
|
||||||
// RegistersGroupBox
|
// RegistersGroupBox
|
||||||
//
|
//
|
||||||
this.RegistersGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.RegistersGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
@ -230,6 +168,7 @@
|
||||||
this.BreakPointControl1.Core = null;
|
this.BreakPointControl1.Core = null;
|
||||||
this.BreakPointControl1.Location = new System.Drawing.Point(8, 19);
|
this.BreakPointControl1.Location = new System.Drawing.Point(8, 19);
|
||||||
this.BreakPointControl1.MCS = null;
|
this.BreakPointControl1.MCS = null;
|
||||||
|
this.BreakPointControl1.MemoryDomains = null;
|
||||||
this.BreakPointControl1.Name = "BreakPointControl1";
|
this.BreakPointControl1.Name = "BreakPointControl1";
|
||||||
this.BreakPointControl1.ParentDebugger = null;
|
this.BreakPointControl1.ParentDebugger = null;
|
||||||
this.BreakPointControl1.Size = new System.Drawing.Size(225, 256);
|
this.BreakPointControl1.Size = new System.Drawing.Size(225, 256);
|
||||||
|
@ -360,13 +299,6 @@
|
||||||
private MenuStripEx menuStrip1;
|
private MenuStripEx menuStrip1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem OptionsSubMenu;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem AutoloadMenuItem;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem SaveWindowPositionMenuItem;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem AlwaysOnTopMenuItem;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
|
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem RestoreDefaultsMenuItem;
|
|
||||||
private System.Windows.Forms.GroupBox RegistersGroupBox;
|
private System.Windows.Forms.GroupBox RegistersGroupBox;
|
||||||
private RegisterBoxControl RegisterPanel;
|
private RegisterBoxControl RegisterPanel;
|
||||||
private System.Windows.Forms.GroupBox BreakpointsGroupBox;
|
private System.Windows.Forms.GroupBox BreakpointsGroupBox;
|
||||||
|
|
|
@ -14,7 +14,7 @@ using BizHawk.Client.Common;
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
[ToolAttributes(released: false)]
|
[ToolAttributes(released: false)]
|
||||||
public partial class GenericDebugger : Form, IToolForm, IControlMainform
|
public partial class GenericDebugger : Form, IToolFormAutoConfig, IControlMainform
|
||||||
{
|
{
|
||||||
private int _defaultWidth;
|
private int _defaultWidth;
|
||||||
private int _defaultHeight;
|
private int _defaultHeight;
|
||||||
|
@ -22,7 +22,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public GenericDebugger()
|
public GenericDebugger()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
TopMost = Global.Config.GenericDebuggerSettings.TopMost;
|
|
||||||
Closing += (o, e) => DisengageDebugger();
|
Closing += (o, e) => DisengageDebugger();
|
||||||
|
|
||||||
DisassemblerView.QueryItemText += DisassemblerView_QueryItemText;
|
DisassemblerView.QueryItemText += DisassemblerView_QueryItemText;
|
||||||
|
@ -37,16 +36,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_defaultWidth = Size.Width;
|
_defaultWidth = Size.Width;
|
||||||
_defaultHeight = Size.Height;
|
_defaultHeight = Size.Height;
|
||||||
|
|
||||||
if (Global.Config.GenericDebuggerSettings.UseWindowPosition)
|
|
||||||
{
|
|
||||||
Location = Global.Config.GenericDebuggerSettings.WindowPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Global.Config.GenericDebuggerSettings.UseWindowSize)
|
|
||||||
{
|
|
||||||
Size = Global.Config.GenericDebuggerSettings.WindowSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
EngageDebugger();
|
EngageDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +138,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void DisengageDebugger()
|
private void DisengageDebugger()
|
||||||
{
|
{
|
||||||
SaveConfigSettings();
|
|
||||||
if (Debuggable.Tracer != null)
|
if (Debuggable.Tracer != null)
|
||||||
{
|
{
|
||||||
Debuggable.Tracer.Enabled = false;
|
Debuggable.Tracer.Enabled = false;
|
||||||
|
@ -158,17 +146,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
BreakPointControl1.Shutdown();
|
BreakPointControl1.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveConfigSettings()
|
|
||||||
{
|
|
||||||
if (Global.Config.GenericDebuggerSettings.SaveWindowPosition)
|
|
||||||
{
|
|
||||||
Global.Config.GenericDebuggerSettings.Wndx = Location.X;
|
|
||||||
Global.Config.GenericDebuggerSettings.Wndy = Location.Y;
|
|
||||||
Global.Config.GenericDebuggerSettings.Width = Right - Left;
|
|
||||||
Global.Config.GenericDebuggerSettings.Height = Bottom - Top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnShown(EventArgs e)
|
protected override void OnShown(EventArgs e)
|
||||||
{
|
{
|
||||||
RefreshFloatingWindowControl();
|
RefreshFloatingWindowControl();
|
||||||
|
@ -180,8 +157,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Owner = Global.Config.RamSearchSettings.FloatingWindow ? null : GlobalWin.MainForm;
|
Owner = Global.Config.RamSearchSettings.FloatingWindow ? null : GlobalWin.MainForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Menu Items
|
|
||||||
|
|
||||||
#region File
|
#region File
|
||||||
|
|
||||||
private void ExitMenuItem_Click(object sender, EventArgs e)
|
private void ExitMenuItem_Click(object sender, EventArgs e)
|
||||||
|
@ -227,49 +202,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Options
|
|
||||||
|
|
||||||
private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
AutoloadMenuItem.Checked = Global.Config.GenericDebuggerAutoload;
|
|
||||||
SaveWindowPositionMenuItem.Checked = Global.Config.GenericDebuggerSettings.SaveWindowPosition;
|
|
||||||
AlwaysOnTopMenuItem.Checked = Global.Config.GenericDebuggerSettings.TopMost;
|
|
||||||
FloatingWindowMenuItem.Checked = Global.Config.GenericDebuggerSettings.FloatingWindow;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AutoloadMenuItem_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Global.Config.GenericDebuggerAutoload ^= true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Global.Config.GenericDebuggerSettings.SaveWindowPosition ^= true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
TopMost = Global.Config.GenericDebuggerSettings.TopMost ^= true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FloatingWindowMenuItem_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Global.Config.GenericDebuggerSettings.FloatingWindow ^= true;
|
|
||||||
RefreshFloatingWindowControl();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RestoreDefaultsMenuItem_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Size = new Size(_defaultWidth, _defaultHeight);
|
|
||||||
Global.Config.GenericDebuggerSettings = new ToolDialogSettings();
|
|
||||||
TopMost = Global.Config.GenericDebuggerSettings.TopMost;
|
|
||||||
RefreshFloatingWindowControl();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||||
{
|
{
|
||||||
if (keyData == Keys.F11)
|
if (keyData == Keys.F11)
|
||||||
|
|
Loading…
Reference in New Issue