mirror of https://github.com/mgba-emu/mgba.git
GBA Cheats: Let VBA-style codes patch ROM (fixes #3423)
This commit is contained in:
parent
332b1b8bc3
commit
406a202157
1
CHANGES
1
CHANGES
|
@ -3,6 +3,7 @@ Other fixes:
|
||||||
- ARM Debugger: Fix disassembly of ror r0 barrel shift (fixes mgba.io/i/3412)
|
- ARM Debugger: Fix disassembly of ror r0 barrel shift (fixes mgba.io/i/3412)
|
||||||
- FFmpeg: Fix failing to record videos with CRF video (fixes mgba.io/i/3368)
|
- FFmpeg: Fix failing to record videos with CRF video (fixes mgba.io/i/3368)
|
||||||
- GB Core: Fix cloning savedata when backing file is outdated (fixes mgba.io/i/3388)
|
- GB Core: Fix cloning savedata when backing file is outdated (fixes mgba.io/i/3388)
|
||||||
|
- GBA Cheats: Let VBA-style codes patch ROM (fixes mgba.io/i/3423)
|
||||||
- GBA Core: Fix booting into BIOS when skip BIOS is enabled
|
- GBA Core: Fix booting into BIOS when skip BIOS is enabled
|
||||||
- GBA Hardware: Fix loading states unconditionally overwriting GPIO memory
|
- GBA Hardware: Fix loading states unconditionally overwriting GPIO memory
|
||||||
Misc:
|
Misc:
|
||||||
|
|
|
@ -180,14 +180,25 @@ bool GBACheatAddVBALine(struct GBACheatSet* cheats, const char* line) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mCheat* cheat = mCheatListAppend(&cheats->d.list);
|
if (address < BASE_CART0 || address >= BASE_CART_SRAM) {
|
||||||
cheat->address = address;
|
struct mCheat* cheat = mCheatListAppend(&cheats->d.list);
|
||||||
cheat->operandOffset = 0;
|
memset(cheat, 0, sizeof(*cheat));
|
||||||
cheat->addressOffset = 0;
|
cheat->address = address;
|
||||||
cheat->repeat = 1;
|
cheat->operandOffset = 0;
|
||||||
cheat->type = CHEAT_ASSIGN;
|
cheat->addressOffset = 0;
|
||||||
cheat->width = width;
|
cheat->repeat = 1;
|
||||||
cheat->operand = value;
|
cheat->type = CHEAT_ASSIGN;
|
||||||
|
cheat->width = width;
|
||||||
|
cheat->operand = value;
|
||||||
|
} else {
|
||||||
|
struct mCheatPatch* patch = mCheatPatchListAppend(&cheats->d.romPatches);
|
||||||
|
memset(patch, 0, sizeof(*patch));
|
||||||
|
patch->width = width;
|
||||||
|
patch->address = address;
|
||||||
|
patch->segment = 0;
|
||||||
|
patch->value = value;
|
||||||
|
patch->check = false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue