DS Slot-1: Emulate secure area lockout

This commit is contained in:
Vicki Pfau 2017-03-21 23:39:56 -07:00
parent 1b0d74f3dc
commit b41073bda3
1 changed files with 4 additions and 0 deletions

View File

@ -132,6 +132,10 @@ static void DSSlot1StartTransfer(struct DS* ds) {
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);
}