Revenge of the son of the bride of ambiguity

See also some of higan's recent commits.
This commit is contained in:
Kawa 2020-06-08 20:33:59 +02:00
parent f98cb01d0a
commit bbcdddfcd1
1 changed files with 9 additions and 9 deletions

View File

@ -296,7 +296,7 @@ auto CheatEditor::synchronizeCodes() -> void {
auto CheatEditor::decodeSNES(string& code) -> bool {
//Game Genie
if(code.size() == 9 && code[4] == '-') {
if(code.size() == 9 && code[4u] == '-') {
//strip '-'
code = {code.slice(0, 4), code.slice(5, 4)};
//validate
@ -345,7 +345,7 @@ auto CheatEditor::decodeSNES(string& code) -> bool {
}
//higan: address=data
if(code.size() == 9 && code[6] == '=') {
if(code.size() == 9 && code[6u] == '=') {
string nibbles = {code.slice(0, 6), code.slice(7, 2)};
//validate
for(uint n : nibbles) {
@ -358,7 +358,7 @@ auto CheatEditor::decodeSNES(string& code) -> bool {
}
//higan: address=compare?data
if(code.size() == 12 && code[6] == '=' && code[9] == '?') {
if(code.size() == 12 && code[6u] == '=' && code[9u] == '?') {
string nibbles = {code.slice(0, 6), code.slice(7, 2), code.slice(10, 2)};
//validate
for(uint n : nibbles) {
@ -382,7 +382,7 @@ auto CheatEditor::decodeGB(string& code) -> bool {
};
//Game Genie
if(code.size() == 7 && code[3] == '-') {
if(code.size() == 7 && code[3u] == '-') {
code = {code.slice(0, 3), code.slice(4, 3)};
//validate
for(uint n : code) {
@ -397,7 +397,7 @@ auto CheatEditor::decodeGB(string& code) -> bool {
}
//Game Genie
if(code.size() == 11 && code[3] == '-' && code[7] == '-') {
if(code.size() == 11 && code[3u] == '-' && code[7u] == '-') {
code = {code.slice(0, 3), code.slice(4, 3), code.slice(8, 3)};
//validate
for(uint n : code) {
@ -424,8 +424,8 @@ auto CheatEditor::decodeGB(string& code) -> bool {
}
//first two characters are the code type / VRAM bank, which is almost always 01.
//other values are presumably supported, but I have no info on them, so they're not supported.
if(code[0] != '0') return false;
if(code[1] != '1') return false;
if(code[0u] != '0') return false;
if(code[1u] != '1') return false;
uint data = toHex(code.slice(2, 2));
uint16_t address = toHex(code.slice(4, 4));
address = address >> 8 | address << 8;
@ -434,7 +434,7 @@ auto CheatEditor::decodeGB(string& code) -> bool {
}
//higan: address=data
if(code.size() == 7 && code[4] == '=') {
if(code.size() == 7 && code[4u] == '=') {
string nibbles = {code.slice(0, 4), code.slice(5, 2)};
//validate
for(uint n : nibbles) {
@ -447,7 +447,7 @@ auto CheatEditor::decodeGB(string& code) -> bool {
}
//higan: address=compare?data
if(code.size() == 10 && code[4] == '=' && code[7] == '?') {
if(code.size() == 10 && code[4u] == '=' && code[7u] == '?') {
string nibbles = {code.slice(0, 4), code.slice(5, 2), code.slice(8, 2)};
//validate
for(uint n : nibbles) {