mirror of https://github.com/mgba-emu/mgba.git
GBA: Fix multiboot loading resulting in too small WRAM
This commit is contained in:
parent
870c375cf6
commit
bcf0e8ec59
1
CHANGES
1
CHANGES
|
@ -48,6 +48,7 @@ Bugfixes:
|
||||||
- Test: Fix crash when loading invalid file
|
- Test: Fix crash when loading invalid file
|
||||||
- GBA Hardware: Fix crash if a savestate lies about game hardware
|
- GBA Hardware: Fix crash if a savestate lies about game hardware
|
||||||
- Test: Fix crash when fuzzing fails to load a file
|
- Test: Fix crash when fuzzing fails to load a file
|
||||||
|
- GBA: Fix multiboot loading resulting in too small WRAM
|
||||||
Misc:
|
Misc:
|
||||||
- SDL: Remove scancode key input
|
- SDL: Remove scancode key input
|
||||||
- GBA Video: Clean up unused timers
|
- GBA Video: Clean up unused timers
|
||||||
|
|
|
@ -297,14 +297,9 @@ bool GBALoadMB(struct GBA* gba, struct VFile* vf) {
|
||||||
gba->pristineRomSize = SIZE_WORKING_RAM;
|
gba->pristineRomSize = SIZE_WORKING_RAM;
|
||||||
}
|
}
|
||||||
gba->isPristine = true;
|
gba->isPristine = true;
|
||||||
#ifdef _3DS
|
gba->memory.wram = anonymousMemoryMap(SIZE_WORKING_RAM);
|
||||||
if (gba->pristineRomSize <= romBufferSize) {
|
memset(gba->memory.wram, 0, SIZE_WORKING_RAM);
|
||||||
gba->memory.wram = romBuffer;
|
vf->read(vf, gba->memory.wram, gba->pristineRomSize);
|
||||||
vf->read(vf, romBuffer, gba->pristineRomSize);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
gba->memory.wram = vf->map(vf, gba->pristineRomSize, MAP_READ);
|
|
||||||
#endif
|
|
||||||
if (!gba->memory.wram) {
|
if (!gba->memory.wram) {
|
||||||
mLOG(GBA, WARN, "Couldn't map ROM");
|
mLOG(GBA, WARN, "Couldn't map ROM");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue