all repos — mgba @ 3034253e53528d1772a808b2155aedcea9285de8

mGBA Game Boy Advance Emulator

GBA Timers: Fix timer count when disabling (fixes #519)
Vicki Pfau vi@endrift.com
Wed, 08 Feb 2017 23:49:42 -0800
commit

3034253e53528d1772a808b2155aedcea9285de8

parent

3ac0b20ff86438bcea93ad610aeef184781fa9e3

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

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

@@ -132,9 +132,6 @@ currentTimer->oldReload = currentTimer->reload;

currentTimer->lastEvent = gba->timing.masterCycles + gba->cpu->cycles; } else if (wasEnabled && !GBATimerFlagsIsEnable(currentTimer->flags)) { mTimingDeschedule(&gba->timing, &currentTimer->event); - if (!GBATimerFlagsIsCountUp(currentTimer->flags)) { - gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->oldReload + ((gba->cpu->cycles - currentTimer->lastEvent) >> oldPrescale); - } } else if (GBATimerFlagsIsEnable(currentTimer->flags) && GBATimerFlagsGetPrescaleBits(currentTimer->flags) != oldPrescale && !GBATimerFlagsIsCountUp(currentTimer->flags)) { mTimingDeschedule(&gba->timing, &currentTimer->event); mTimingSchedule(&gba->timing, &currentTimer->event, currentTimer->overflowInterval - currentTimer->lastEvent);