GBA: Fix loading multiboot ELF files (fixes #1949)
Vicki Pfau vi@endrift.com
Tue, 24 Nov 2020 01:38:41 -0800
2 files changed,
7 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.c
→
src/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