DS Slot-1: Emulate secure area lockout
Vicki Pfau vi@endrift.com
Tue, 21 Mar 2017 23:39:56 -0700
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
src/ds/slot1.c
→
src/ds/slot1.c
@@ -132,6 +132,10 @@ ds->memory.slot1.address = ds->memory.slot1.command[1] << 24;
ds->memory.slot1.address |= ds->memory.slot1.command[2] << 16; ds->memory.slot1.address |= ds->memory.slot1.command[3] << 8; ds->memory.slot1.address |= ds->memory.slot1.command[4]; + if (ds->memory.slot1.address < 0x8000) { + mLOG(DS_SLOT1, GAME_ERROR, "Invalid read from secure area: %04X", ds->memory.slot1.address); + ds->memory.slot1.address = 0x8000 + (ds->memory.slot1.address & 0x1FF); + } if (ds->romVf) { ds->romVf->seek(ds->romVf, ds->memory.slot1.address, SEEK_SET); }