DS Memory: Allow jumping to VRAM
Vicki Pfau vi@endrift.com
Thu, 06 Apr 2017 14:56:20 -0700
1 files changed,
16 insertions(+),
0 deletions(-)
jump to
M
src/ds/memory.c
→
src/ds/memory.c
@@ -786,6 +786,22 @@ cpu->memory.activeSeqCycles16 = 0;
cpu->memory.activeNonseqCycles32 = 0; cpu->memory.activeNonseqCycles16 = 0; return; + case DS_REGION_VRAM: + if (address >= 0x06800000) { + unsigned mask = _selectVRAM(&ds->memory, address >> DS_VRAM_OFFSET); + if (mask) { + int i = 0; + for (i = 0; i < 9; ++i) { + if (mask & (1 << i)) { + cpu->memory.activeRegion = (uint32_t*) ds->memory.vramBank[i]; + cpu->memory.activeMask = _vramMask[i]; + break; + } + } + break; + } + } + // Fall through default: jump_error: memory->activeRegion = -1;