GBA Memory: Fix AGBPrint writing past 16MB ROMs
Vicki Pfau vi@endrift.com
Wed, 24 Feb 2021 18:44:41 -0800
2 files changed,
2 insertions(+),
2 deletions(-)
M
include/mgba/internal/gba/memory.h
→
include/mgba/internal/gba/memory.h
@@ -85,7 +85,7 @@ AGB_PRINT_BASE = 0x00FD0000,
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);
M
src/gba/memory.c
→
src/gba/memory.c
@@ -313,7 +313,7 @@ cpu->memory.activeMask = memory->romMask;
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;