GB Timer: Fix order-of-operations between & and +
Vicki Pfau vi@endrift.com
Thu, 29 Jun 2017 19:00:10 -0700
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
src/gb/timer.c
→
src/gb/timer.c
@@ -74,7 +74,7 @@ _GBTimerDivIncrement(timer, (timer->p->cpu->executionState + 1) & 3);
if (timer->internalDiv & (timer->timaPeriod >> 1)) { ++timer->p->memory.io[REG_TIMA]; if (!timer->p->memory.io[REG_TIMA]) { - mTimingSchedule(&timer->p->timing, &timer->irq, 4 - (timer->p->cpu->executionState + 1) & 3); + mTimingSchedule(&timer->p->timing, &timer->irq, 4 - ((timer->p->cpu->executionState + 1) & 3)); } } timer->p->memory.io[REG_DIV] = 0;