all repos — mgba @ 3d39e2a04186f859d4350b29f7ffa5650845b548

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

3d39e2a04186f859d4350b29f7ffa5650845b548

parent

9ebc7541d0b6832c61054fd3dfb344fc752a250e

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;