GB Memory: VRAM access

This commit is contained in:
Jeffrey Pfau 2016-01-19 22:09:11 -08:00
parent dabc92bf5f
commit 5fb2cfde1d
1 changed files with 4 additions and 3 deletions

View File

@ -134,8 +134,7 @@ uint8_t GBLoad8(struct LR35902Core* cpu, uint16_t address) {
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 @@ void GBStore8(struct LR35902Core* cpu, uint16_t address, int8_t 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: