all repos — mgba @ 1e017ade23e1bac555f84d4283cfc13ab532bed8

mGBA Game Boy Advance Emulator

GBA Memory: Fix AGBPrint writing past 16MB ROMs
Vicki Pfau vi@endrift.com
Wed, 24 Feb 2021 18:44:41 -0800
commit

1e017ade23e1bac555f84d4283cfc13ab532bed8

parent

938f2a49244e249282cb567bdc536f09610d69ff

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

jump to
M include/mgba/internal/gba/memory.hinclude/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.csrc/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;