From 4a96e58a24d48dc382f02c19667caf4785eaa24a Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 6 Dec 2014 00:03:36 +0000 Subject: [PATCH] Start a generic Debugger tool, does nothing now except for open and have the standard ui options all tool forms have (such as autoload) --- BizHawk.Client.Common/config/Config.cs | 4 + .../BizHawk.Client.EmuHawk.csproj | 16 ++ BizHawk.Client.EmuHawk/MainForm.Designer.cs | 39 +++-- BizHawk.Client.EmuHawk/MainForm.Events.cs | 10 +- BizHawk.Client.EmuHawk/MainForm.cs | 6 +- .../Debugger/GenericDebugger.Designer.cs | 158 ++++++++++++++++++ .../GenericDebugger.IControlMainform.cs | 26 +++ .../Debugger/GenericDebugger.IToolForm.cs | 31 ++++ .../tools/Debugger/GenericDebugger.cs | 115 +++++++++++++ .../tools/Debugger/GenericDebugger.resx | 148 ++++++++++++++++ 10 files changed, 537 insertions(+), 16 deletions(-) create mode 100644 BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs create mode 100644 BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs create mode 100644 BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs create mode 100644 BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs create mode 100644 BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.resx diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 3f644e3694..e10d6738d1 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -581,6 +581,10 @@ namespace BizHawk.Client.Common public ToolDialogSettings Atari2600DebuggerSettings = new ToolDialogSettings(); public bool Atari2600DebuggerAutoload = false; + // Generic Debugger + public ToolDialogSettings GenericDebuggerSettings = new ToolDialogSettings(); + public bool GenericDebuggerAutoload = false; + // Analog Hotkey values public int Analog_LargeChange = 10; public int Analog_SmallChange = 1; diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index ab0d2a15db..9bc0e25a96 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -636,6 +636,19 @@ Cheats.cs + + Form + + + GenericDebugger.cs + + + Form + + + GenericDebugger.cs + Form + Form @@ -1208,6 +1221,9 @@ Cheats.cs + + GenericDebugger.cs + GBAGPUView.cs diff --git a/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/BizHawk.Client.EmuHawk/MainForm.Designer.cs index 28bfe8cef0..b728a8abfb 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -182,13 +182,14 @@ this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); this.SaveConfigMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.LoadConfigMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ToolsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.ToolBoxMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.RamWatchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.RamSearchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.HexEditorMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TraceLoggerMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.DebuggerMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TAStudioMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.VirtualPadMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); @@ -388,7 +389,7 @@ this.EmulationSubMenu, this.ViewSubMenu, this.ConfigSubMenu, - this.toolsToolStripMenuItem, + this.ToolsSubMenu, this.NESSubMenu, this.PCESubMenu, this.SMSSubMenu, @@ -1716,15 +1717,16 @@ this.LoadConfigMenuItem.Text = "Load Config"; this.LoadConfigMenuItem.Click += new System.EventHandler(this.LoadConfigMenuItem_Click); // - // toolsToolStripMenuItem + // ToolsSubMenu // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ToolsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ToolBoxMenuItem, this.toolStripSeparator12, this.RamWatchMenuItem, this.RamSearchMenuItem, this.HexEditorMenuItem, this.TraceLoggerMenuItem, + this.DebuggerMenuItem, this.TAStudioMenuItem, this.VirtualPadMenuItem, this.toolStripSeparator11, @@ -1733,10 +1735,10 @@ this.toolStripSeparator29, this.CreateDualGbXmlMenuItem, this.batchRunnerToolStripMenuItem}); - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(48, 19); - this.toolsToolStripMenuItem.Text = "&Tools"; - this.toolsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.toolsToolStripMenuItem_DropDownOpened); + this.ToolsSubMenu.Name = "ToolsSubMenu"; + this.ToolsSubMenu.Size = new System.Drawing.Size(48, 19); + this.ToolsSubMenu.Text = "&Tools"; + this.ToolsSubMenu.DropDownOpened += new System.EventHandler(this.ToolsSubMenu_DropDownOpened); // // ToolBoxMenuItem // @@ -1783,6 +1785,14 @@ this.TraceLoggerMenuItem.Text = "Trace &Logger"; this.TraceLoggerMenuItem.Click += new System.EventHandler(this.TraceLoggerMenuItem_Click); // + // DebuggerMenuItem + // + this.DebuggerMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Bug; + this.DebuggerMenuItem.Name = "DebuggerMenuItem"; + this.DebuggerMenuItem.Size = new System.Drawing.Size(183, 22); + this.DebuggerMenuItem.Text = "&Debugger"; + this.DebuggerMenuItem.Click += new System.EventHandler(this.DebuggerMenuItem_Click); + // // TAStudioMenuItem // this.TAStudioMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.TAStudio; @@ -2637,7 +2647,7 @@ // settingsToolStripMenuItem // this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; - this.settingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.settingsToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.settingsToolStripMenuItem.Text = "&Settings..."; this.settingsToolStripMenuItem.Click += new System.EventHandler(this.WondersawnSettingsMenuItem_Click); // @@ -2657,7 +2667,7 @@ // this.OnlineHelpMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Help; this.OnlineHelpMenuItem.Name = "OnlineHelpMenuItem"; - this.OnlineHelpMenuItem.Size = new System.Drawing.Size(152, 22); + this.OnlineHelpMenuItem.Size = new System.Drawing.Size(146, 22); this.OnlineHelpMenuItem.Text = "&Online Help..."; this.OnlineHelpMenuItem.Click += new System.EventHandler(this.OnlineHelpMenuItem_Click); // @@ -2665,14 +2675,14 @@ // this.ForumsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.TAStudio; this.ForumsMenuItem.Name = "ForumsMenuItem"; - this.ForumsMenuItem.Size = new System.Drawing.Size(152, 22); + this.ForumsMenuItem.Size = new System.Drawing.Size(146, 22); this.ForumsMenuItem.Text = "Forums..."; this.ForumsMenuItem.Click += new System.EventHandler(this.ForumsMenuItem_Click); // // FeaturesMenuItem // this.FeaturesMenuItem.Name = "FeaturesMenuItem"; - this.FeaturesMenuItem.Size = new System.Drawing.Size(152, 22); + this.FeaturesMenuItem.Size = new System.Drawing.Size(146, 22); this.FeaturesMenuItem.Text = "&Features"; this.FeaturesMenuItem.Click += new System.EventHandler(this.FeaturesMenuItem_Click); // @@ -2680,7 +2690,7 @@ // this.AboutMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CorpHawkSmall; this.AboutMenuItem.Name = "AboutMenuItem"; - this.AboutMenuItem.Size = new System.Drawing.Size(152, 22); + this.AboutMenuItem.Size = new System.Drawing.Size(146, 22); this.AboutMenuItem.Text = "&About"; this.AboutMenuItem.Click += new System.EventHandler(this.AboutMenuItem_Click); // @@ -3358,7 +3368,7 @@ private System.Windows.Forms.ToolStripMenuItem EmulationSubMenu; private System.Windows.Forms.ToolStripMenuItem ViewSubMenu; private System.Windows.Forms.ToolStripMenuItem ConfigSubMenu; - private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem ToolsSubMenu; private System.Windows.Forms.ToolStripMenuItem HelpSubMenu; private System.Windows.Forms.ToolStripMenuItem PauseMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; @@ -3684,6 +3694,7 @@ private System.Windows.Forms.ToolStripMenuItem N64ExpansionSlotMenuItem; private System.Windows.Forms.ToolStripMenuItem barcodeReaderToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem FeaturesMenuItem; + private System.Windows.Forms.ToolStripMenuItem DebuggerMenuItem; } } diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index dd40682153..408dc49408 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1092,7 +1092,7 @@ namespace BizHawk.Client.EmuHawk #region Tools - private void toolsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + private void ToolsSubMenu_DropDownOpened(object sender, EventArgs e) { ToolBoxMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["ToolBox"].Bindings; RamWatchMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Ram Watch"].Bindings; @@ -1113,6 +1113,9 @@ namespace BizHawk.Client.EmuHawk RamWatchMenuItem.Enabled = Global.Emulator.HasMemoryDomains(); + DebuggerMenuItem.Visible = VersionInfo.DeveloperBuild; + DebuggerMenuItem.Enabled = Global.Emulator.CanDebug(); + batchRunnerToolStripMenuItem.Visible = VersionInfo.DeveloperBuild; } @@ -1141,6 +1144,11 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Tools.LoadTraceLogger(); } + private void DebuggerMenuItem_Click(object sender, EventArgs e) + { + GlobalWin.Tools.Load(); + } + private void TAStudioMenuItem_Click(object sender, EventArgs e) { GlobalWin.Tools.Load(); diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index e23b609ac2..6dc85b7b4a 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -454,6 +454,11 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Tools.LoadTraceLogger(); } + if (Global.Config.GenericDebuggerAutoload && Global.Emulator.CanDebug()) + { + GlobalWin.Tools.Load(); + } + if (Global.Config.Atari2600DebuggerAutoload && Global.Emulator is Atari2600) { GlobalWin.Tools.Load(); @@ -3682,6 +3687,5 @@ namespace BizHawk.Client.EmuHawk { FeaturesMenuItem.Visible = VersionInfo.DeveloperBuild; } - } } diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs new file mode 100644 index 0000000000..8f8b741931 --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs @@ -0,0 +1,158 @@ +namespace BizHawk.Client.EmuHawk +{ + partial class GenericDebugger + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GenericDebugger)); + this.menuStrip1 = new MenuStripEx(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ExitMenuItem = 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.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.OptionsSubMenu}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(638, 24); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ExitMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // ExitMenuItem + // + this.ExitMenuItem.Name = "ExitMenuItem"; + this.ExitMenuItem.ShortcutKeyDisplayString = "Alt+F4"; + this.ExitMenuItem.Size = new System.Drawing.Size(152, 22); + this.ExitMenuItem.Text = "&Close"; + this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_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); + // + // GenericDebugger + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(638, 560); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MainMenuStrip = this.menuStrip1; + this.Name = "GenericDebugger"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Debugger"; + this.Load += new System.EventHandler(this.GenericDebugger_Load); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private MenuStripEx menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + 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; + } +} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs new file mode 100644 index 0000000000..e7a947045e --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IControlMainform.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BizHawk.Client.EmuHawk +{ + public partial class GenericDebugger : IControlMainform + { + public bool WantsToControlReadOnly { get { return false; } } + public void ToggleReadOnly() { } + + public bool WantsToControlStopMovie { get { return false; } } + public void StopMovie(bool supressSave) { } + + // TODO: We probably want to do this + public bool WantsToControlRewind { get { return false; } } + public void CaptureRewind() { } + public bool Rewind() { return false; } + + public bool WantsToControlRestartMovie { get { return false; } } + public void RestartMovie() { } + + // TODO: We want to prevent movies and probably other things + } +} diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs new file mode 100644 index 0000000000..a79034eee2 --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.IToolForm.cs @@ -0,0 +1,31 @@ +namespace BizHawk.Client.EmuHawk +{ + public partial class GenericDebugger : IToolForm + { + public void UpdateValues() + { + // TODO + } + + public void FastUpdate() + { + // TODO + } + + public void Restart() + { + // TODO + } + + public bool AskSaveChanges() + { + // TODO + return true; + } + + public bool UpdateBefore + { + get { return false; } + } + } +} diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs new file mode 100644 index 0000000000..2657be065e --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +using BizHawk.Client.Common; + +namespace BizHawk.Client.EmuHawk +{ + public partial class GenericDebugger : Form, IToolForm, IControlMainform + { + private int _defaultWidth; + private int _defaultHeight; + + public GenericDebugger() + { + InitializeComponent(); + TopMost = Global.Config.GenericDebuggerSettings.TopMost; + Closing += (o, e) => Shutdown(); + } + + private void GenericDebugger_Load(object sender, EventArgs e) + { + _defaultWidth = Size.Width; + _defaultHeight = Size.Height; + + if (Global.Config.GenericDebuggerSettings.UseWindowPosition) + { + Location = Global.Config.GenericDebuggerSettings.WindowPosition; + } + + if (Global.Config.GenericDebuggerSettings.UseWindowSize) + { + Size = Global.Config.GenericDebuggerSettings.WindowSize; + } + } + + private void Shutdown() + { + SaveConfigSettings(); + } + + 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) + { + RefreshFloatingWindowControl(); + base.OnShown(e); + } + + private void RefreshFloatingWindowControl() + { + Owner = Global.Config.RamSearchSettings.FloatingWindow ? null : GlobalWin.MainForm; + } + + #region Menu Items + + private void ExitMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + 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 + } +} diff --git a/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.resx b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.resx new file mode 100644 index 0000000000..20de0324f7 --- /dev/null +++ b/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAABMLAAATCwAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAEpWMf/m5ub/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPUgo/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADJBI/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAEpWMf8AAAAAAAAAAAAAAAAyOSD/eWId/3hjHf95Yx3/eWId/wAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARU4t/wAAAAB5ZR//eWUg/4fJpv+Bx5//ecKV/yt8 + Ov94ZB//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADlFKP8AAAAAeWch/5zSuP+Z0rX/kc6u/zyN + U/95w5b/emYi/wAAAAAAAAAASk4x/wAAAAAAAAAAAAAAAAAAAAAyPiP/emgk/67cxv+038v/rtvH/1in + c/+Rzq//gcef/3poJP8yOSD/PU4t/wAAAAAAAAAAAAAAAAAAAABFTjH/OUUo/3tqJ//C59X/zOvb/3/B + kv+u28b/mdK2/4fJpv96ayf/AAAAAAAAAAAAAAAAAAAAAFNWOP9TVjj/AAAAAAAAAAB7bSr/zOrb/9vz + 5//M69v/tN/L/53SuP98bSr/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAr9zH/yJq + Lv/M69v/wubV/67cxv97byz/AAAAAAAAAAA9Ti3/SlYx/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANvz + 5/+v28f/fHAt/3xwLf98cC3/8vLy/zI5IP85QSj/AAAAAAAAAAAAAAAAAAAAAEpWMf9KTjH/RU4t/z1I + KP98cC3/fHAt//Pz8/85RSj/8/Pz/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAPUgt/wAAAAAAAAAAAAAAAEVOMf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAEpOMf8AAAAAAAAAAAAAAABTVjj/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAABOVjj/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA+f8AAP3/AAD9/wAA3B8AAOgPAADoDQAA4AMAAMAPAAAwHwAA8DMAAPAPAAAAfwAA938AAPd/ + AAD3/////////w== + + + \ No newline at end of file