GBA Timer: Minor cleanup
Vicki Pfau vi@endrift.com
Sat, 18 Jul 2020 02:22:56 -0700
1 files changed,
1 insertions(+),
4 deletions(-)
jump to
M
src/gba/timer.c
→
src/gba/timer.c
@@ -8,8 +8,6 @@
#include <mgba/internal/gba/gba.h> #include <mgba/internal/gba/io.h> -#define REG_TMCNT_LO(X) (REG_TM0CNT_LO + ((X) << 2)) - static void GBATimerIrq(struct GBA* gba, int timerId, uint32_t cyclesLate) { struct GBATimer* timer = &gba->timers[timerId]; if (GBATimerFlagsIsDoIrq(timer->flags)) {@@ -131,7 +129,6 @@ int32_t tickIncrement = currentTime - timer->lastEvent;
timer->lastEvent = currentTime; tickIncrement >>= prescaleBits; tickIncrement += *io; - *io = tickIncrement; while (tickIncrement >= 0x10000) { tickIncrement -= 0x10000 - timer->reload; }@@ -171,7 +168,7 @@ break;
} prescaleBits += timer->forcedPrescale; timer->flags = GBATimerFlagsSetPrescaleBits(timer->flags, prescaleBits); - timer->flags = GBATimerFlagsTestFillCountUp(timer->flags, timer > 0 && (control & 0x0004)); + timer->flags = GBATimerFlagsTestFillCountUp(timer->flags, timer > 0 && (control & 0x0004)); // TODO: Need timer ID timer->flags = GBATimerFlagsTestFillDoIrq(timer->flags, control & 0x0040); bool wasEnabled = GBATimerFlagsIsEnable(timer->flags); timer->flags = GBATimerFlagsTestFillEnable(timer->flags, control & 0x0080);