From 3034253e53528d1772a808b2155aedcea9285de8 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 8 Feb 2017 23:49:42 -0800 Subject: [PATCH] GBA Timers: Fix timer count when disabling (fixes #519) --- src/gba/timer.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gba/timer.c b/src/gba/timer.c index 49722ed4d..c62f64506 100644 --- a/src/gba/timer.c +++ b/src/gba/timer.c @@ -132,9 +132,6 @@ void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) { currentTimer->lastEvent = gba->timing.masterCycles + gba->cpu->cycles; } else if (wasEnabled && !GBATimerFlagsIsEnable(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); - if (!GBATimerFlagsIsCountUp(currentTimer->flags)) { - gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->oldReload + ((gba->cpu->cycles - currentTimer->lastEvent) >> oldPrescale); - } } else if (GBATimerFlagsIsEnable(currentTimer->flags) && GBATimerFlagsGetPrescaleBits(currentTimer->flags) != oldPrescale && !GBATimerFlagsIsCountUp(currentTimer->flags)) { mTimingDeschedule(&gba->timing, ¤tTimer->event); mTimingSchedule(&gba->timing, ¤tTimer->event, currentTimer->overflowInterval - currentTimer->lastEvent);