GBA: Fix loading multiboot ELF files (fixes #1949)

This commit is contained in:
Vicki Pfau 2020-11-24 01:38:41 -08:00
parent f7749b31de
commit b8e5b47c80
2 changed files with 7 additions and 1 deletions

View File

@ -63,6 +63,7 @@ Other fixes:
- 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)

View File

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