all repos — mgba @ 16131c9702ca1469008f2263dc990be369049b09

mGBA Game Boy Advance Emulator

GBA Memory: More AGBPrint fixes
Vicki Pfau vi@endrift.com
Thu, 04 Jan 2018 21:08:40 -0800
commit

16131c9702ca1469008f2263dc990be369049b09

parent

a8394913dcf70b73c32e5f6ef25b53445c1fad2a

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/gba/memory.csrc/gba/memory.c

@@ -1649,6 +1649,7 @@ } else {

value &= 0xFF; } oolBuf[i] = value; + oolBuf[i + 1] = 0; ++gba->memory.agbPrintCtx.get; } _agbPrintStore(gba, AGB_PRINT_STRUCT + 4, gba->memory.agbPrintCtx.get);

@@ -1670,6 +1671,9 @@ if (memory->romSize == SIZE_CART0) {

_pristineCow(gba); memcpy(&memory->rom[AGB_PRINT_FLUSH_ADDR >> 2], _agbPrintFunc, sizeof(_agbPrintFunc)); STORE_16(value, address & (SIZE_CART0 - 2), memory->rom); + } else if (memory->agbPrintCtx.bank == 0xFD && memory->romSize >= SIZE_CART0 / 2) { + _pristineCow(gba); + STORE_16(value, address & (SIZE_CART0 / 2 - 2), memory->rom); } }