all repos — mgba @ 67007ee002cc9c487e820bf820c8e329590a3d1c

mGBA Game Boy Advance Emulator

Fix 8-bit VRAM writes
Jeffrey Pfau jeffrey@endrift.com
Sun, 13 Oct 2013 15:23:39 -0700
commit

67007ee002cc9c487e820bf820c8e329590a3d1c

parent

ee44e2ac89d90979f8451672c4e0298438a3715d

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

jump to
M src/gba/gba-memory.csrc/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);