DS Memory: Add WRAM to DS7Load8

This commit is contained in:
Jeffrey Pfau 2017-01-04 00:46:29 -08:00
parent 750d3444a0
commit 616fa3956e
1 changed files with 7 additions and 0 deletions

View File

@ -300,6 +300,13 @@ uint32_t DS7Load8(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
int wait = ds->ds7.memory.waitstatesNonseq16[address >> DS_BASE_OFFSET];
switch (address >> DS_BASE_OFFSET) {
case DS_REGION_WORKING_RAM:
if (address >= DS7_BASE_WORKING_RAM || !ds->memory.wramSize7) {
value = ((uint8_t*) memory->wram7)[address & (DS7_SIZE_WORKING_RAM - 1)];
} else {
value = ((uint8_t*) memory->wram)[address & (ds->memory.wramSize7 - 1)];
}
break;
case DS_REGION_RAM:
if ((address & (DS_SIZE_RAM - 1)) < DS_SIZE_RAM) {
value = ((uint8_t*) memory->ram)[address & (DS_SIZE_RAM - 1)];