From 32618a5b1d7fd6fcf010ffe81085b5caebe26caa Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 29 Jun 2017 19:00:10 -0700 Subject: [PATCH] GB Timer: Fix order-of-operations between & and + --- src/gb/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gb/timer.c b/src/gb/timer.c index 3729e313f28..ad9e6c788b8 100644 --- a/src/gb/timer.c +++ b/src/gb/timer.c @@ -74,7 +74,7 @@ void GBTimerDivReset(struct GBTimer* timer) { 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;