all repos — mgba @ bcf0e8ec59be807073ba95a1561b74b5fea9dbcd

mGBA Game Boy Advance Emulator

GBA: Fix multiboot loading resulting in too small WRAM
Vicki Pfau vi@endrift.com
Tue, 25 Apr 2017 11:58:05 -0700
commit

bcf0e8ec59be807073ba95a1561b74b5fea9dbcd

parent

870c375cf61ddf416c88141d9d7bc9a63acf4d99

2 files changed, 4 insertions(+), 8 deletions(-)

jump to
M CHANGESCHANGES

@@ -48,6 +48,7 @@ - Core: Fix crash with rewind if savestates shrink

- Test: Fix crash when loading invalid file - GBA Hardware: Fix crash if a savestate lies about game hardware - Test: Fix crash when fuzzing fails to load a file + - GBA: Fix multiboot loading resulting in too small WRAM Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers
M src/gba/gba.csrc/gba/gba.c

@@ -297,14 +297,9 @@ if (gba->pristineRomSize > SIZE_WORKING_RAM) {

gba->pristineRomSize = SIZE_WORKING_RAM; } gba->isPristine = true; -#ifdef _3DS - if (gba->pristineRomSize <= romBufferSize) { - gba->memory.wram = romBuffer; - vf->read(vf, romBuffer, gba->pristineRomSize); - } -#else - gba->memory.wram = vf->map(vf, gba->pristineRomSize, MAP_READ); -#endif + gba->memory.wram = anonymousMemoryMap(SIZE_WORKING_RAM); + memset(gba->memory.wram, 0, SIZE_WORKING_RAM); + vf->read(vf, gba->memory.wram, gba->pristineRomSize); if (!gba->memory.wram) { mLOG(GBA, WARN, "Couldn't map ROM"); return false;