DS Memory: Allow 8-bit reads from VRAM
Vicki Pfau vi@endrift.com
Mon, 06 Mar 2017 14:21:00 -0800
1 files changed,
10 insertions(+),
0 deletions(-)
jump to
M
src/ds/memory.c
→
src/ds/memory.c
@@ -967,6 +967,16 @@ mLOG(DS_MEM, STUB, "Unimplemented DS9 Load8: %08X", address);
case DS_REGION_IO: value = (DS9IORead(ds, address & 0xFFFE) >> ((address & 0x0001) << 3)) & 0xFF; break; + case DS_REGION_VRAM: { + unsigned mask = _selectVRAM(memory, address >> DS_VRAM_OFFSET); + int i = 0; + for (i = 0; i < 9; ++i) { + if (mask & (1 << i)) { + value |= ((uint8_t*) memory->vramBank[i])[address & _vramMask[i]]; + } + } + break; + } case DS9_REGION_BIOS: // TODO: Fix undersized BIOS // TODO: Fix masking