From 13a77ea3fff2da06b208c5f42016e171ac3dc53a Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 3 Apr 2015 23:51:36 -0700 Subject: [PATCH] GBA: Fix timers not updating timing when writing to only the reload register --- CHANGES | 4 ++++ src/gba/gba.c | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 9ac3b743e..e5f7882c6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +0.3.0: (Future) +Bugfixes: + - GBA: Fix timers not updating timing when writing to only the reload register + 0.2.0: (2015-04-03) Features: - Support for gamepad axes, e.g. analog sticks or triggers diff --git a/src/gba/gba.c b/src/gba/gba.c index e0cac779d..fbf38f06a 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -434,6 +434,7 @@ void GBATimerUpdateRegister(struct GBA* gba, int timer) { void GBATimerWriteTMCNT_LO(struct GBA* gba, int timer, uint16_t reload) { gba->timers[timer].reload = reload; + gba->timers[timer].overflowInterval = (0x10000 - gba->timers[timer].reload) << gba->timers[timer].prescaleBits; } void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) {