GBA Cheats: Fix cheats setting the Action Replay version

This commit is contained in:
Jeffrey Pfau 2016-01-24 14:23:59 -08:00
parent b2850af002
commit 15dadb8387
3 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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);
}