Implement high VRAM mirroring for writes
Jeffrey Pfau jeffrey@endrift.com
Tue, 01 Jul 2014 00:26:57 -0700
1 files changed,
5 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-memory.c
→
src/gba/gba-memory.c
@@ -378,8 +378,10 @@ gba->video.renderer->writePalette(gba->video.renderer, (address & (SIZE_PALETTE_RAM - 1)) + 2, value >> 16);
gba->video.renderer->writePalette(gba->video.renderer, address & (SIZE_PALETTE_RAM - 1), value); break; case BASE_VRAM: - if ((address & OFFSET_MASK) < SIZE_VRAM - 2) { + if ((address & OFFSET_MASK) < SIZE_VRAM) { STORE_32(value, address & 0x0001FFFF, gba->video.renderer->vram); + } else if ((address & OFFSET_MASK) < 0x00020000) { + STORE_32(value, address & 0x00017FFF, gba->video.renderer->vram); } break; case BASE_OAM:@@ -427,6 +429,8 @@ break;
case BASE_VRAM: if ((address & OFFSET_MASK) < SIZE_VRAM) { STORE_16(value, address & 0x0001FFFF, gba->video.renderer->vram); + } else if ((address & OFFSET_MASK) < 0x00020000) { + STORE_16(value, address & 0x00017FFF, gba->video.renderer->vram); } break; case BASE_OAM: