all repos — mgba @ 2b2a037de53880aacfff17d8dadbcf54ccf226e9

mGBA Game Boy Advance Emulator

GBA Memory: Writable OBJ area depends on mode
Jeffrey Pfau jeffrey@endrift.com
Sat, 14 Nov 2015 12:00:58 -0800
commit

2b2a037de53880aacfff17d8dadbcf54ccf226e9

parent

e3f66ba458d33334d59f70d33ae24fb1b55c8b52

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

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

@@ -818,7 +818,7 @@ case REGION_PALETTE_RAM:

GBAStore16(cpu, address & ~1, ((uint8_t) value) | ((uint8_t) value << 8), cycleCounter); break; case REGION_VRAM: - if ((address & 0x0001FFFF) >= 0x00010000) { + if ((address & 0x0001FFFF) >= ((GBARegisterDISPCNTGetMode(gba->memory.io[REG_DISPCNT >> 1]) == 4) ? 0x00014000 : 0x00010000)) { // TODO: check BG mode GBALog(gba, GBA_LOG_GAME_ERROR, "Cannot Store8 to OBJ: 0x%08X", address); break;