Timers can (of course) expire during CPU instruction execution.

Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
Adrian.Conlon 2017-08-31 17:21:44 +01:00
parent 406e651c66
commit a2784ae02d

View File

@ -180,7 +180,7 @@ void EightBit::Bus::checkTimer(int cycles) {
if (timerEnabled()) {
m_timerCounter -= cycles;
if (m_timerCounter <= 0) {
m_timerCounter = m_timerRate;
m_timerCounter += m_timerRate;
incrementTIMA();
}
}