all repos — mgba @ e5245b6cbb2e582dc07769e65a8cfb409169db3b

mGBA Game Boy Advance Emulator

Reset timers when enabling them (fixes #78)
Jeffrey Pfau jeffrey@endrift.com
Wed, 02 Jul 2014 00:48:20 -0700
commit

e5245b6cbb2e582dc07769e65a8cfb409169db3b

parent

2693f9d09b92c1c85788ce53fb27e2fee16c33f9

1 files changed, 1 insertions(+), 0 deletions(-)

jump to
M src/gba/gba.csrc/gba/gba.c

@@ -434,6 +434,7 @@ currentTimer->nextEvent = INT_MAX;

} 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) {