diff --git a/CHANGES b/CHANGES index 7cbbdf521..3b21347f0 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,7 @@ Bugfixes: - Debugger: Fix watchpoints in gdb - ARM7: Fix decoding of some ARM ALU instructions with shifters - Qt: Fix keys being mapped incorrectly when loading configuration file + - GBA Cheats: Fix cheats setting the Action Replay version Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper diff --git a/src/gba/cheats/gameshark.c b/src/gba/cheats/gameshark.c index 996de638d..3f54df670 100644 --- a/src/gba/cheats/gameshark.c +++ b/src/gba/cheats/gameshark.c @@ -75,12 +75,14 @@ void GBACheatReseedGameShark(uint32_t* seeds, uint16_t params, const uint8_t* t1 } void GBACheatSetGameSharkVersion(struct GBACheatSet* cheats, int version) { - cheats->gsaVersion = 1; + cheats->gsaVersion = version; switch (version) { case 1: + case 2: memcpy(cheats->gsaSeeds, GBACheatGameSharkSeeds, 4 * sizeof(uint32_t)); break; case 3: + case 4: memcpy(cheats->gsaSeeds, GBACheatProActionReplaySeeds, 4 * sizeof(uint32_t)); break; } @@ -198,9 +200,11 @@ bool GBACheatAddGameShark(struct GBACheatSet* set, uint32_t op1, uint32_t op2) { switch (set->gsaVersion) { case 0: case 3: + case 4: GBACheatSetGameSharkVersion(set, 1); // Fall through case 1: + case 2: GBACheatDecryptGameShark(&o1, &o2, set->gsaSeeds); return GBACheatAddGameSharkRaw(set, o1, o2); } diff --git a/src/gba/cheats/parv3.c b/src/gba/cheats/parv3.c index c5e01b66d..b355a18b0 100644 --- a/src/gba/cheats/parv3.c +++ b/src/gba/cheats/parv3.c @@ -298,9 +298,11 @@ bool GBACheatAddProActionReplay(struct GBACheatSet* set, uint32_t op1, uint32_t switch (set->gsaVersion) { case 0: case 1: + case 2: GBACheatSetGameSharkVersion(set, 3); // Fall through case 3: + case 4: GBACheatDecryptGameShark(&o1, &o2, set->gsaSeeds); return GBACheatAddProActionReplayRaw(set, o1, o2); }