From 4aab2ea31d1e32892024bdd3109944fa8471d00e Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 31 Jan 2014 20:49:38 +0000 Subject: [PATCH] NES Game Genie dialog - implement Always on Top and Floating Window + refactor --- BizHawk.Client.Common/config/Config.cs | 4 +- .../tools/NES/NESGameGenie.Designer.cs | 968 +++++++++--------- .../tools/NES/NESGameGenie.cs | 95 +- 3 files changed, 555 insertions(+), 512 deletions(-) diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index b98ad6160b..73898b4ede 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -469,10 +469,8 @@ namespace BizHawk.Client.Common public bool VirtualPadSticky = true; // NES Game Genie Encoder/Decoder + public ToolDialogSettings NesGGSettings = new ToolDialogSettings(); public bool NESGGAutoload = false; - public bool NESGGSaveWindowPosition = true; - public int NESGGWndx = -1; - public int NESGGWndy = -1; // SNES Game Genie Encoder/Decoder public bool SNESGGAutoload = false; diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs index 1e536005b4..fe0eb8d76f 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs @@ -28,485 +28,503 @@ /// private void InitializeComponent() { - this.GameGenieCode = new System.Windows.Forms.TextBox(); - this.GameGenieCodeBox = new System.Windows.Forms.GroupBox(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.CompareBox = new BizHawk.Client.EmuHawk.HexTextBox(); - this.ValueBox = new BizHawk.Client.EmuHawk.HexTextBox(); - this.AddressBox = new BizHawk.Client.EmuHawk.HexTextBox(); - this.AddCheat = new System.Windows.Forms.Button(); - this.ButtonPanel = new System.Windows.Forms.Panel(); - this.N = new System.Windows.Forms.Button(); - this.V = new System.Windows.Forms.Button(); - this.S = new System.Windows.Forms.Button(); - this.K = new System.Windows.Forms.Button(); - this.U = new System.Windows.Forms.Button(); - this.X = new System.Windows.Forms.Button(); - this.O = new System.Windows.Forms.Button(); - this.Y = new System.Windows.Forms.Button(); - this.L = new System.Windows.Forms.Button(); - this.E = new System.Windows.Forms.Button(); - this.T = new System.Windows.Forms.Button(); - this.I = new System.Windows.Forms.Button(); - this.G = new System.Windows.Forms.Button(); - this.Z = new System.Windows.Forms.Button(); - this.P = new System.Windows.Forms.Button(); - this.A = new System.Windows.Forms.Button(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.Encoding = new System.Windows.Forms.CheckBox(); - this.ClearButton = new System.Windows.Forms.Button(); - this.MenuStrip = new MenuStripEx(); - this.OptionsSubMenu = new System.Windows.Forms.ToolStripMenuItem(); - this.AutoloadMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.GameGenieCodeBox.SuspendLayout(); - this.ButtonPanel.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.MenuStrip.SuspendLayout(); - this.SuspendLayout(); - // - // GameGenieCode - // - this.GameGenieCode.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.GameGenieCode.Location = new System.Drawing.Point(6, 19); - this.GameGenieCode.MaxLength = 8; - this.GameGenieCode.Name = "GameGenieCode"; - this.GameGenieCode.Size = new System.Drawing.Size(102, 20); - this.GameGenieCode.TabIndex = 20; - this.GameGenieCode.TextChanged += new System.EventHandler(this.GameGenieCode_TextChanged); - this.GameGenieCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GameGenieCode_KeyDown); - this.GameGenieCode.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.GameGenieCode_KeyPress); - // - // GameGenieCodeBox - // - this.GameGenieCodeBox.Controls.Add(this.GameGenieCode); - this.GameGenieCodeBox.Location = new System.Drawing.Point(31, 103); - this.GameGenieCodeBox.Name = "GameGenieCodeBox"; - this.GameGenieCodeBox.Size = new System.Drawing.Size(119, 54); - this.GameGenieCodeBox.TabIndex = 1; - this.GameGenieCodeBox.TabStop = false; - this.GameGenieCodeBox.Text = "Game Genie Code"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(8, 68); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(34, 13); - this.label3.TabIndex = 5; - this.label3.Text = "Value"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(8, 42); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(49, 13); - this.label2.TabIndex = 4; - this.label2.Text = "Compare"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(8, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(45, 13); - this.label1.TabIndex = 3; - this.label1.Text = "Address"; - // - // CompareBox - // - this.CompareBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.CompareBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.CompareBox.Location = new System.Drawing.Point(88, 39); - this.CompareBox.MaxLength = 2; - this.CompareBox.Name = "CompareBox"; - this.CompareBox.Nullable = true; - this.CompareBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.CompareBox.Size = new System.Drawing.Size(20, 20); - this.CompareBox.TabIndex = 22; - this.CompareBox.TextChanged += new System.EventHandler(this.CompareBox_TextChanged); - // - // ValueBox - // - this.ValueBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.ValueBox.Location = new System.Drawing.Point(88, 65); - this.ValueBox.MaxLength = 2; - this.ValueBox.Name = "ValueBox"; - this.ValueBox.Nullable = true; - this.ValueBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.ValueBox.Size = new System.Drawing.Size(20, 20); - this.ValueBox.TabIndex = 23; - this.ValueBox.TextChanged += new System.EventHandler(this.ValueBox_TextChanged); - // - // AddressBox - // - this.AddressBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.AddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; - this.AddressBox.Location = new System.Drawing.Point(76, 13); - this.AddressBox.MaxLength = 4; - this.AddressBox.Name = "AddressBox"; - this.AddressBox.Nullable = true; - this.AddressBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.AddressBox.Size = new System.Drawing.Size(32, 20); - this.AddressBox.TabIndex = 21; - this.AddressBox.TextChanged += new System.EventHandler(this.AddressBox_TextChanged); - // - // AddCheat - // - this.AddCheat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.AddCheat.Location = new System.Drawing.Point(202, 230); - this.AddCheat.Name = "AddCheat"; - this.AddCheat.Size = new System.Drawing.Size(69, 21); - this.AddCheat.TabIndex = 33; - this.AddCheat.Text = "&Add Cheat"; - this.AddCheat.UseVisualStyleBackColor = true; - this.AddCheat.Click += new System.EventHandler(this.AddCheat_Click); - // - // ButtonPanel - // - this.ButtonPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.ButtonPanel.Controls.Add(this.N); - this.ButtonPanel.Controls.Add(this.V); - this.ButtonPanel.Controls.Add(this.S); - this.ButtonPanel.Controls.Add(this.K); - this.ButtonPanel.Controls.Add(this.U); - this.ButtonPanel.Controls.Add(this.X); - this.ButtonPanel.Controls.Add(this.O); - this.ButtonPanel.Controls.Add(this.Y); - this.ButtonPanel.Controls.Add(this.L); - this.ButtonPanel.Controls.Add(this.E); - this.ButtonPanel.Controls.Add(this.T); - this.ButtonPanel.Controls.Add(this.I); - this.ButtonPanel.Controls.Add(this.G); - this.ButtonPanel.Controls.Add(this.Z); - this.ButtonPanel.Controls.Add(this.P); - this.ButtonPanel.Controls.Add(this.A); - this.ButtonPanel.Location = new System.Drawing.Point(31, 30); - this.ButtonPanel.Name = "ButtonPanel"; - this.ButtonPanel.Size = new System.Drawing.Size(240, 67); - this.ButtonPanel.TabIndex = 4; - // - // N - // - this.N.Location = new System.Drawing.Point(206, 35); - this.N.Name = "N"; - this.N.Size = new System.Drawing.Size(26, 23); - this.N.TabIndex = 16; - this.N.Text = "N"; - this.N.UseVisualStyleBackColor = true; - this.N.Click += new System.EventHandler(this.Keypad_Click); - // - // V - // - this.V.Location = new System.Drawing.Point(149, 35); - this.V.Name = "V"; - this.V.Size = new System.Drawing.Size(26, 23); - this.V.TabIndex = 14; - this.V.Text = "V"; - this.V.UseVisualStyleBackColor = true; - this.V.Click += new System.EventHandler(this.Keypad_Click); - // - // S - // - this.S.Location = new System.Drawing.Point(91, 35); - this.S.Name = "S"; - this.S.Size = new System.Drawing.Size(26, 23); - this.S.TabIndex = 12; - this.S.Text = "S"; - this.S.UseVisualStyleBackColor = true; - this.S.Click += new System.EventHandler(this.Keypad_Click); - // - // K - // - this.K.Location = new System.Drawing.Point(34, 35); - this.K.Name = "K"; - this.K.Size = new System.Drawing.Size(26, 23); - this.K.TabIndex = 10; - this.K.Text = "K"; - this.K.UseVisualStyleBackColor = true; - this.K.Click += new System.EventHandler(this.Keypad_Click); - // - // U - // - this.U.Location = new System.Drawing.Point(206, 5); - this.U.Name = "U"; - this.U.Size = new System.Drawing.Size(26, 23); - this.U.TabIndex = 8; - this.U.Text = "U"; - this.U.UseVisualStyleBackColor = true; - this.U.Click += new System.EventHandler(this.Keypad_Click); - // - // X - // - this.X.Location = new System.Drawing.Point(149, 6); - this.X.Name = "X"; - this.X.Size = new System.Drawing.Size(26, 23); - this.X.TabIndex = 6; - this.X.Text = "X"; - this.X.UseVisualStyleBackColor = true; - this.X.Click += new System.EventHandler(this.Keypad_Click); - // - // O - // - this.O.Location = new System.Drawing.Point(91, 6); - this.O.Name = "O"; - this.O.Size = new System.Drawing.Size(26, 23); - this.O.TabIndex = 4; - this.O.Text = "O"; - this.O.UseVisualStyleBackColor = true; - this.O.Click += new System.EventHandler(this.Keypad_Click); - // - // Y - // - this.Y.Location = new System.Drawing.Point(178, 35); - this.Y.Name = "Y"; - this.Y.Size = new System.Drawing.Size(26, 23); - this.Y.TabIndex = 15; - this.Y.Text = "Y"; - this.Y.UseVisualStyleBackColor = true; - this.Y.Click += new System.EventHandler(this.Keypad_Click); - // - // L - // - this.L.Location = new System.Drawing.Point(178, 5); - this.L.Name = "L"; - this.L.Size = new System.Drawing.Size(26, 23); - this.L.TabIndex = 7; - this.L.Text = "L"; - this.L.UseVisualStyleBackColor = true; - this.L.Click += new System.EventHandler(this.Keypad_Click); - // - // E - // - this.E.Location = new System.Drawing.Point(34, 6); - this.E.Name = "E"; - this.E.Size = new System.Drawing.Size(26, 23); - this.E.TabIndex = 2; - this.E.Text = "E"; - this.E.UseVisualStyleBackColor = true; - this.E.Click += new System.EventHandler(this.Keypad_Click); - // - // T - // - this.T.Location = new System.Drawing.Point(121, 35); - this.T.Name = "T"; - this.T.Size = new System.Drawing.Size(26, 23); - this.T.TabIndex = 13; - this.T.Text = "T"; - this.T.UseVisualStyleBackColor = true; - this.T.Click += new System.EventHandler(this.Keypad_Click); - // - // I - // - this.I.Location = new System.Drawing.Point(63, 35); - this.I.Name = "I"; - this.I.Size = new System.Drawing.Size(26, 23); - this.I.TabIndex = 11; - this.I.Text = "I"; - this.I.UseVisualStyleBackColor = true; - this.I.Click += new System.EventHandler(this.Keypad_Click); - // - // G - // - this.G.Location = new System.Drawing.Point(6, 35); - this.G.Name = "G"; - this.G.Size = new System.Drawing.Size(26, 23); - this.G.TabIndex = 9; - this.G.Text = "G"; - this.G.UseVisualStyleBackColor = true; - this.G.Click += new System.EventHandler(this.Keypad_Click); - // - // Z - // - this.Z.Location = new System.Drawing.Point(121, 6); - this.Z.Name = "Z"; - this.Z.Size = new System.Drawing.Size(26, 23); - this.Z.TabIndex = 5; - this.Z.Text = "Z"; - this.Z.UseVisualStyleBackColor = true; - this.Z.Click += new System.EventHandler(this.Keypad_Click); - // - // P - // - this.P.Location = new System.Drawing.Point(63, 6); - this.P.Name = "P"; - this.P.Size = new System.Drawing.Size(26, 23); - this.P.TabIndex = 3; - this.P.Text = "P"; - this.P.UseVisualStyleBackColor = true; - this.P.Click += new System.EventHandler(this.Keypad_Click); - // - // A - // - this.A.Location = new System.Drawing.Point(6, 5); - this.A.Name = "A"; - this.A.Size = new System.Drawing.Size(26, 23); - this.A.TabIndex = 1; - this.A.Text = "A"; - this.A.UseVisualStyleBackColor = true; - this.A.Click += new System.EventHandler(this.Keypad_Click); - // - // groupBox1 - // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.groupBox1.Controls.Add(this.label6); - this.groupBox1.Controls.Add(this.label5); - this.groupBox1.Controls.Add(this.label4); - this.groupBox1.Controls.Add(this.label3); - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Controls.Add(this.label2); - this.groupBox1.Controls.Add(this.AddressBox); - this.groupBox1.Controls.Add(this.ValueBox); - this.groupBox1.Controls.Add(this.CompareBox); - this.groupBox1.Location = new System.Drawing.Point(31, 158); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(119, 93); - this.groupBox1.TabIndex = 5; - this.groupBox1.TabStop = false; - // - // label6 - // - this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(70, 69); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(18, 13); - this.label6.TabIndex = 9; - this.label6.Text = "0x"; - // - // label5 - // - this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(70, 42); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(18, 13); - this.label5.TabIndex = 8; - this.label5.Text = "0x"; - // - // label4 - // - this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(58, 16); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(18, 13); - this.label4.TabIndex = 7; - this.label4.Text = "0x"; - // - // Encoding - // - this.Encoding.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.Encoding.Appearance = System.Windows.Forms.Appearance.Button; - this.Encoding.AutoSize = true; - this.Encoding.Location = new System.Drawing.Point(217, 119); - this.Encoding.Name = "Encoding"; - this.Encoding.Size = new System.Drawing.Size(54, 23); - this.Encoding.TabIndex = 31; - this.Encoding.Text = "Encode"; - this.Encoding.UseVisualStyleBackColor = true; - // - // ClearButton - // - this.ClearButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ClearButton.Location = new System.Drawing.Point(217, 148); - this.ClearButton.Name = "ClearButton"; - this.ClearButton.Size = new System.Drawing.Size(54, 23); - this.ClearButton.TabIndex = 32; - this.ClearButton.Text = "&Clear"; - this.ClearButton.UseVisualStyleBackColor = true; - this.ClearButton.Click += new System.EventHandler(this.ClearButton_Click); - // - // MenuStrip - // - this.MenuStrip.ClickThrough = true; - this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.GameGenieCode = new System.Windows.Forms.TextBox(); + this.GameGenieCodeBox = new System.Windows.Forms.GroupBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.CompareBox = new BizHawk.Client.EmuHawk.HexTextBox(); + this.ValueBox = new BizHawk.Client.EmuHawk.HexTextBox(); + this.AddressBox = new BizHawk.Client.EmuHawk.HexTextBox(); + this.AddCheat = new System.Windows.Forms.Button(); + this.ButtonPanel = new System.Windows.Forms.Panel(); + this.N = new System.Windows.Forms.Button(); + this.V = new System.Windows.Forms.Button(); + this.S = new System.Windows.Forms.Button(); + this.K = new System.Windows.Forms.Button(); + this.U = new System.Windows.Forms.Button(); + this.X = new System.Windows.Forms.Button(); + this.O = new System.Windows.Forms.Button(); + this.Y = new System.Windows.Forms.Button(); + this.L = new System.Windows.Forms.Button(); + this.E = new System.Windows.Forms.Button(); + this.T = new System.Windows.Forms.Button(); + this.I = new System.Windows.Forms.Button(); + this.G = new System.Windows.Forms.Button(); + this.Z = new System.Windows.Forms.Button(); + this.P = new System.Windows.Forms.Button(); + this.A = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.Encoding = new System.Windows.Forms.CheckBox(); + this.ClearButton = new System.Windows.Forms.Button(); + this.MenuStrip = new MenuStripEx(); + 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.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.GameGenieCodeBox.SuspendLayout(); + this.ButtonPanel.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.MenuStrip.SuspendLayout(); + this.SuspendLayout(); + // + // GameGenieCode + // + this.GameGenieCode.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.GameGenieCode.Location = new System.Drawing.Point(6, 19); + this.GameGenieCode.MaxLength = 8; + this.GameGenieCode.Name = "GameGenieCode"; + this.GameGenieCode.Size = new System.Drawing.Size(102, 20); + this.GameGenieCode.TabIndex = 20; + this.GameGenieCode.TextChanged += new System.EventHandler(this.GameGenieCode_TextChanged); + this.GameGenieCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GameGenieCode_KeyDown); + this.GameGenieCode.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.GameGenieCode_KeyPress); + // + // GameGenieCodeBox + // + this.GameGenieCodeBox.Controls.Add(this.GameGenieCode); + this.GameGenieCodeBox.Location = new System.Drawing.Point(31, 103); + this.GameGenieCodeBox.Name = "GameGenieCodeBox"; + this.GameGenieCodeBox.Size = new System.Drawing.Size(119, 54); + this.GameGenieCodeBox.TabIndex = 1; + this.GameGenieCodeBox.TabStop = false; + this.GameGenieCodeBox.Text = "Game Genie Code"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(8, 68); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(34, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Value"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 42); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(49, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Compare"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(45, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Address"; + // + // CompareBox + // + this.CompareBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.CompareBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.CompareBox.Location = new System.Drawing.Point(88, 39); + this.CompareBox.MaxLength = 2; + this.CompareBox.Name = "CompareBox"; + this.CompareBox.Nullable = true; + this.CompareBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.CompareBox.Size = new System.Drawing.Size(20, 20); + this.CompareBox.TabIndex = 22; + this.CompareBox.TextChanged += new System.EventHandler(this.CompareBox_TextChanged); + // + // ValueBox + // + this.ValueBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.ValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.ValueBox.Location = new System.Drawing.Point(88, 65); + this.ValueBox.MaxLength = 2; + this.ValueBox.Name = "ValueBox"; + this.ValueBox.Nullable = true; + this.ValueBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.ValueBox.Size = new System.Drawing.Size(20, 20); + this.ValueBox.TabIndex = 23; + this.ValueBox.TextChanged += new System.EventHandler(this.ValueBox_TextChanged); + // + // AddressBox + // + this.AddressBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.AddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + this.AddressBox.Location = new System.Drawing.Point(76, 13); + this.AddressBox.MaxLength = 4; + this.AddressBox.Name = "AddressBox"; + this.AddressBox.Nullable = true; + this.AddressBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.AddressBox.Size = new System.Drawing.Size(32, 20); + this.AddressBox.TabIndex = 21; + this.AddressBox.TextChanged += new System.EventHandler(this.AddressBox_TextChanged); + // + // AddCheat + // + this.AddCheat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.AddCheat.Location = new System.Drawing.Point(202, 230); + this.AddCheat.Name = "AddCheat"; + this.AddCheat.Size = new System.Drawing.Size(69, 21); + this.AddCheat.TabIndex = 33; + this.AddCheat.Text = "&Add Cheat"; + this.AddCheat.UseVisualStyleBackColor = true; + this.AddCheat.Click += new System.EventHandler(this.AddCheat_Click); + // + // ButtonPanel + // + this.ButtonPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.ButtonPanel.Controls.Add(this.N); + this.ButtonPanel.Controls.Add(this.V); + this.ButtonPanel.Controls.Add(this.S); + this.ButtonPanel.Controls.Add(this.K); + this.ButtonPanel.Controls.Add(this.U); + this.ButtonPanel.Controls.Add(this.X); + this.ButtonPanel.Controls.Add(this.O); + this.ButtonPanel.Controls.Add(this.Y); + this.ButtonPanel.Controls.Add(this.L); + this.ButtonPanel.Controls.Add(this.E); + this.ButtonPanel.Controls.Add(this.T); + this.ButtonPanel.Controls.Add(this.I); + this.ButtonPanel.Controls.Add(this.G); + this.ButtonPanel.Controls.Add(this.Z); + this.ButtonPanel.Controls.Add(this.P); + this.ButtonPanel.Controls.Add(this.A); + this.ButtonPanel.Location = new System.Drawing.Point(31, 30); + this.ButtonPanel.Name = "ButtonPanel"; + this.ButtonPanel.Size = new System.Drawing.Size(240, 67); + this.ButtonPanel.TabIndex = 4; + // + // N + // + this.N.Location = new System.Drawing.Point(206, 35); + this.N.Name = "N"; + this.N.Size = new System.Drawing.Size(26, 23); + this.N.TabIndex = 16; + this.N.Text = "N"; + this.N.UseVisualStyleBackColor = true; + this.N.Click += new System.EventHandler(this.Keypad_Click); + // + // V + // + this.V.Location = new System.Drawing.Point(149, 35); + this.V.Name = "V"; + this.V.Size = new System.Drawing.Size(26, 23); + this.V.TabIndex = 14; + this.V.Text = "V"; + this.V.UseVisualStyleBackColor = true; + this.V.Click += new System.EventHandler(this.Keypad_Click); + // + // S + // + this.S.Location = new System.Drawing.Point(91, 35); + this.S.Name = "S"; + this.S.Size = new System.Drawing.Size(26, 23); + this.S.TabIndex = 12; + this.S.Text = "S"; + this.S.UseVisualStyleBackColor = true; + this.S.Click += new System.EventHandler(this.Keypad_Click); + // + // K + // + this.K.Location = new System.Drawing.Point(34, 35); + this.K.Name = "K"; + this.K.Size = new System.Drawing.Size(26, 23); + this.K.TabIndex = 10; + this.K.Text = "K"; + this.K.UseVisualStyleBackColor = true; + this.K.Click += new System.EventHandler(this.Keypad_Click); + // + // U + // + this.U.Location = new System.Drawing.Point(206, 5); + this.U.Name = "U"; + this.U.Size = new System.Drawing.Size(26, 23); + this.U.TabIndex = 8; + this.U.Text = "U"; + this.U.UseVisualStyleBackColor = true; + this.U.Click += new System.EventHandler(this.Keypad_Click); + // + // X + // + this.X.Location = new System.Drawing.Point(149, 6); + this.X.Name = "X"; + this.X.Size = new System.Drawing.Size(26, 23); + this.X.TabIndex = 6; + this.X.Text = "X"; + this.X.UseVisualStyleBackColor = true; + this.X.Click += new System.EventHandler(this.Keypad_Click); + // + // O + // + this.O.Location = new System.Drawing.Point(91, 6); + this.O.Name = "O"; + this.O.Size = new System.Drawing.Size(26, 23); + this.O.TabIndex = 4; + this.O.Text = "O"; + this.O.UseVisualStyleBackColor = true; + this.O.Click += new System.EventHandler(this.Keypad_Click); + // + // Y + // + this.Y.Location = new System.Drawing.Point(178, 35); + this.Y.Name = "Y"; + this.Y.Size = new System.Drawing.Size(26, 23); + this.Y.TabIndex = 15; + this.Y.Text = "Y"; + this.Y.UseVisualStyleBackColor = true; + this.Y.Click += new System.EventHandler(this.Keypad_Click); + // + // L + // + this.L.Location = new System.Drawing.Point(178, 5); + this.L.Name = "L"; + this.L.Size = new System.Drawing.Size(26, 23); + this.L.TabIndex = 7; + this.L.Text = "L"; + this.L.UseVisualStyleBackColor = true; + this.L.Click += new System.EventHandler(this.Keypad_Click); + // + // E + // + this.E.Location = new System.Drawing.Point(34, 6); + this.E.Name = "E"; + this.E.Size = new System.Drawing.Size(26, 23); + this.E.TabIndex = 2; + this.E.Text = "E"; + this.E.UseVisualStyleBackColor = true; + this.E.Click += new System.EventHandler(this.Keypad_Click); + // + // T + // + this.T.Location = new System.Drawing.Point(121, 35); + this.T.Name = "T"; + this.T.Size = new System.Drawing.Size(26, 23); + this.T.TabIndex = 13; + this.T.Text = "T"; + this.T.UseVisualStyleBackColor = true; + this.T.Click += new System.EventHandler(this.Keypad_Click); + // + // I + // + this.I.Location = new System.Drawing.Point(63, 35); + this.I.Name = "I"; + this.I.Size = new System.Drawing.Size(26, 23); + this.I.TabIndex = 11; + this.I.Text = "I"; + this.I.UseVisualStyleBackColor = true; + this.I.Click += new System.EventHandler(this.Keypad_Click); + // + // G + // + this.G.Location = new System.Drawing.Point(6, 35); + this.G.Name = "G"; + this.G.Size = new System.Drawing.Size(26, 23); + this.G.TabIndex = 9; + this.G.Text = "G"; + this.G.UseVisualStyleBackColor = true; + this.G.Click += new System.EventHandler(this.Keypad_Click); + // + // Z + // + this.Z.Location = new System.Drawing.Point(121, 6); + this.Z.Name = "Z"; + this.Z.Size = new System.Drawing.Size(26, 23); + this.Z.TabIndex = 5; + this.Z.Text = "Z"; + this.Z.UseVisualStyleBackColor = true; + this.Z.Click += new System.EventHandler(this.Keypad_Click); + // + // P + // + this.P.Location = new System.Drawing.Point(63, 6); + this.P.Name = "P"; + this.P.Size = new System.Drawing.Size(26, 23); + this.P.TabIndex = 3; + this.P.Text = "P"; + this.P.UseVisualStyleBackColor = true; + this.P.Click += new System.EventHandler(this.Keypad_Click); + // + // A + // + this.A.Location = new System.Drawing.Point(6, 5); + this.A.Name = "A"; + this.A.Size = new System.Drawing.Size(26, 23); + this.A.TabIndex = 1; + this.A.Text = "A"; + this.A.UseVisualStyleBackColor = true; + this.A.Click += new System.EventHandler(this.Keypad_Click); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.AddressBox); + this.groupBox1.Controls.Add(this.ValueBox); + this.groupBox1.Controls.Add(this.CompareBox); + this.groupBox1.Location = new System.Drawing.Point(31, 158); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(119, 93); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + // + // label6 + // + this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(70, 69); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(18, 13); + this.label6.TabIndex = 9; + this.label6.Text = "0x"; + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(70, 42); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(18, 13); + this.label5.TabIndex = 8; + this.label5.Text = "0x"; + // + // label4 + // + this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(58, 16); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(18, 13); + this.label4.TabIndex = 7; + this.label4.Text = "0x"; + // + // Encoding + // + this.Encoding.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.Encoding.Appearance = System.Windows.Forms.Appearance.Button; + this.Encoding.AutoSize = true; + this.Encoding.Location = new System.Drawing.Point(217, 119); + this.Encoding.Name = "Encoding"; + this.Encoding.Size = new System.Drawing.Size(54, 23); + this.Encoding.TabIndex = 31; + this.Encoding.Text = "Encode"; + this.Encoding.UseVisualStyleBackColor = true; + // + // ClearButton + // + this.ClearButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.ClearButton.Location = new System.Drawing.Point(217, 148); + this.ClearButton.Name = "ClearButton"; + this.ClearButton.Size = new System.Drawing.Size(54, 23); + this.ClearButton.TabIndex = 32; + this.ClearButton.Text = "&Clear"; + this.ClearButton.UseVisualStyleBackColor = true; + this.ClearButton.Click += new System.EventHandler(this.ClearButton_Click); + // + // MenuStrip + // + this.MenuStrip.ClickThrough = true; + this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.OptionsSubMenu}); - this.MenuStrip.Location = new System.Drawing.Point(0, 0); - this.MenuStrip.Name = "MenuStrip"; - this.MenuStrip.Size = new System.Drawing.Size(302, 24); - this.MenuStrip.TabIndex = 8; - this.MenuStrip.Text = "menuStrip1"; - // - // OptionsSubMenu - // - this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MenuStrip.Location = new System.Drawing.Point(0, 0); + this.MenuStrip.Name = "MenuStrip"; + this.MenuStrip.Size = new System.Drawing.Size(292, 24); + this.MenuStrip.TabIndex = 8; + this.MenuStrip.Text = "menuStrip1"; + // + // OptionsSubMenu + // + this.OptionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.AutoloadMenuItem, this.SaveWindowPositionMenuItem, + this.AlwaysOnTopMenuItem, + this.FloatingWindowMenuItem, this.toolStripSeparator1, this.ExitMenuItem}); - 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); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(188, 6); - // - // ExitMenuItem - // - this.ExitMenuItem.Name = "ExitMenuItem"; - this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.ExitMenuItem.Size = new System.Drawing.Size(191, 22); - this.ExitMenuItem.Text = "E&xit"; - this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); - // - // NESGameGenie - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(302, 263); - this.Controls.Add(this.ClearButton); - this.Controls.Add(this.Encoding); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.ButtonPanel); - this.Controls.Add(this.AddCheat); - this.Controls.Add(this.GameGenieCodeBox); - this.Controls.Add(this.MenuStrip); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; - this.MainMenuStrip = this.MenuStrip; - this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(312, 302); - this.MinimumSize = new System.Drawing.Size(312, 295); - this.Name = "NESGameGenie"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "NES Game Genie Encoder / Decoder"; - this.Load += new System.EventHandler(this.NESGameGenie_Load); - this.GameGenieCodeBox.ResumeLayout(false); - this.GameGenieCodeBox.PerformLayout(); - this.ButtonPanel.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.MenuStrip.ResumeLayout(false); - this.MenuStrip.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + 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); + // + // floatingWindowToolStripMenuItem + // + this.FloatingWindowMenuItem.Name = "floatingWindowToolStripMenuItem"; + 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); + // + // ExitMenuItem + // + this.ExitMenuItem.Name = "ExitMenuItem"; + this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); + this.ExitMenuItem.Size = new System.Drawing.Size(191, 22); + this.ExitMenuItem.Text = "E&xit"; + this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); + // + // NESGameGenie + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 260); + this.Controls.Add(this.ClearButton); + this.Controls.Add(this.Encoding); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.ButtonPanel); + this.Controls.Add(this.AddCheat); + this.Controls.Add(this.GameGenieCodeBox); + this.Controls.Add(this.MenuStrip); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MainMenuStrip = this.MenuStrip; + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(312, 302); + this.MinimumSize = new System.Drawing.Size(312, 295); + this.Name = "NESGameGenie"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "NES Game Genie Encoder / Decoder"; + this.Load += new System.EventHandler(this.NESGameGenie_Load); + this.GameGenieCodeBox.ResumeLayout(false); + this.GameGenieCodeBox.PerformLayout(); + this.ButtonPanel.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.MenuStrip.ResumeLayout(false); + this.MenuStrip.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -550,5 +568,7 @@ private System.Windows.Forms.ToolStripMenuItem SaveWindowPositionMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripMenuItem ExitMenuItem; + private System.Windows.Forms.ToolStripMenuItem AlwaysOnTopMenuItem; + private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs index eddd96c240..815053c108 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Globalization; using System.Windows.Forms; @@ -12,22 +11,22 @@ namespace BizHawk.Client.EmuHawk { private readonly Dictionary _gameGenieTable = new Dictionary { - { 'A', 0 }, // 0000 - { 'P', 1 }, // 0001 - { 'Z', 2 }, // 0010 - { 'L', 3 }, // 0011 - { 'G', 4 }, // 0100 - { 'I', 5 }, // 0101 - { 'T', 6 }, // 0110 - { 'Y', 7 }, // 0111 - { 'E', 8 }, // 1000 - { 'O', 9 }, // 1001 - { 'X', 10}, // 1010 - { 'U', 11}, // 1011 - { 'K', 12}, // 1100 - { 'S', 13}, // 1101 - { 'V', 14}, // 1110 - { 'N', 15}, // 1111 + { 'A', 0 }, // 0000 + { 'P', 1 }, // 0001 + { 'Z', 2 }, // 0010 + { 'L', 3 }, // 0011 + { 'G', 4 }, // 0100 + { 'I', 5 }, // 0101 + { 'T', 6 }, // 0110 + { 'Y', 7 }, // 0111 + { 'E', 8 }, // 1000 + { 'O', 9 }, // 1001 + { 'X', 10 }, // 1010 + { 'U', 11 }, // 1011 + { 'K', 12 }, // 1100 + { 'S', 13 }, // 1101 + { 'V', 14 }, // 1110 + { 'N', 15 }, // 1111 }; private int? _address; @@ -61,9 +60,10 @@ namespace BizHawk.Client.EmuHawk InitializeComponent(); Closing += (o, e) => { - Global.Config.NESGGWndx = Location.X; - Global.Config.NESGGWndy = Location.Y; + Global.Config.NesGGSettings.Wndx = Location.X; + Global.Config.NesGGSettings.Wndy = Location.Y; }; + TopMost = Global.Config.NesGGSettings.TopMost; AddressBox.SetHexProperties(0x10000); ValueBox.SetHexProperties(0x100); CompareBox.SetHexProperties(0x100); @@ -73,9 +73,9 @@ namespace BizHawk.Client.EmuHawk { AddCheat.Enabled = false; - if (Global.Config.NESGGSaveWindowPosition && Global.Config.NESGGWndx >= 0 && Global.Config.NESGGWndy >= 0) + if (Global.Config.NesGGSettings.UseWindowPosition) { - Location = new Point(Global.Config.NESGGWndx, Global.Config.NESGGWndy); + Location = Global.Config.NesGGSettings.WindowPosition; } } @@ -125,16 +125,16 @@ namespace BizHawk.Client.EmuHawk AddressBox.Text = CompareBox.Text = ValueBox.Text = - String.Empty; + string.Empty; AddCheat.Enabled = false; } private void TryEnableAddCheat() { - AddCheat.Enabled = !String.IsNullOrWhiteSpace(AddressBox.Text) - && !String.IsNullOrWhiteSpace(ValueBox.Text) - && !String.IsNullOrWhiteSpace(GameGenieCode.Text); + AddCheat.Enabled = !string.IsNullOrWhiteSpace(AddressBox.Text) + && !string.IsNullOrWhiteSpace(ValueBox.Text) + && !string.IsNullOrWhiteSpace(GameGenieCode.Text); } private void EncodeGameGenie() @@ -147,7 +147,7 @@ namespace BizHawk.Client.EmuHawk private void AddCheatClick() { - if (!String.IsNullOrWhiteSpace(AddressBox.Text) && !String.IsNullOrWhiteSpace(ValueBox.Text)) + if (!string.IsNullOrWhiteSpace(AddressBox.Text) && !string.IsNullOrWhiteSpace(ValueBox.Text)) { var watch = Watch.GenerateWatch( Global.Emulator.MemoryDomains["System Bus"], @@ -165,6 +165,11 @@ namespace BizHawk.Client.EmuHawk } } + private void RefreshFloatingWindowControl() + { + Owner = Global.Config.NesGGSettings.FloatingWindow ? null : GlobalWin.MainForm; + } + #region Events #region File Menu @@ -172,7 +177,9 @@ namespace BizHawk.Client.EmuHawk private void OptionsSubMenu_DropDownOpened(object sender, EventArgs e) { AutoloadMenuItem.Checked = Global.Config.NESGGAutoload; - SaveWindowPositionMenuItem.Checked = Global.Config.NESGGSaveWindowPosition; + SaveWindowPositionMenuItem.Checked = Global.Config.NesGGSettings.SaveWindowPosition; + AlwaysOnTopMenuItem.Checked = Global.Config.NesGGSettings.TopMost; + FloatingWindowMenuItem.Checked = Global.Config.NesGGSettings.FloatingWindow; } private void AutoloadMenuItem_Click(object sender, EventArgs e) @@ -182,7 +189,7 @@ namespace BizHawk.Client.EmuHawk private void SaveWindowPositionMenuItem_Click(object sender, EventArgs e) { - Global.Config.NESGGSaveWindowPosition ^= true; + Global.Config.NesGGSettings.SaveWindowPosition ^= true; } private void ExitMenuItem_Click(object sender, EventArgs e) @@ -190,6 +197,18 @@ namespace BizHawk.Client.EmuHawk Close(); } + private void AlwaysOnTopMenuItem_Click(object sender, EventArgs e) + { + Global.Config.NesGGSettings.TopMost ^= true; + TopMost = Global.Config.NesGGSettings.TopMost; + } + + private void FloatingWindowMenuItem_Click(object sender, EventArgs e) + { + Global.Config.NesGGSettings.FloatingWindow ^= true; + RefreshFloatingWindowControl(); + } + #endregion #region Control Events @@ -212,7 +231,7 @@ namespace BizHawk.Client.EmuHawk private void ClearButton_Click(object sender, EventArgs e) { ClearProperties(); - GameGenieCode.Text = String.Empty; + GameGenieCode.Text = string.Empty; Encoding.Checked = false; } @@ -234,12 +253,12 @@ namespace BizHawk.Client.EmuHawk private void ValueBox_TextChanged(object sender, EventArgs e) { - if (Encoding.Checked && !String.IsNullOrWhiteSpace(ValueBox.Text)) + if (Encoding.Checked && !string.IsNullOrWhiteSpace(ValueBox.Text)) { - int val = int.Parse(ValueBox.Text, NumberStyles.HexNumber); + var val = int.Parse(ValueBox.Text, NumberStyles.HexNumber); if (val > 0 && val < 0x100) { - if (!String.IsNullOrWhiteSpace(AddressBox.Text)) + if (!string.IsNullOrWhiteSpace(AddressBox.Text)) { _value = val; EncodeGameGenie(); @@ -254,7 +273,7 @@ namespace BizHawk.Client.EmuHawk { if (GameGenieCode.Text.Length < 8) { - var code = String.Empty; + var code = string.Empty; if (sender == A) code = "A"; if (sender == P) code += "P"; if (sender == Z) code += "Z"; @@ -283,7 +302,7 @@ namespace BizHawk.Client.EmuHawk { if (Encoding.Checked && AddressBox.Text.Length > 0) { - if (!String.IsNullOrEmpty(ValueBox.Text)) + if (!string.IsNullOrEmpty(ValueBox.Text)) { EncodeGameGenie(); } @@ -298,7 +317,7 @@ namespace BizHawk.Client.EmuHawk { if (CompareBox.Text.Length > 0) { - int c = int.Parse(CompareBox.Text, NumberStyles.HexNumber); + var c = int.Parse(CompareBox.Text, NumberStyles.HexNumber); if (c > 0 && c < 0x100) { if (ValueBox.Text.Length > 0 && AddressBox.Text.Length > 0) @@ -335,6 +354,12 @@ namespace BizHawk.Client.EmuHawk TryEnableAddCheat(); } + protected override void OnShown(EventArgs e) + { + RefreshFloatingWindowControl(); + base.OnShown(e); + } + #endregion #endregion