DS Memory: Fix uninitialized values in DS*LoadMultiple
Vicki Pfau vi@endrift.com
Fri, 07 Apr 2017 15:46:01 -0700
1 files changed,
5 insertions(+),
1 deletions(-)
jump to
M
src/ds/memory.c
→
src/ds/memory.c
@@ -656,6 +656,7 @@ case DS_REGION_VRAM:
LDM_LOOP(if (address < 0x06040000 && memory->vram7[(address & 0x3FFFF) >> 17]) { LOAD_32(value, address & 0x1FFFF, memory->vram7[(address & 0x3FFFF) >> 17]); } else { + value = 0; mLOG(DS_MEM, STUB, "Unimplemented DS7 LDM: %08X", address); }); break;@@ -1271,13 +1272,15 @@ case DS9_REGION_ITCM_MIRROR:
LDM_LOOP(if (address < memory->itcmSize) { LOAD_32(value, address & (DS9_SIZE_ITCM - 1), memory->itcm); } else { - mLOG(DS_MEM, STUB, "Bad DS9 LDM: %08X:%08X", address, value); + value = 0; + mLOG(DS_MEM, STUB, "Bad DS9 LDM: %08X", address); }); break; case DS_REGION_WORKING_RAM: LDM_LOOP(if (ds->memory.wramSize9) { LOAD_32(value, address & (ds->memory.wramSize9 - 4), memory->wramBase9); } else { + value = 0; mLOG(DS_MEM, STUB, "Bad DS9 LDM: %08X", address); }); break;@@ -1287,6 +1290,7 @@ LOAD_32(value, address & (DS9_SIZE_DTCM - 1), memory->dtcm);
} else if ((address & (DS_SIZE_RAM - 1)) < DS_SIZE_RAM) { LOAD_32(value, address & (DS_SIZE_RAM - 1), memory->ram); } else { + value = 0; mLOG(DS_MEM, STUB, "Unimplemented DS9 LDM: %08X", address); }); break;