GBA: Fix expected entry point for multiboot ELFs (fixes #2450)

This commit is contained in:
Vicki Pfau 2022-02-18 22:14:16 -08:00
parent c22aaadf7f
commit 65baf03353
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
0.9.4: (Future)
Emulation fixes:
- GB Serialize: Fix loading MBC1 states that affect bank 0 (fixes mgba.io/i/2402)
- GBA: Fix expected entry point for multiboot ELFs (fixes mgba.io/i/2450)
- GBA I/O: Disable open bus behavior on invalid register 06A
- GBA Video: Ignore horizontally off-screen sprite timing (fixes mgba.io/i/2391)
- GBA Video: Fix rare crash in modes 3-5

View File

@ -579,7 +579,7 @@ bool GBAIsROM(struct VFile* vf) {
uint32_t entry = ELFEntry(elf);
bool isGBA = true;
isGBA = isGBA && ELFMachine(elf) == EM_ARM;
isGBA = isGBA && (entry == BASE_CART0 || entry == BASE_WORKING_RAM);
isGBA = isGBA && (entry == BASE_CART0 || entry == BASE_WORKING_RAM + 0xC0);
ELFClose(elf);
return isGBA;
}
@ -638,7 +638,7 @@ bool GBAIsMB(struct VFile* vf) {
#ifdef USE_ELF
struct ELF* elf = ELFOpen(vf);
if (elf) {
bool isMB = ELFEntry(elf) == BASE_WORKING_RAM;
bool isMB = ELFEntry(elf) == BASE_WORKING_RAM + 0xC0;
ELFClose(elf);
return isMB;
}