all repos — mgba @ 3ec4c79e12d24b128bd24a440df8fbc350c65140

mGBA Game Boy Advance Emulator

GB: Fix DIV reset
Jeffrey Pfau jeffrey@endrift.com
Thu, 28 Jan 2016 00:00:19 -0800
commit

3ec4c79e12d24b128bd24a440df8fbc350c65140

parent

5d8f676bb0c51fba3fa4073ec033f4c25428a886

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

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

@@ -48,7 +48,7 @@ }

void GBTimerDivReset(struct GBTimer* timer) { timer->p->memory.io[REG_DIV] = 0; - timer->nextDiv = timer->eventDiff + GB_DMG_DIV_PERIOD; + timer->nextDiv = timer->eventDiff + timer->p->cpu->cycles + GB_DMG_DIV_PERIOD; timer->nextEvent = timer->nextTima; if (timer->nextDiv < timer->nextEvent) { timer->nextEvent = timer->nextDiv;