This commit is contained in:
adelikat 2020-02-29 11:50:19 -06:00
parent 1e9b7555ac
commit 1c7c58189e
2 changed files with 6 additions and 10 deletions

View File

@ -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.

View File

@ -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);