mirror of https://github.com/mgba-emu/mgba.git
GBA Cheats: Totally ignore ROM patch limits for GameShark too (closes #990)
This commit is contained in:
parent
0e738e8cc5
commit
1b601d005e
|
@ -93,6 +93,7 @@ void GBACheatSetGameSharkVersion(struct GBACheatSet* cheats, enum GBACheatGameSh
|
||||||
bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t op2) {
|
bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t op2) {
|
||||||
enum GBAGameSharkType type = op1 >> 28;
|
enum GBAGameSharkType type = op1 >> 28;
|
||||||
struct mCheat* cheat = 0;
|
struct mCheat* cheat = 0;
|
||||||
|
int romPatch = 0;
|
||||||
|
|
||||||
if (cheats->incompleteCheat != COMPLETE) {
|
if (cheats->incompleteCheat != COMPLETE) {
|
||||||
struct mCheat* incompleteCheat = mCheatListGetPointer(&cheats->d.list, cheats->incompleteCheat);
|
struct mCheat* incompleteCheat = mCheatListGetPointer(&cheats->d.list, cheats->incompleteCheat);
|
||||||
|
@ -148,10 +149,16 @@ bool GBACheatAddGameSharkRaw(struct GBACheatSet* cheats, uint32_t op1, uint32_t
|
||||||
cheats->incompleteCheat = mCheatListIndex(&cheats->d.list, cheat);
|
cheats->incompleteCheat = mCheatListIndex(&cheats->d.list, cheat);
|
||||||
break;
|
break;
|
||||||
case GSA_PATCH:
|
case GSA_PATCH:
|
||||||
cheats->romPatches[0].address = BASE_CART0 | ((op1 & 0xFFFFFF) << 1);
|
while (cheats->romPatches[romPatch].exists) {
|
||||||
cheats->romPatches[0].newValue = op2;
|
++romPatch;
|
||||||
cheats->romPatches[0].applied = false;
|
if (romPatch >= MAX_ROM_PATCHES) {
|
||||||
cheats->romPatches[0].exists = true;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cheats->romPatches[romPatch].address = BASE_CART0 | ((op1 & 0xFFFFFF) << 1);
|
||||||
|
cheats->romPatches[romPatch].newValue = op2;
|
||||||
|
cheats->romPatches[romPatch].applied = false;
|
||||||
|
cheats->romPatches[romPatch].exists = true;
|
||||||
return true;
|
return true;
|
||||||
case GSA_BUTTON:
|
case GSA_BUTTON:
|
||||||
switch (op1 & 0x00F00000) {
|
switch (op1 & 0x00F00000) {
|
||||||
|
|
Loading…
Reference in New Issue