Write to VRAM
Jeffrey Pfau jeffrey@endrift.com
Mon, 22 Apr 2013 01:59:25 -0700
1 files changed,
7 insertions(+),
0 deletions(-)
jump to
M
src/gba/gba-memory.c
→
src/gba/gba-memory.c
@@ -292,6 +292,10 @@ gbaMemory->p->video.palette[(address & (SIZE_PALETTE_RAM - 1)) >> 1] = value;
gbaMemory->p->video.palette[((address & (SIZE_PALETTE_RAM - 1)) >> 1) + 1] = value >> 16; break; case BASE_VRAM: + if ((address & OFFSET_MASK) < SIZE_VRAM - 2) { + gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1] = value; + gbaMemory->p->video.vram[((address & 0x0001FFFF) >> 1) + 1] = value >> 16; + } break; case BASE_OAM: break;@@ -323,6 +327,9 @@ case BASE_PALETTE_RAM:
gbaMemory->p->video.palette[(address & (SIZE_PALETTE_RAM - 1)) >> 1] = value; break; case BASE_VRAM: + if ((address & OFFSET_MASK) < SIZE_VRAM) { + gbaMemory->p->video.vram[(address & 0x0001FFFF) >> 1] = value; + } break; case BASE_OAM: break;