DS Memory: Add WRAM to DS7Store8

This commit is contained in:
Vicki Pfau 2017-01-30 16:17:13 -08:00
parent 3679e1e8d6
commit 793cad8f30
1 changed files with 7 additions and 0 deletions

View File

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