all repos — mgba @ 5fb2cfde1db99c351986488955301bfb7766d224

mGBA Game Boy Advance Emulator

GB Memory: VRAM access
Jeffrey Pfau jeffrey@endrift.com
Tue, 19 Jan 2016 22:09:11 -0800
commit

5fb2cfde1db99c351986488955301bfb7766d224

parent

dabc92bf5feefc988393431e38ec6cb6c7df1f45

1 files changed, 4 insertions(+), 3 deletions(-)

jump to
M src/gb/memory.csrc/gb/memory.c

@@ -134,8 +134,7 @@ case GB_REGION_CART_BANK1 + 3:

return memory->romBank[address & (GB_SIZE_CART_BANK0 - 1)]; case GB_REGION_VRAM: case GB_REGION_VRAM + 1: - // TODO - return 0; + return gb->video.vram[address & (GB_SIZE_VRAM - 1)]; case GB_REGION_EXTERNAL_RAM: case GB_REGION_EXTERNAL_RAM + 1: // TODO

@@ -183,7 +182,9 @@ memory->mbc(memory, address, value);

return; case GB_REGION_VRAM: case GB_REGION_VRAM + 1: - // TODO + // TODO: Block access in wrong modes + gb->video.vram[address & (GB_SIZE_VRAM - 1)] = value; + gb->video.renderer->writeVRAM(gb->video.renderer, address & (GB_SIZE_VRAM - 1)); return; case GB_REGION_EXTERNAL_RAM: case GB_REGION_EXTERNAL_RAM + 1: