mirror of https://github.com/mgba-emu/mgba.git
GBA: Fix patching being incompatible with GBAUnloadROM
This commit is contained in:
parent
2346c2355a
commit
68790c1b2a
|
@ -435,10 +435,10 @@ void GBALoadBIOS(struct GBA* gba, struct VFile* vf) {
|
|||
|
||||
void GBAApplyPatch(struct GBA* gba, struct Patch* patch) {
|
||||
size_t patchedSize = patch->outputSize(patch, gba->memory.romSize);
|
||||
if (!patchedSize) {
|
||||
if (!patchedSize || patchedSize > SIZE_CART0) {
|
||||
return;
|
||||
}
|
||||
gba->memory.rom = anonymousMemoryMap(patchedSize);
|
||||
gba->memory.rom = anonymousMemoryMap(SIZE_CART0);
|
||||
if (!patch->applyPatch(patch, gba->pristineRom, gba->pristineRomSize, gba->memory.rom, patchedSize)) {
|
||||
mappedMemoryFree(gba->memory.rom, patchedSize);
|
||||
gba->memory.rom = gba->pristineRom;
|
||||
|
|
Loading…
Reference in New Issue