Skip to content

Commit

Permalink
GB Timer: Fix order-of-operations between & and +
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Jun 30, 2017
1 parent 15243a6 commit 32618a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gb/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 32618a5

Please sign in to comment.