GB: fix problems with STOP opcode? maybe? maybe not?

This commit is contained in:
goyuken 2014-02-01 03:45:28 +00:00
parent 3497e28f96
commit 239ce987da
2 changed files with 5 additions and 2 deletions

View File

@ -322,11 +322,14 @@ unsigned long Memory::stop(unsigned long cycleCounter) {
intreq.setEventTime<END>(cycleCounter + (isDoubleSpeed() ?
(intreq.eventTime(END) - cycleCounter) << 1 : (intreq.eventTime(END) - cycleCounter) >> 1));
}
// when switching speed, it seems that the CPU spontaneously restarts soon?
// otherwise, the cpu should be allowed to stay halted as long as needed
// so only execute this line when switching speed
intreq.setEventTime<UNHALT>(cycleCounter + 0x20000 + isDoubleSpeed() * 8);
}
intreq.halt();
intreq.setEventTime<UNHALT>(cycleCounter + 0x20000 + isDoubleSpeed() * 8);
return cycleCounter;
}

Binary file not shown.