all repos — mgba @ 811ada598e2ba8595e114f5026328a95b2717bcd

mGBA Game Boy Advance Emulator

GBA: Fix timer initialization
Jeffrey Pfau jeffrey@endrift.com
Fri, 27 Mar 2015 01:34:49 -0700
commit

811ada598e2ba8595e114f5026328a95b2717bcd

parent

4b957cb66d51cec6dd99d2c753a20d00529cfd5b

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

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

@@ -464,7 +464,7 @@ currentTimer->nextEvent = INT_MAX;

} gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->reload; currentTimer->oldReload = currentTimer->reload; - currentTimer->lastEvent = 0; + currentTimer->lastEvent = gba->cpu->cycles; gba->timersEnabled |= 1 << timer; } else if (wasEnabled && !currentTimer->enable) { if (!currentTimer->countUp) {