all repos — mgba @ 2693f9d09b92c1c85788ce53fb27e2fee16c33f9

mGBA Game Boy Advance Emulator

Implement high VRAM mirroring for writes
Jeffrey Pfau jeffrey@endrift.com
Tue, 01 Jul 2014 00:26:57 -0700
commit

2693f9d09b92c1c85788ce53fb27e2fee16c33f9

parent

a7eced1324432de36c24f2b62ae87bb3ac0892c5

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

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