From e5245b6cbb2e582dc07769e65a8cfb409169db3b Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 2 Jul 2014 00:48:20 -0700 Subject: [PATCH] Reset timers when enabling them (fixes #78) --- src/gba/gba.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gba/gba.c b/src/gba/gba.c index 46cf99a36..9a7a0b509 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -434,6 +434,7 @@ void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) { } gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->reload; currentTimer->oldReload = currentTimer->reload; + currentTimer->lastEvent = 0; gba->timersEnabled |= 1 << timer; } else if (wasEnabled && !currentTimer->enable) { if (!currentTimer->countUp) {