GBA Memory: Fix AGBPrint writing past 16MB ROMs

This commit is contained in:
Vicki Pfau 2021-02-24 18:44:41 -08:00
parent 938f2a4924
commit 1e017ade23
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ enum {
AGB_PRINT_TOP = 0x00FE0000,
AGB_PRINT_PROTECT = 0x00FE2FFE,
AGB_PRINT_STRUCT = 0x00FE20F8,
AGB_PRINT_FLUSH_ADDR = 0x01FE209C,
AGB_PRINT_FLUSH_ADDR = 0x00FE209C,
};
mLOG_DECLARE_CATEGORY(GBA_MEM);

View File

@ -313,7 +313,7 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
if ((address & (SIZE_CART0 - 1)) < memory->romSize) {
break;
}
if ((address & (SIZE_CART0 - 1)) == AGB_PRINT_FLUSH_ADDR && memory->agbPrintProtect == 0x20) {
if ((address & 0x00FFFFFE) == AGB_PRINT_FLUSH_ADDR && memory->agbPrintProtect == 0x20) {
cpu->memory.activeRegion = &_agbPrintFunc;
cpu->memory.activeMask = sizeof(_agbPrintFunc) - 1;
break;