From a2784ae02d640e896cb123095d570415b27b8c8a Mon Sep 17 00:00:00 2001 From: "Adrian.Conlon" Date: Thu, 31 Aug 2017 17:21:44 +0100 Subject: [PATCH] Timers can (of course) expire during CPU instruction execution. Signed-off-by: Adrian.Conlon --- LR35902/src/Bus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LR35902/src/Bus.cpp b/LR35902/src/Bus.cpp index ab473ea..5767797 100644 --- a/LR35902/src/Bus.cpp +++ b/LR35902/src/Bus.cpp @@ -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(); } }