GB MBC: Improve multicart detection heuristic (fixes #1177)

This commit is contained in:
Vicki Pfau 2018-09-20 11:56:52 -07:00
parent 9f1b2e9d1d
commit 5d8e77d967
2 changed files with 14 additions and 3 deletions

View File

@ -57,6 +57,7 @@ Bugfixes:
- GBA DMA: Fix temporal sorting of DMAs of different priorities
- FFmpeg: Fix encoding audio/video queue issues
- GB Serialize: Fix IRQ pending/EI pending confusion
- GB MBC: Improve multicart detection heuristic (fixes mgba.io/i/1177)
Misc:
- GBA Timer: Use global cycles for timers
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)

View File

@ -95,17 +95,27 @@ void GBMBCSwitchHalfBank(struct GB* gb, int half, int bank) {
}
static bool _isMulticart(const uint8_t* mem) {
bool success = true;
bool success;
struct VFile* vf;
vf = VFileFromConstMemory(&mem[GB_SIZE_CART_BANK0 * 0x10], 1024);
success = success && GBIsROM(vf);
success = GBIsROM(vf);
vf->close(vf);
if (!success) {
return false;
}
vf = VFileFromConstMemory(&mem[GB_SIZE_CART_BANK0 * 0x20], 1024);
success = success && GBIsROM(vf);
success = GBIsROM(vf);
vf->close(vf);
if (!success) {
vf = VFileFromConstMemory(&mem[GB_SIZE_CART_BANK0 * 0x30], 1024);
success = GBIsROM(vf);
vf->close(vf);
}
return success;
}