mirror of https://github.com/mgba-emu/mgba.git
GB MBC: Improve multicart detection heuristic (fixes #1177)
This commit is contained in:
parent
9f1b2e9d1d
commit
5d8e77d967
1
CHANGES
1
CHANGES
|
@ -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)
|
||||
|
|
16
src/gb/mbc.c
16
src/gb/mbc.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue