diff --git a/BizHawk.Client.Common/cheats/GenesisActionReplayDecoder.cs b/BizHawk.Client.Common/cheats/GenesisActionReplayDecoder.cs index e24d58f674..9c37ae181e 100644 --- a/BizHawk.Client.Common/cheats/GenesisActionReplayDecoder.cs +++ b/BizHawk.Client.Common/cheats/GenesisActionReplayDecoder.cs @@ -16,7 +16,7 @@ namespace BizHawk.Client.Common.cheats public int Address { get; private set; } public int Value { get; private set; } - public int ByteSize { get; private set; } + public WatchSize Size { get; private set; } = WatchSize.Byte; public void Decode() { @@ -31,7 +31,7 @@ namespace BizHawk.Client.Common.cheats // Value: 64 Address = int.Parse(parseString.Remove(4, 3), NumberStyles.HexNumber); Value = int.Parse(parseString.Remove(0, 5), NumberStyles.HexNumber); - ByteSize = 1; + Size = WatchSize.Byte; break; case 11: // Sample Code of 2-Byte: @@ -41,7 +41,7 @@ namespace BizHawk.Client.Common.cheats // Value: 6411 Address = int.Parse(parseString.Remove(4, 5), NumberStyles.HexNumber); Value = int.Parse(parseString.Remove(0, 5), NumberStyles.HexNumber); - ByteSize = 2; + Size = WatchSize.Word; break; default: // We could have checked above but here is fine, since it's a quick check due to one of three possibilities. diff --git a/BizHawk.Client.EmuHawk/tools/GameShark.cs b/BizHawk.Client.EmuHawk/tools/GameShark.cs index 1f5a927bb8..6092d35656 100644 --- a/BizHawk.Client.EmuHawk/tools/GameShark.cs +++ b/BizHawk.Client.EmuHawk/tools/GameShark.cs @@ -2186,9 +2186,7 @@ namespace BizHawk.Client.EmuHawk // We start from Zero. if (cheat.IndexOf(":") != 6) { - MessageBox.Show( - "All Genesis Action Replay/Pro Action Replay Codes need to contain a colon after the sixth character" - , "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + InputError("All Genesis Action Replay/Pro Action Replay Codes need to contain a colon after the sixth character"); return; } @@ -2201,15 +2199,13 @@ namespace BizHawk.Client.EmuHawk return; } - var decoder = new GenesisActionReplayDecoder(cheat); - try { - var size = decoder.ByteSize == 1 ? WatchSize.Byte : WatchSize.Word; + var decoder = new GenesisActionReplayDecoder(cheat); var watch = Watch.GenerateWatch( MemoryDomains["68K RAM"], decoder.Address, - size, + decoder.Size, Common.DisplayType.Hex, false, txtDescription.Text);