From 4a83a5f4b8783921cfe3715d624be7a5d31dc96b Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 28 Feb 2020 18:58:06 -0600 Subject: [PATCH] remove now unused NESGameGeneie tool --- .../BizHawk.Client.EmuHawk.csproj | 3 - .../tools/NES/NESGameGenie.Designer.cs | 500 ------------------ .../tools/NES/NESGameGenie.cs | 309 ----------- .../tools/NES/NESGameGenie.resx | 123 ----- 4 files changed, 935 deletions(-) delete mode 100644 BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs delete mode 100644 BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs delete mode 100644 BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.resx diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index 26f95634bf..766e226bb8 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -589,9 +589,6 @@ - - - diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs deleted file mode 100644 index dce67c475b..0000000000 --- a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.Designer.cs +++ /dev/null @@ -1,500 +0,0 @@ -namespace BizHawk.Client.EmuHawk -{ - partial class NESGameGenie - { - /// - /// 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() - { - 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.GameGenieCodeBox.SuspendLayout(); - this.ButtonPanel.SuspendLayout(); - this.groupBox1.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(212, 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(227, 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(227, 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.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"; - // - // NESGameGenie - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(302, 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.Icon = global::BizHawk.Client.EmuHawk.Properties.Resources.NESControllerIcon_MultiSize; - this.MainMenuStrip = this.MenuStrip; - this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(322, 302); - this.MinimumSize = new System.Drawing.Size(312, 295); - this.Name = "NESGameGenie"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "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.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox GameGenieCode; - private System.Windows.Forms.GroupBox GameGenieCodeBox; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private HexTextBox CompareBox; - private HexTextBox ValueBox; - private HexTextBox AddressBox; - private System.Windows.Forms.Button AddCheat; - private System.Windows.Forms.Panel ButtonPanel; - private System.Windows.Forms.Button L; - private System.Windows.Forms.Button Z; - private System.Windows.Forms.Button P; - private System.Windows.Forms.Button A; - private System.Windows.Forms.Button Y; - private System.Windows.Forms.Button T; - private System.Windows.Forms.Button I; - private System.Windows.Forms.Button G; - private System.Windows.Forms.Button N; - private System.Windows.Forms.Button V; - private System.Windows.Forms.Button S; - private System.Windows.Forms.Button K; - private System.Windows.Forms.Button U; - private System.Windows.Forms.Button X; - private System.Windows.Forms.Button O; - private System.Windows.Forms.Button E; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.CheckBox Encoding; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Button ClearButton; - private MenuStripEx MenuStrip; - } -} \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs deleted file mode 100644 index e1257ece60..0000000000 --- a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.cs +++ /dev/null @@ -1,309 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Windows.Forms; - -using BizHawk.Emulation.Common; -using BizHawk.Client.Common; -using BizHawk.Common; - -namespace BizHawk.Client.EmuHawk -{ - [Tool(false, null)] - public partial class NESGameGenie : Form, IToolFormAutoConfig - { - [RequiredService] - private IEmulator Emulator { get; set; } - - [RequiredService] - private IMemoryDomains MemoryDomains { get; set; } - - 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 - }; - - private int? _address; - private int? _value; - private int? _compare; - - public bool AskSaveChanges() => true; - public bool UpdateBefore => false; - - public void Restart() - { - if (Emulator.SystemId != "NES") - { - Close(); - } - } - - public void NewUpdate(ToolFormUpdateType type) { } - - public void UpdateValues() - { - if (Emulator.SystemId != "NES") - { - Close(); - } - } - - public void FastUpdate() - { - // Do nothing - } - - public NESGameGenie() - { - InitializeComponent(); - AddressBox.SetHexProperties(0x10000); - ValueBox.SetHexProperties(0x100); - CompareBox.SetHexProperties(0x100); - } - - private void NESGameGenie_Load(object sender, EventArgs e) - { - AddCheat.Enabled = false; - } - - public void DecodeGameGenieCode(string code) - { - var decoder = new NESGameGenieDecoder(code); - _address = decoder.Address; - _value = decoder.Value; - _compare = decoder.Compare; - SetProperties(); - } - - private void SetProperties() - { - if (_address.HasValue) - { - AddressBox.SetFromRawInt(_address.Value); - } - else - { - AddressBox.ResetText(); - } - - if (_compare.HasValue) - { - CompareBox.SetFromRawInt(_compare.Value); - } - else - { - CompareBox.ResetText(); - } - - if (_value.HasValue) - { - ValueBox.SetFromRawInt(_value.Value); - } - else - { - ValueBox.ResetText(); - } - } - - private void ClearProperties() - { - _address = _value = _compare = null; - - AddressBox.Text = - CompareBox.Text = - ValueBox.Text = - ""; - - AddCheat.Enabled = false; - } - - private void TryEnableAddCheat() - { - AddCheat.Enabled = !string.IsNullOrWhiteSpace(AddressBox.Text) - && !string.IsNullOrWhiteSpace(ValueBox.Text) - && !string.IsNullOrWhiteSpace(GameGenieCode.Text); - } - - private void EncodeGameGenie() - { - _address = AddressBox.ToRawInt(); - _value = ValueBox.ToRawInt(); - _compare = CompareBox.ToRawInt(); - GameGenieCode.Text = new NESGameGenieEncoder(_address.Value, _value.Value, _compare).Encode(); - } - - #region Events - - private void GameGenieCode_KeyPress(object sender, KeyPressEventArgs e) - { - if (!_gameGenieTable.ContainsKey(char.ToUpper(e.KeyChar))) - { - if (ModifierKeys != Keys.None) - { - return; - } - - if (e.KeyChar != (char)Keys.Back || e.KeyChar != '\b' || e.KeyChar == 22 || e.KeyChar == 1 || e.KeyChar == 3) - { - e.Handled = true; - } - } - else - { - Encoding.Checked = false; - } - } - - private void ClearButton_Click(object sender, EventArgs e) - { - ClearProperties(); - GameGenieCode.Text = ""; - Encoding.Checked = false; - } - - private void AddCheat_Click(object sender, EventArgs e) - { - if (!string.IsNullOrWhiteSpace(AddressBox.Text) && !string.IsNullOrWhiteSpace(ValueBox.Text)) - { - var watch = Watch.GenerateWatch( - MemoryDomains["System Bus"], - AddressBox.ToRawInt().Value, - WatchSize.Byte, - Client.Common.DisplayType.Hex, - false, - GameGenieCode.Text); - - Global.CheatList.Add(new Cheat( - watch, - ValueBox.ToRawInt().Value, - CompareBox.ToRawInt() - )); - } - } - - private void GameGenieCode_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyData == Keys.Enter) - { - if (AddCheat.Enabled) - { - AddCheat_Click(null, null); - } - } - } - - private void ValueBox_TextChanged(object sender, EventArgs e) - { - if (Encoding.Checked && !string.IsNullOrWhiteSpace(ValueBox.Text)) - { - var val = int.Parse(ValueBox.Text, NumberStyles.HexNumber); - if (val.StrictlyBoundedBy(0.RangeTo(0x100)) && !string.IsNullOrWhiteSpace(AddressBox.Text)) - { - _value = val; - EncodeGameGenie(); - } - } - - TryEnableAddCheat(); - } - - private void Keypad_Click(object sender, EventArgs e) - { - if (GameGenieCode.Text.Length < 8) - { - var code = ""; - if (sender == A) code = "A"; - if (sender == P) code += "P"; - if (sender == Z) code += "Z"; - if (sender == L) code += "L"; - if (sender == G) code += "G"; - if (sender == I) code += "I"; - if (sender == T) code += "T"; - if (sender == Y) code += "Y"; - if (sender == E) code += "E"; - if (sender == O) code += "O"; - if (sender == X) code += "X"; - if (sender == U) code += "U"; - if (sender == K) code += "K"; - if (sender == S) code += "S"; - if (sender == V) code += "V"; - if (sender == N) code += "N"; - - int x = GameGenieCode.SelectionStart; - GameGenieCode.Text = GameGenieCode.Text.Insert(x, code); - GameGenieCode.SelectionStart = x + 1; - Encoding.Checked = false; - } - } - - private void AddressBox_TextChanged(object sender, EventArgs e) - { - if (Encoding.Checked && AddressBox.Text.Length > 0) - { - if (!string.IsNullOrEmpty(ValueBox.Text)) - { - EncodeGameGenie(); - } - } - - TryEnableAddCheat(); - } - - private void CompareBox_TextChanged(object sender, EventArgs e) - { - if (Encoding.Checked) - { - if (CompareBox.Text.Length > 0) - { - var c = int.Parse(CompareBox.Text, NumberStyles.HexNumber); - if (c.StrictlyBoundedBy(0.RangeTo(0x100)) && ValueBox.Text.Length > 0 && AddressBox.Text.Length > 0) - { - _compare = c; - EncodeGameGenie(); - } - } - else - { - _compare = -1; - EncodeGameGenie(); - } - } - - TryEnableAddCheat(); - } - - private void GameGenieCode_TextChanged(object sender, EventArgs e) - { - if (Encoding.Checked == false) - { - if (GameGenieCode.Text.Length == 6 || GameGenieCode.Text.Length == 8) - { - DecodeGameGenieCode(GameGenieCode.Text); - } - else - { - ClearProperties(); - } - } - - TryEnableAddCheat(); - } - - #endregion - } -} diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.resx b/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.resx deleted file mode 100644 index 2d477aa0a4..0000000000 --- a/BizHawk.Client.EmuHawk/tools/NES/NESGameGenie.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - \ No newline at end of file