MessageBox.Show("All GameBoy Game Geneie Codes need to have a dash after the third character and seventh character.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
MessageBox.Show("Codebreaker/GameShark SP/Xploder codes are not supported by this tool.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
MessageBox.Show("ALL Codes for Action Replay, Action Replay MAX, Codebreaker, GameShark Advance, GameShark SP, Xploder have a Space after the 8th character.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
//We have a code
if(blnNoCode==false)
{
}
}
}
}
publicvoidGBAGameShark()
{
//This is for the Game Shark/Action Replay (Not Max)
//write 01010101 to 3 addresses - 01010101, 03001FF0, 03001FF4, and 03001FF8. '00000000' is used for padding, to ensure the last code encrypts correctly.
//Note: The device improperly writes the Value, to the address. We should ignore that.
MessageBox.Show("Sorry, this tool does not support 3000XXXX codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
// If Byte at XXXXXXXX = ZZ then execute next code.
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("082","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("482")==true)
{
// 482 Should be Changed to 020
// If Byte at XXXXXXXX = ZZ then execute next 2 codes.
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("482","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("882")==true)
{
// 882 Should be Changed to 020
// If Byte at XXXXXXXX = ZZ execute all the codes below this one in the same row (else execute none of the codes below).
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("882","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("C82")==true)
{
// C82 Should be Changed to 020
// While Byte at XXXXXXXX <> ZZ turn off all codes.
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("C82","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("0A2")==true)
{
// 0A2 Should be Changed to 020
// If Halfword at XXXXXXXX = ZZZZ then execute next code.
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("0A2","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("4A2")==true)
{
// 4A2 Should be Changed to 020
// If Halfword at XXXXXXXX = ZZZZ then execute next 2 codes.
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("4A2","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("8A2")==true)
{
// 8A2 Should be Changed to 020
// If Halfword at XXXXXXXX = ZZZZ execute all the codes below this one in the same row (else execute none of the codes below).
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("8A2","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("CA2")==true)
{
// CA2 Should be Changed to 020
// While Halfword at XXXXXXXX <> ZZZZ turn off all codes.
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("CA2","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("0C2")==true)
{
// 0C2 Should be Changed to 020
// If Word at XXXXXXXX = ZZZZZZZZ then execute next code.
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("0C2","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("4C2")==true)
{
// 4C2 Should be Changed to 020
// If Word at XXXXXXXX = ZZZZZZZZ then execute next 2 codes.
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("4C2","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("8C2")==true)
{
// 8C2 Should be Changed to 020
// If Word at XXXXXXXX = ZZZZZZZZ execute all the codes below this one in the same row (else execute none of the codes below).
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("8C2","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("CC2")==true)
{
// CC2 Should be Changed to 020
// While Word at XXXXXXXX <> ZZZZZZZZ turn off all codes.
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("CC2","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 6) If Different Code
elseif(RAMAddress.StartsWith("102")==true)
{
// 102 Should be Changed to 020
// If Byte at XXXXXXXX <> ZZ then execute next code.
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("102","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("502")==true)
{
// 502 Should be Changed to 020
// If Byte at XXXXXXXX <> ZZ then execute next 2 codes.
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("502","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("902")==true)
{
// 902 Should be Changed to 020
// If Byte at XXXXXXXX <> ZZ execute all the codes below this one in the same row (else execute none of the codes below).
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("902","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("D02")==true)
{
// D02 Should be Changed to 020
// While Byte at XXXXXXXX = ZZ turn off all codes.
// XXXXXXXX
// 000000ZZ
RAMAddress=RAMAddress.Replace("D02","020");
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("122")==true)
{
// 122 Should be Changed to 020
// If Halfword at XXXXXXXX <> ZZZZ then execute next code.
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("122","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("522")==true)
{
// 522 Should be Changed to 020
// If Halfword at XXXXXXXX <> ZZZZ then execute next 2 codes.
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("522","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("922")==true)
{
// 922 Should be Changed to 020
// If Halfword at XXXXXXXX <> ZZZZ disable all the codes below this one.
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("922","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("D22")==true)
{
// D22 Should be Changed to 020
// While Halfword at XXXXXXXX = ZZZZ turn off all codes.
// XXXXXXXX
// 0000ZZZZ
RAMAddress=RAMAddress.Replace("D22","020");
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("142")==true)
{
// 142 Should be Changed to 020
// If Word at XXXXXXXX <> ZZZZZZZZ then execute next code.
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("142","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("542")==true)
{
// 542 Should be Changed to 020
// If Word at XXXXXXXX <> ZZZZZZZZ then execute next 2 codes.
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("542","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("942")==true)
{
// 942 Should be Changed to 020
// If Word at XXXXXXXX <> ZZZZZZZZ disable all the codes below this one.
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("942","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("D42")==true)
{
// D42 Should be Changed to 020
// While Word at XXXXXXXX = ZZZZZZZZ turn off all codes.
// XXXXXXXX
// ZZZZZZZZ
RAMAddress=RAMAddress.Replace("D42","020");
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 7)
// [If Byte at address XXXXXXXX is lower than ZZ] (signed) Code
// Signed means : For bytes : values go from -128 to +127. For Halfword : values go from -32768/+32767. For Words : values go from -2147483648 to 2147483647. For exemple, for the Byte comparison, 7F (127) will be > to FF (-1).
//
//
elseif(RAMAddress.StartsWith("182")==true)
{
// 182 Should be Changed to 020
// If ZZ > Byte at XXXXXXXX then execute next code.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("182")==true)
{
RAMAddress=RAMAddress.Replace("182","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("582")==true)
{
// 582 Should be Changed to 020
// If ZZ > Byte at XXXXXXXX then execute next 2 codes.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("582")==true)
{
RAMAddress=RAMAddress.Replace("582","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("982")==true)
{
// 982 Should be Changed to 020
// If ZZ > Byte at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("982")==true)
{
RAMAddress=RAMAddress.Replace("982","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
// While ZZ <= Byte at XXXXXXXX turn off all codes.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("D82")==true)
{
RAMAddress=RAMAddress.Replace("D82","020");
}
elseif((RAMAddress.StartsWith("E82")==true))
{
RAMAddress=RAMAddress.Replace("E82","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("1A2")==true)
{
// 1A2 Should be Changed to 020
// If ZZZZ > Halfword at XXXXXXXX then execute next line.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("1A2")==true)
{
RAMAddress=RAMAddress.Replace("1A2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("5A2")==true)
{
// 5A2 Should be Changed to 020
// If ZZZZ > Halfword at XXXXXXXX then execute next 2 lines.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("5A2")==true)
{
RAMAddress=RAMAddress.Replace("5A2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("9A2")==true)
{
// 9A2 Should be Changed to 020
// If ZZZZ > Halfword at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("9A2")==true)
{
RAMAddress=RAMAddress.Replace("9A2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("DA2")==true)
{
// DA2 Should be Changed to 020
// While ZZZZ <= Halfword at XXXXXXXX turn off all codes.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("DA2")==true)
{
RAMAddress=RAMAddress.Replace("DA2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("1C2")==true)
{
// 1C2 or Should be Changed to 020
// If ZZZZ > Word at XXXXXXXX then execute next line.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("1C2")==true)
{
RAMAddress=RAMAddress.Replace("1C2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("5C2")==true)
{
// 5C2 Should be Changed to 020
// If ZZZZ > Word at XXXXXXXX then execute next 2 lines.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("5C2")==true)
{
RAMAddress=RAMAddress.Replace("5C2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("9C2")==true)
{
// 9C2 Should be Changed to 020
// If ZZZZZZZZ > Word at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("9C2")==true)
{
RAMAddress=RAMAddress.Replace("9C2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("DC2")==true)
{
// DC2 Should be Changed to 020
// While ZZZZZZZZ <= Word at XXXXXXXX turn off all codes.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("DC2")==true)
{
RAMAddress=RAMAddress.Replace("DC2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 8)
// [If Byte at address XXXXXXXX is higher than ZZ] (signed) Code
// Signed means : For bytes : values go from -128 to +127. For Halfword : values go from -32768/+32767. For Words : values go from -2147483648 to 2147483647. For exemple, for the Byte comparison, 7F (127) will be > to FF (-1).
//
elseif(RAMAddress.StartsWith("202")==true)
{
// 202 Should be Changed to 020
// If ZZ < Byte at XXXXXXXX then execute next code.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("202")==true)
{
RAMAddress=RAMAddress.Replace("202","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("602")==true)
{
// 602 Should be Changed to 020
// If ZZ < Byte at XXXXXXXX then execute next 2 codes.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("602")==true)
{
RAMAddress=RAMAddress.Replace("602","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("A02")==true)
{
// A02 Should be Changed to 020
// If ZZ < Byte at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("A02")==true)
{
RAMAddress=RAMAddress.Replace("A02","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("E02")==true)
{
// E02 Should be Changed to 020
// While ZZ => Byte at XXXXXXXX turn off all codes.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("E02")==true)
{
RAMAddress=RAMAddress.Replace("E02","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("222")==true)
{
// 222 Should be Changed to 020
// If ZZZZ < Halfword at XXXXXXXX then execute next line.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("222")==true)
{
RAMAddress=RAMAddress.Replace("222","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("622")==true)
{
// 622 Should be Changed to 020
// If ZZZZ < Halfword at XXXXXXXX then execute next 2 lines.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("622")==true)
{
RAMAddress=RAMAddress.Replace("622","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("A22")==true)
{
// A22 Should be Changed to 020
// If ZZZZ < Halfword at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("A22")==true)
{
RAMAddress=RAMAddress.Replace("A22","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("E22")==true)
{
// E22 Should be Changed to 020
// While ZZZZ => Halfword at XXXXXXXX turn off all codes.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("E22")==true)
{
RAMAddress=RAMAddress.Replace("E22","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("242")==true)
{
// 242 Should be Changed to 020
// If ZZZZ < Halfword at XXXXXXXX then execute next line.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("242")==true)
{
RAMAddress=RAMAddress.Replace("242","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("642")==true)
{
// 642 Should be Changed to 020
// If ZZZZ < Halfword at XXXXXXXX then execute next 2 lines.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("642")==true)
{
RAMAddress=RAMAddress.Replace("642","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("A42")==true)
{
// A42 Should be Changed to 020
// If ZZZZ < Halfword at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("A42")==true)
{
RAMAddress=RAMAddress.Replace("A42","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("E42")==true)
{
// E42 Should be Changed to 020
// While ZZZZ => Halfword at XXXXXXXX turn off all codes.
// XXXXXXXX 0000ZZZZ
if(RAMAddress.StartsWith("E42")==true)
{
RAMAddress=RAMAddress.Replace("E42","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 9)
// [If Value at adress XXXXXXXX is lower than...] (unsigned) Code
// Unsigned means : For bytes : values go from 0 to +255. For Halfword : values go from 0 to +65535. For Words : values go from 0 to 4294967295. For exemple, for the Byte comparison, 7F (127) will be < to FF (255).
//
//
elseif(RAMAddress.StartsWith("282")==true)
{
// 282 Should be Changed to 020
// If ZZZZZZZZ > Byte at XXXXXXXX then execute next line.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("282")==true)
{
RAMAddress=RAMAddress.Replace("282","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("682")==true)
{
// 682 Should be Changed to 020
// If ZZZZZZZZ > Byte at XXXXXXXX then execute next 2 lines.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("682")==true)
{
RAMAddress=RAMAddress.Replace("682","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("A82")==true)
{
// A82 Should be Changed to 020
// If ZZZZZZZZ > Byte at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("A82")==true)
{
RAMAddress=RAMAddress.Replace("A82","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("2A2")==true)
{
// 2A2 Should be Changed to 020
// If ZZZZZZZZ > Halfword at XXXXXXXX then execute next line.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("2A2")==true)
{
RAMAddress=RAMAddress.Replace("2A2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("6A2")==true)
{
// 6A2 Should be Changed to 020
// If ZZZZZZZZ > Halfword at XXXXXXXX then execute next 2 lines.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("6A2")==true)
{
RAMAddress=RAMAddress.Replace("6A2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("AA2")==true)
{
// AA2 Should be Changed to 020
// If ZZZZZZZZ > Halfword at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("AA2")==true)
{
RAMAddress=RAMAddress.Replace("AA2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("EA2")==true)
{
// EA2 Should be Changed to 020
// While ZZZZZZZZ <= Halfword at XXXXXXXX turn off all codes.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("EA2")==true)
{
RAMAddress=RAMAddress.Replace("EA2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("2C2")==true)
{
// 2C2 Should be Changed to 020
// If ZZZZZZZZ > Word at XXXXXXXX then execute next line.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("2C2")==true)
{
RAMAddress=RAMAddress.Replace("2C2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("6C2")==true)
{
// 6C2 Should be Changed to 020
// If ZZZZZZZZ > Word at XXXXXXXX then execute next 2 lines.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("6C2")==true)
{
RAMAddress=RAMAddress.Replace("6C2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("AC2")==true)
{
// AC2 Should be Changed to 020
// If ZZZZZZZZ > Word at XXXXXXXX then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("AC2")==true)
{
RAMAddress=RAMAddress.Replace("AC2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("EC2")==true)
{
// EC2 Should be Changed to 020
// While ZZZZZZZZ <= Word at XXXXXXXX turn off all codes.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("EC2")==true)
{
RAMAddress=RAMAddress.Replace("EC2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 10)
// [If Value at adress XXXXXXXX is higher than...] (unsigned) Code
// Unsigned means For bytes : values go from 0 to +255. For Halfword : values go from 0 to +65535. For Words : values go from 0 to 4294967295. For exemple, for the Byte comparison, 7F (127) will be < to FF (255).
elseif(RAMAddress.StartsWith("302")==true)
{
// 302 Should be Changed to 020
// If ZZZZZZZZ < Byte at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("302")==true)
{
RAMAddress=RAMAddress.Replace("302","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("702")==true)
{
// 702 Should be Changed to 020
// If ZZZZZZZZ < Byte at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("702")==true)
{
RAMAddress=RAMAddress.Replace("702","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("B02")==true)
{
// B02 Should be Changed to 020
// If ZZZZZZZZ < Byte at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("B02")==true)
{
RAMAddress=RAMAddress.Replace("B02","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("F02")==true)
{
// F02 Should be Changed to 020
// If ZZZZZZZZ < Byte at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("F02")==true)
{
RAMAddress=RAMAddress.Replace("F02","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("322")==true)
{
// 322 Should be Changed to 020
//If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("322")==true)
{
RAMAddress=RAMAddress.Replace("322","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("722")==true)
{
// 722 Should be Changed to 020
// If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("722")==true)
{
RAMAddress=RAMAddress.Replace("722","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("B22")==true)
{
// B22 Should be Changed to 020
// If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("B22")==true)
{
RAMAddress=RAMAddress.Replace("B22","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("F22")==true)
{
// F22 Should be Changed to 020
// If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("F22")==true)
{
RAMAddress=RAMAddress.Replace("F22","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("342")==true)
{
// 342 Should be Changed to 020
//If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("342")==true)
{
RAMAddress=RAMAddress.Replace("342","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("742")==true)
{
// 742 Should be Changed to 020
// If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("742")==true)
{
RAMAddress=RAMAddress.Replace("742","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("B42")==true)
{
// B42 Should be Changed to 020
// If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("B42")==true)
{
RAMAddress=RAMAddress.Replace("B42","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("F42")==true)
{
// F42 Should be Changed to 020
// If ZZZZZZZZ < Halfword at XXXXXXXX then execute next line..
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("F42")==true)
{
RAMAddress=RAMAddress.Replace("F42","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 11) If AND Code
elseif(RAMAddress.StartsWith("382")==true)
{
// 382 Should be Changed to 020
// If ZZ AND Byte at XXXXXXXX <> 0 (= True) then execute next code.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("382")==true)
{
RAMAddress=RAMAddress.Replace("382","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("782")==true)
{
// 782 Should be Changed to 020
// If ZZ AND Byte at XXXXXXXX <> 0 (= True) then execute next 2 codes.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("782")==true)
{
RAMAddress=RAMAddress.Replace("782","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("B82")==true)
{
// B82 Should be Changed to 020
// If ZZ AND Byte at XXXXXXXX <> 0 (= True) then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("B82")==true)
{
RAMAddress=RAMAddress.Replace("B82","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("F82")==true)
{
// F82 Should be Changed to 020
// While ZZ AND Byte at XXXXXXXX = 0 (= False) then turn off all codes.
// XXXXXXXX
// 000000ZZ
if(RAMAddress.StartsWith("F82")==true)
{
RAMAddress=RAMAddress.Replace("F82","020");
}
byteSize=8;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("3A2")==true)
{
// 3A2 Should be Changed to 020
// If ZZZZ AND Halfword at XXXXXXXX <> 0 (= True) then execute next code.
// XXXXXXXX
// 0000ZZZZ
if(RAMAddress.StartsWith("3A2")==true)
{
RAMAddress=RAMAddress.Replace("3A2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("7A2")==true)
{
// 7A2 Should be Changed to 020
// If ZZZZ AND Halfword at XXXXXXXX <> 0 (= True) then execute next 2 codes.
// XXXXXXXX
// 0000ZZZZ
if(RAMAddress.StartsWith("7A2")==true)
{
RAMAddress=RAMAddress.Replace("7A2","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("3C2")==true)
{
// 3C2 Should be Changed to 020
// If ZZZZZZZZ AND Word at XXXXXXXX <> 0 (= True) then execute next code.
// XXXXXXXX
// ZZZZZZZZ
if(RAMAddress.StartsWith("3C2")==true)
{
RAMAddress=RAMAddress.Replace("3C2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("7C2")==true)
{
// 7C2 Should be Changed to 020
// If ZZZZZZZZ AND Word at XXXXXXXX <> 0 (= True) then execute next 2 codes.
// XXXXXXXX
// ZZZZZZZZ
if(RAMAddress.StartsWith("7C2")==true)
{
RAMAddress=RAMAddress.Replace("7C2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("BC2")==true)
{
// BC2 Should be Changed to 020
// If ZZZZZZZZ AND Word at XXXXXXXX <> 0 (= True) then execute all following codes in the same row (else execute none of the codes below).
// XXXXXXXX
// ZZZZZZZZ
if(RAMAddress.StartsWith("BC2")==true)
{
RAMAddress=RAMAddress.Replace("BC2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("FC2")==true)
{
// FC2 Should be Changed to 020
// While ZZZZZZZZ AND Word at XXXXXXXX = 0 (= False) then turn off all codes.
// XXXXXXXX
// ZZZZZZZZ
if(RAMAddress.StartsWith("FC2")==true)
{
RAMAddress=RAMAddress.Replace("FC2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 12) "Always..." Codes
// For the "Always..." codes: -XXXXXXXX can be any authorised address BUT 00000000 (use 02000000 if you don't know what to choose). -ZZZZZZZZ can be anything. -The "y" in the code data must be in the [1-7] range (which means not 0).
//
//
elseif(RAMAddress.StartsWith("0E2")==true)
{
// 0E2 Should be Changed to 020
// Always skip next line.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("0E2")==true)
{
RAMAddress=RAMAddress.Replace("0E2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("4E2")==true)
{
// 4E2 Should be Changed to 020
// Always skip next 2 lines.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("4E2")==true)
{
RAMAddress=RAMAddress.Replace("4E2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("8E2")==true)
{
// 8E2 Should be Changed to 020
// Always Stops executing all the codes below.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("8E2")==true)
{
RAMAddress=RAMAddress.Replace("8E2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("CE2")==true)
{
// CE2 Should be Changed to 020
// Always turn off all codes.
// XXXXXXXX ZZZZZZZZ
if(RAMAddress.StartsWith("CE2")==true)
{
RAMAddress=RAMAddress.Replace("CE2","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
// 13) 1 Line Special Codes (= starting with "00000000")
MessageBox.Show("The code you entered is not needed by Bizhawk.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnneeded=true;
return;
}
// 14) 2 Lines Special Codes (= starting with '00000000' and padded (if needed) with "00000000")
// Note: You have to add the 0es manually, after clicking the "create" button.
//Ocean Prince's note:
//Several of these appear to be conflicted with above detections.
elseif(RAMAddress.StartsWith("1E2")==true)
{
// 1E2 Should be Changed to 020
// Patches ROM address (XXXXXXXX << 1) with Halfword ZZZZ. Does not work on V1/2 upgraded to V3. Only for a real V3 Hardware?
// XXXXXXXX
// 0000ZZZZ
if(RAMAddress.StartsWith("1E2")==true)
{
RAMAddress=RAMAddress.Replace("1E2","020");
}
byteSize=16;
blnActionReplayMax=true;
}
elseif(RAMAddress.StartsWith("40000000")==true)
{
// 40000000 Should be Changed to 00000000
// (SP = 0) (means : stops the "then execute all following codes in the same row" and stops the "else execute none of the codes below)".
// 00000000
// 00000000
if(RAMAddress.StartsWith("40000000")==true)
{
RAMAddress=RAMAddress.Replace("40000000","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("60000000")==true)
{
// 60000000 Should be Changed to 00000000
// (SP = 1) (means : start to execute all codes until end of codes or SP = 0). (bypass the number of codes to executes set by the master code). Should be Changed to (If SP <> 2)
// 00000000
// 00000000
if(RAMAddress.StartsWith("60000000")==true)
{
RAMAddress=RAMAddress.Replace("60000000","020");
}
byteSize=16;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
//TODO:
//Figure out how these work.
//NOTE:
//This is a Three Line Checker
#region"The Three Line Adds"
elseif(RAMAddress.StartsWith("8022")==true)
{
// 802 Should be Changed to 020
// Writes Byte YY at address XXXXXXXX. Then makes YY = YY + Z1, XXXXXXXX = XXXXXXXX + Z3Z3, Z2 = Z2 - 1, and repeats until Z2 < 0.
// XXXXXXXX
// 000000YY
// Z1Z2Z3Z3
if(RAMAddress.StartsWith("8022")==true)
{
RAMAddress=RAMAddress.Replace("8022","0200");
}
byteSize=8;
MessageBox.Show("Sorry, this tool does not support 8022 codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
blnUnhandled=true;
return;
}
//I Don't get what this is doing.
elseif(RAMAddress.StartsWith("8222")==true)
{
// 822 Should be Changed to 020
// Writes Halfword YYYY at address XXXXXXXX. Then makes YYYY = YYYY + Z1, XXXXXXXX = XXXXXXXX + Z3Z3*2,
// XXXXXXXX
// 0000YYYY
// Z1Z2Z3Z3
if(RAMAddress.StartsWith("8222")==true)
{
RAMAddress=RAMAddress.Replace("8222","0200");
}
byteSize=16;
MessageBox.Show("Sorry, this tool does not support 8222 codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("842")==true)
{
// 842 Should be Changed to 020
// Writes Word YYYYYYYY at address XXXXXXXX. Then makes YYYYYYYY = YYYYYYYY + Z1, XXXXXXXX = XXXXXXXX + Z3Z3*4, Z2 = Z2 - 1, and repeats until Z2<0.
// XXXXXXXX
// YYYYYYYY
// Z1Z2Z3Z3
// WARNING: There is a BUG on the REAL AR (v2 upgraded to v3, and maybe on real v3) with the 32Bits Increment Slide code. You HAVE to add a code (best choice is 80000000 00000000 : add 0 to value at address 0) right after it, else the AR will erase the 2 last 8 digits lines of the 32 Bits Inc. Slide code when you enter it !!!
if(RAMAddress.StartsWith("842")==true)
{
RAMAddress=RAMAddress.Replace("842","020");
}
byteSize=32;
MessageBox.Show("Sorry, this tool does not support 8222 codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
blnUnhandled=true;
return;
}
#endregion
// 15) Special Codes
// -Master Code-
// address to patch AND $1FFFFFE Should be Changed to address to patch
// Master Code settings.
// XXXXXXXX
// 0000YYYY
//
elseif(RAMValue.StartsWith("001DC0DE")==true)
{
// -ID Code-
// Word at address 080000AC
// Must always be 001DC0DE
// XXXXXXXX
// 001DC0DE
if(RAMValue.StartsWith("001DC0DE")==true)
{
RAMValue=RAMValue.Replace("001DC0DE","020");
}
byteSize=32;
MessageBox.Show("The code you entered is not needed by Bizhawk.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnneeded=true;
return;
}
elseif(RAMAddress.StartsWith("DEADFACE")==true)
{
// -DEADFACE-
// New Encryption seed.
// DEADFACE
// 0000XXXX
MessageBox.Show("Sorry, this tool does not support DEADFACE codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
blnUnhandled=true;
return;
}
elseif(blnActionReplayMax==false)
{
//Is it a bad code? Check the others.
blnActionReplayMax=false;
}
return;
}
publicvoidGBACodeBreaker()
{
//These checks are done on the DECYPTED code, not the Encrypted one.
//'y' is the CBA Code Handler Store Address(0 - 7)[address = ((d << 0x16) + 0x08000100)]
//1000 - 32 - bit Long - Branch Type(Thumb)
//2000 - 32 - bit Long - Branch Type(ARM)
//3000 - 8 - bit(?) Long - Branch Type(Thumb)
//4000 - 8 - bit(?) Long - Branch Type(ARM)
//0020 - Unknown(Odd Effect)
MessageBox.Show("The code you entered is not needed by Bizhawk.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnneeded=true;
return;
}
elseif(RAMAddress.StartsWith("3")==true)
{
//8 - Bit Constant RAM Write
//3aaaaaaa 00yy
//Continuosly writes the 8 - Bit value specified by 'yy' to address aaaaaaa.
RAMAddress=RAMAddress.Remove(0,1);
byteSize=16;
}
elseif(RAMAddress.StartsWith("4")==true)
{
//Slide Code
//4aaaaaaa yyyy
//xxxxxxxx iiii
//This is one of those two - line codes.The "yyyy" set is the data to store at the address (aaaaaaa), with xxxxxxxx being the number of addresses to store to, and iiii being the value to increment the addresses by. The codetype is usually use to fill memory with a certain value.
RAMAddress=RAMAddress.Remove(0,1);
byteSize=32;
MessageBox.Show("Sorry, this tool does not support 4 codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("6")==true)
{
//16 - Bit Logical AND
//6aaaaaaa yyyy
//Performs the AND function on the address provided with the value provided. I'm not going to explain what AND does, so if you'd like to know I suggest you see the instruction manual for a graphing calculator.
//This is another advanced code type you'll probably never need to use.
//Ocean Prince's note:
//AND means "If ALL conditions are True then Do"
//I don't understand how this would be applied/works. Samples are requested.
MessageBox.Show("Sorry, this tool does not support 6 codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("7")==true)
{
//16 - Bit 'If Equal To' Activator
//7aaaaaaa yyyy
//If the value at the specified RAM address(aaaaaaa) is equal to yyyy value, active the code on the next line.
byteSize=32;
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("8")==true)
{
//16 - Bit Constant RAM Write
//8aaaaaaa yyyy
//Continuosly writes yyyy values to the specified RAM address(aaaaaaa).
//Continuosly writes the 8 - Bit value specified by 'yy' to address aaaaaaa.
RAMAddress=RAMAddress.Remove(0,1);
byteSize=32;
}
elseif(RAMAddress.StartsWith("9")==true)
{
//Change Encryption Seeds
//9yyyyyyy yyyy
//(When 1st Code Only!)
//Works like the DEADFACE on GSA.Changes the encryption seeds used for the rest of the codes.
MessageBox.Show("Sorry, this tool does not support 9 codes.","Tool error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
byteSize=32;
blnUnhandled=true;
return;
}
elseif(RAMAddress.StartsWith("A")==true)
{
//16 - Bit 'If Not Equal' Activator
//Axxxxxxx yyyy
//Basicly the opposite of an 'If Equal To' Activator.Activates the code on the next line if address xxxxxxx is NOT equal to yyyy
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
blnUnhandled=true;
byteSize=32;
return;
}
elseif(RAMAddress.StartsWith("D00000")==true)
{
//16 - Bit Conditional RAM Write
//D00000xx yyyy
//No Description available at this time.
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
MessageBox.Show("All Genesis Game Genie Codes need to contain a dash after the fourth character","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
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);
return;
}
//Problem: I don't know what the Non-FF Style codes are.
//TODO: Fix that.
if(SingleCheat.StartsWith("FF")==false)
{
MessageBox.Show("This Action Replay Code, is not understood by this tool.","Tool Error",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
return;
}
//Now to do some work.
//Determine Length, to Determine Byte Size
parseString=SingleCheat.Remove(0,2);
switch(SingleCheat.Length)
{
case9:
//Sample Code of 1-Byte:
//FFF761:64
//Becomes:
//Address: F761
//Value: 64
RAMAddress=parseString.Remove(4,3);
RAMValue=parseString.Remove(0,5);
byteSize=1;
break;
case11:
//Sample Code of 2-Byte:
//FFF761:6411
//Becomes:
//Address: F761
//Value: 6411
RAMAddress=parseString.Remove(4,5);
RAMValue=parseString.Remove(0,5);
byteSize=2;
break;
default:
//We could have checked above but here is fine, since it's a quick check due to one of three possibilities.
MessageBox.Show("All Genesis Action Replay/Pro Action Replay Codes need to be either 9 or 11 characters in length","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
//Try and add.
try
{
//A Watch needs to be generated so we can make a cheat out of that. This is due to how the Cheat engine works.
//System Bus Domain, The Address to Watch, Byte size (Byte), Hex Display, Description, Big Endian.
//These codes, more or less work without Needing much work.
if(SingleCheat.IndexOf(" ")!=8)
{
MessageBox.Show("All N64 GameShark Codes need to contain a space after the eighth character","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
if(SingleCheat.Length!=13)
{
MessageBox.Show("All N64 GameShark Codes need to be 13 characters in length.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
//We need to determine what kind of cheat this is.
//I need to determine if this is a Byte or Word.
switch(testo)
{
//80 and 81 are the most common, so let's not get all worried.
case"80":
//Byte
byteSize=8;
break;
case"81":
//Word
byteSize=16;
break;
//Case A0 and A1 means "Write to Uncached address.
case"A0":
//Byte
byteSize=8;
break;
case"A1":
//Word
byteSize=16;
break;
//Do we support the GameShark Button? No. But these cheats, can be toggled. Which "Counts"
//<Ocean_Prince> Consequences be damned!
case"88":
//Byte
byteSize=8;
break;
case"89":
//Word
byteSize=16;
break;
//These are compare Address X to Value Y, then apply Value B to Address A
//This is not supported, yet
//TODO: When BizHawk supports a compare RAM Address's value is true then apply a value to another address, make it a thing.
case"D0":
//Byte
case"D1":
//Word
case"D2":
//Byte
case"D3":
//Word
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
//These codes are for Disabling the Expansion Pak. that's a bad thing? Assuming bad codes, until told otherwise.
case"EE":
case"DD":
case"CC":
MessageBox.Show("The code you entered is for Disabling the Expansion Pak. This is not allowed by this tool.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
//Enable Code
//Not Necessary? Think so?
case"DE":
//Single Write ON-Boot code.
//Not Necessary? Think so?
case"F0":
case"F1":
case"2A":
case"3C":
case"FF":
MessageBox.Show("The code you entered is not needed by Bizhawk.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
//TODO: Make Patch Code (5000XXYY) work.
case"50":
//Word?
MessageBox.Show("The code you entered is not supported by this tool. Please Submit the Game's Name, Cheat/Code and Purpose to the BizHawk forums.","Tool Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
//I hope this isn't a thing.
default:
MessageBox.Show("The GameShark code entered is not a recognized format.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
//Leave this Method, before someone gets hurt.
return;
}
//Now to get clever.
//Sample Input for N64:
//8133B21E 08FF
//Becomes:
//Address 33B21E
//Value 08FF
//Note, 80XXXXXX 00YY
//Is Byte, not Word
//Remove the 80 Octect
parseString=SingleCheat.Remove(0,2);
//Get RAM Address
RAMAddress=parseString.Remove(6,5);
//Get RAM Value
RAMValue=parseString.Remove(0,7);
try
{
//A Watch needs to be generated so we can make a cheat out of that. This is due to how the Cheat engine works.
//System Bus Domain, The Address to Watch, Byte size (Word), Hex Display, Description, Big Endian.
//These codes, more or less work without Needing much work.
if(SingleCheat.IndexOf(" ")!=8)
{
MessageBox.Show("All PSX GameShark Codes need to contain a space after the eighth character","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
if(SingleCheat.Length!=13)
{
MessageBox.Show("All PSX GameShark Cheats need to be 13 characters in length.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
//We need to determine what kind of cheat this is.
//I need to determine if this is a Byte or Word.
switch(testo)
{
//30 80 Cheats mean, "Write, don't care otherwise."
case"30":
byteSize=8;
break;
case"80":
byteSize=16;
break;
//When value hits YYYY, make the next cheat go off
case"E0":
//E0 byteSize = 8;
case"E1":
//E1 byteSize = 8;
case"E2":
//E2 byteSize = 8;
case"D0":
//D0 byteSize = 16;
case"D1":
//D1 byteSize = 16;
case"D2":
//D2 byteSize = 16;
case"D3":
//D3 byteSize = 16;
case"D4":
//D4 byteSize = 16;
case"D5":
//D5 byteSize = 16;
case"D6":
//D6 byteSize = 16;
//Increment/Decrement Codes
case"10":
//10 byteSize = 16;
case"11":
//11 byteSize = 16;
case"20":
//20 byteSize = 8
case"21":
//21 byteSize = 8
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
case"C0":
case"C1":
//Slow-Mo
case"40":
MessageBox.Show("The code you entered is not needed by Bizhawk.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
case"C2":
case"50":
//Word?
MessageBox.Show("The code you entered is not supported by this tool. Please Submit the Game's Name, Cheat/Code and Purpose to the BizHawk forums.","Tool Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
//Something wrong with their input.
default:
MessageBox.Show("The GameShark code entered is not a recognized format.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
//Leave this Method, before someone gets hurt.
return;
}
//Sample Input for PSX:
//800D10BA 0009
//Address: 0D10BA
//Value: 0009
//Remove first two octets
parseString=SingleCheat.Remove(0,2);
//Get RAM Address
RAMAddress=parseString.Remove(6,5);
//Get RAM Value
RAMValue=parseString.Remove(0,7);
try
{
//A Watch needs to be generated so we can make a cheat out of that. This is due to how the Cheat engine works.
//System Bus Domain, The Address to Watch, Byte size (Word), Hex Display, Description. Big Endian.
//My Consern is that Work RAM High may be incorrect?
MessageBox.Show("All Saturn GameShark Codes need to contain a space after the eighth character","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
if(SingleCheat.Length!=13)
{
MessageBox.Show("All Saturn GameShark Cheats need to be 13 characters in length.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
//This is a special test. Only the first character really matters? 16 or 36?
testo=testo.Remove(1,1);
switch(testo)
{
case"1":
byteSize=16;
break;
case"3":
byteSize=8;
break;
//0 writes once.
case"0":
//D is RAM Equal To Activator, do Next Value
case"D":
MessageBox.Show("The code you entered is not supported by BizHawk.","Emulator Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
case"F":
MessageBox.Show("The code you entered is not needed by Bizhawk.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Information);
return;
default:
MessageBox.Show("The GameShark code entered is not a recognized format.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
//Leave this Method, before someone gets hurt.
return;
}
//Sample Input for Saturn:
//160949FC 0090
//Address: 0949FC
//Value: 90
//Note, 3XXXXXXX are Big Endian
//Remove first two octets
parseString=SingleCheat.Remove(0,2);
//Get RAM Address
RAMAddress=parseString.Remove(6,5);
//Get RAM Value
RAMValue=parseString.Remove(0,7);
try
{
//A Watch needs to be generated so we can make a cheat out of that. This is due to how the Cheat engine works.
//System Bus Domain, The Address to Watch, Byte size (Word), Hex Display, Description. Big Endian.
//My Consern is that Work RAM High may be incorrect?
MessageBox.Show("All Master System Game Geneie Codes need to have a dash after the third character and seventh character.","Input Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
try
{
//A Watch needs to be generated so we can make a cheat out of that. This is due to how the Cheat engine works.
//System Bus Domain, The Address to Watch, Byte size (Byte), Hex Display, Description. Not Big Endian.