all repos — mgba @ dbef26759cdf27bd60ca603c76b415150cc89840

mGBA Game Boy Advance Emulator

GB MBC: Support 4MB MBC30 ROMs (fixes #1713)
Vicki Pfau vi@endrift.com
Wed, 13 May 2020 20:11:10 -0700
commit

dbef26759cdf27bd60ca603c76b415150cc89840

parent

a405ec42b46099ad050735ab797ca55f75dbdb64

2 files changed, 5 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -6,6 +6,7 @@ Emulation fixes:

- ARM: Fix ALU reading PC after shifting - ARM: Fix STR storing PC after address calculation - GB: Fix GBC game registers after skipping BIOS + - GB MBC: Support 4MB MBC30 ROMs (fixes mgba.io/i/1713) - GB Video: Fix state after skipping BIOS (fixes mgba.io/i/1715 and mgba.io/i/1716) - GB Video: Fix BGPS value after skipping BIOS (fixes mgba.io/i/1717) - GBA: Add missing RTC overrides for Legendz games
M src/gb/mbc.csrc/gb/mbc.c

@@ -518,7 +518,7 @@ }

void _GBMBC3(struct GB* gb, uint16_t address, uint8_t value) { struct GBMemory* memory = &gb->memory; - int bank = value & 0x7F; + int bank = value; switch (address >> 13) { case 0x0: switch (value) {

@@ -536,6 +536,9 @@ break;

} break; case 0x1: + if (gb->memory.romSize < GB_SIZE_CART_BANK0 * 0x80) { + bank &= 0x7F; + } if (!bank) { ++bank; }