Fix 8-bit VRAM writes
Jeffrey Pfau jeffrey@endrift.com
Sun, 13 Oct 2013 15:23:39 -0700
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-memory.c
→
src/gba/gba-memory.c
@@ -458,7 +458,8 @@ // TODO: check BG mode
GBALog(gbaMemory->p, GBA_LOG_GAME_ERROR, "Cannot Store8 to OBJ: 0x%08X", address); break; } - gbaMemory->p->video.renderer->vram[(address >> 1) & 0xFFFF] = (value) | (value << 8); + ((int8_t*) gbaMemory->p->video.renderer->vram)[address & 0x1FFFE] = value; + ((int8_t*) gbaMemory->p->video.renderer->vram)[(address & 0x1FFFE) | 1] = value; break; case BASE_OAM: GBALog(gbaMemory->p, GBA_LOG_GAME_ERROR, "Cannot Store8 to OAM: 0x%08X", address);