all repos — mgba @ be59a220fbf3165855ffc8e8d22396193d54cd35

mGBA Game Boy Advance Emulator

GBA Cheats: Slightly improve PARv3 detection
Vicki Pfau vi@endrift.com
Fri, 29 Sep 2017 21:51:57 -0700
commit

be59a220fbf3165855ffc8e8d22396193d54cd35

parent

1f771ca390d3c8ac7bbb429458b03a7be4595b95

1 files changed, 8 insertions(+), 1 deletions(-)

jump to
M src/gba/cheats/parv3.csrc/gba/cheats/parv3.c

@@ -284,6 +284,10 @@ cheat->type = CHEAT_ASSIGN;

cheat->address = BASE_IO | (op1 & OFFSET_MASK); break; } + if (op1 & 0x01000000 && (op1 & 0xFE000000) != 0xC6000000) { + return false; + } + cheat->width = width; cheat->operand = op2 & (0xFFFFFFFFU >> ((4 - width) * 8));

@@ -385,10 +389,13 @@ case PAR3_BASE_ADD:

if (op2 & ~((1 << width) - 1)) { probability -= 0x10; } + // Fall through case PAR3_BASE_ASSIGN: case PAR3_BASE_INDIRECT: probability += GBACheatAddressIsReal(address); - // Fall through + if (op1 & 0x01000000) { + return 0; + } break; case PAR3_BASE_OTHER: break;