From dc3f5906b0c1a00628f32adfc1613417c86bccc4 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 29 Feb 2020 09:21:28 -0600 Subject: [PATCH] cleanup --- BizHawk.Client.EmuHawk/tools/GameShark.cs | 46 ++++++++++++----------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/BizHawk.Client.EmuHawk/tools/GameShark.cs b/BizHawk.Client.EmuHawk/tools/GameShark.cs index ad175a42b0..6b7e892ab9 100644 --- a/BizHawk.Client.EmuHawk/tools/GameShark.cs +++ b/BizHawk.Client.EmuHawk/tools/GameShark.cs @@ -33,6 +33,8 @@ namespace BizHawk.Client.EmuHawk InitializeComponent(); } + #region IToolForm + public bool UpdateBefore => true; public bool AskSaveChanges() => true; @@ -52,6 +54,8 @@ namespace BizHawk.Client.EmuHawk { } + #endregion + private string _parseString; private string _ramAddress; private string _ramValue; @@ -60,6 +64,27 @@ namespace BizHawk.Client.EmuHawk private string _singleCheat; private int _loopValue; + // Provided by mGBA and endrift + private readonly uint[] _gbaGameSharkSeeds = { 0x09F4FBBDU, 0x9681884AU, 0x352027E9U, 0xF3DEE5A7U }; + private readonly uint[] _gbaProActionReplaySeeds = { 0x7AA9648FU, 0x7FAE6994U, 0xC0EFAAD5U, 0x42712C57U }; + + // blnEncrypted is used to see if the previous line for Slide code was encrypted or not. + private bool _blnEncrypted; + + // blnGameShark means, "This is a Game Shark/Action Replay (Not MAX) code." + private bool _blnGameShark; + + // blnActionReplayMax means "This is an Action Replay MAX code." + private bool _blnActionReplayMax; + + // blnCodeBreaker means "This is a CodeBreaker code." + // Boolean blnCodeBreaker = false; + // blnUnhandled means "BizHawk can't do this one or the tool can't." + private bool _blnUnhandled; + + // blnUnneeded means "You don't need this code." + private bool _blnUnneeded; + private void Go_Click(object sender, EventArgs e) { // Reset Variables @@ -159,27 +184,6 @@ namespace BizHawk.Client.EmuHawk } } - // Provided by mGBA and endrift - private readonly uint[] _gbaGameSharkSeeds = { 0x09F4FBBDU, 0x9681884AU, 0x352027E9U, 0xF3DEE5A7U }; - private readonly uint[] _gbaProActionReplaySeeds = { 0x7AA9648FU, 0x7FAE6994U, 0xC0EFAAD5U, 0x42712C57U }; - - // blnEncrypted is used to see if the previous line for Slide code was encrypted or not. - private bool _blnEncrypted; - - // blnGameShark means, "This is a Game Shark/Action Replay (Not MAX) code." - private bool _blnGameShark; - - // blnActionReplayMax means "This is an Action Replay MAX code." - private bool _blnActionReplayMax; - - // blnCodeBreaker means "This is a CodeBreaker code." - // Boolean blnCodeBreaker = false; - // blnUnhandled means "BizHawk can't do this one or the tool can't." - private bool _blnUnhandled; - - // blnUnneeded means "You don't need this code." - private bool _blnUnneeded; - private void GBA() { // Super Ultra Mega HD BizHawk GameShark/Action Replay/Code Breaker Final Hyper Edition Arcade Remix EX + α GBA Code detection method.