From 50b3bf750e2071edebd29f5fc0780b981dfd047f Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 17 Jan 2015 02:21:49 -0800 Subject: [PATCH] GBA: Fix timers 2 and 3 updating incorrectly --- CHANGES | 1 + src/gba/gba.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 130a95568..19b276359 100644 --- a/CHANGES +++ b/CHANGES @@ -36,6 +36,7 @@ Bugfixes: - GBA Video: Fix mode 0 being able to read tiles above appropriate tile range - GBA Audio: Properly initialize audio FIFO channels - Util: Fix SOCKET_FAILED macro + - GBA: Fix timers 2 and 3 updating incorrectly Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it diff --git a/src/gba/gba.c b/src/gba/gba.c index 6fd93360c..e376e901c 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -349,7 +349,6 @@ static int32_t GBATimersProcessEvents(struct GBA* gba, int32_t cycles) { if (timer->enable) { timer->nextEvent -= cycles; timer->lastEvent -= cycles; - nextEvent = timer->nextEvent; if (timer->nextEvent <= 0) { timer->lastEvent = timer->nextEvent; timer->nextEvent += timer->overflowInterval; @@ -381,7 +380,6 @@ static int32_t GBATimersProcessEvents(struct GBA* gba, int32_t cycles) { if (timer->enable) { timer->nextEvent -= cycles; timer->lastEvent -= cycles; - nextEvent = timer->nextEvent; if (timer->nextEvent <= 0) { timer->lastEvent = timer->nextEvent; timer->nextEvent += timer->overflowInterval;