DS Memory: Fix VRAM LDM/STM

This commit is contained in:
Vicki Pfau 2017-03-16 09:41:47 -07:00
parent eafcb0f555
commit 15478c1dc2
1 changed files with 8 additions and 8 deletions

View File

@ -1248,11 +1248,11 @@ uint32_t DS9LoadMultiple(struct ARMCore* cpu, uint32_t address, int mask, enum L
case DS_REGION_VRAM: case DS_REGION_VRAM:
LDM_LOOP(unsigned mask = _selectVRAM(memory, address >> DS_VRAM_OFFSET); LDM_LOOP(unsigned mask = _selectVRAM(memory, address >> DS_VRAM_OFFSET);
value = 0; value = 0;
int i = 0; int j = 0;
for (i = 0; i < 9; ++i) { for (j = 0; j < 9; ++j) {
if (mask & (1 << i)) { if (mask & (1 << j)) {
uint32_t newValue; uint32_t newValue;
LOAD_32(newValue, address & _vramMask[i], memory->vramBank[i]); LOAD_32(newValue, address & _vramMask[j], memory->vramBank[j]);
value |= newValue; value |= newValue;
} }
}); });
@ -1344,10 +1344,10 @@ uint32_t DS9StoreMultiple(struct ARMCore* cpu, uint32_t address, int mask, enum
break; break;
case DS_REGION_VRAM: case DS_REGION_VRAM:
STM_LOOP(unsigned mask = _selectVRAM(memory, address >> DS_VRAM_OFFSET); STM_LOOP(unsigned mask = _selectVRAM(memory, address >> DS_VRAM_OFFSET);
int i = 0; int j = 0;
for (i = 0; i < 9; ++i) { for (j = 0; j < 9; ++j) {
if (mask & (1 << i)) { if (mask & (1 << j)) {
STORE_32(value, address & _vramMask[i], memory->vramBank[i]); STORE_32(value, address & _vramMask[j], memory->vramBank[j]);
} }
}); });
break; break;