mirror of https://github.com/mgba-emu/mgba.git
GB Timer: Fix order-of-operations between & and +
This commit is contained in:
parent
15243a6ae9
commit
32618a5b1d
|
@ -74,7 +74,7 @@ void GBTimerDivReset(struct GBTimer* timer) {
|
||||||
if (timer->internalDiv & (timer->timaPeriod >> 1)) {
|
if (timer->internalDiv & (timer->timaPeriod >> 1)) {
|
||||||
++timer->p->memory.io[REG_TIMA];
|
++timer->p->memory.io[REG_TIMA];
|
||||||
if (!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;
|
timer->p->memory.io[REG_DIV] = 0;
|
||||||
|
|
Loading…
Reference in New Issue