all repos — mgba @ b8e5b47c80d1780ddb22508fa7a8bb2c5870cec9

mGBA Game Boy Advance Emulator

GBA: Fix loading multiboot ELF files (fixes #1949)
Vicki Pfau vi@endrift.com
Tue, 24 Nov 2020 01:38:41 -0800
commit

b8e5b47c80d1780ddb22508fa7a8bb2c5870cec9

parent

f7749b31de8611caa04c1fe1f281fc37a9e758b5

2 files changed, 7 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -63,6 +63,7 @@ - Debugger: Fix change watchpoints (fixes mgba.io/i/1947)

- FFmpeg: Fix some small memory leaks - FFmpeg: Fix encoding of time base - GB Video: Fix SGB video logs + - GBA: Fix loading multiboot ELF files (fixes mgba.io/i/1949) - mGUI: Don't attempt to preload files larger than can fit in RAM - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) - Qt: Fix static compilation in MinGW (fixes mgba.io/i/1769)
M src/gba/core.csrc/gba/core.c

@@ -487,9 +487,14 @@ static bool _GBACoreLoadROM(struct mCore* core, struct VFile* vf) {

#ifdef USE_ELF struct ELF* elf = ELFOpen(vf); if (elf) { - GBALoadNull(core->board); + if (ELFEntry(elf) == BASE_CART0) { + GBALoadNull(core->board); + } bool success = mCoreLoadELF(core, elf); ELFClose(elf); + if (success) { + vf->close(vf); + } return success; } #endif