mirror of https://github.com/mgba-emu/mgba.git
Reset timers when enabling them (fixes #78)
This commit is contained in:
parent
2693f9d09b
commit
e5245b6cbb
|
@ -434,6 +434,7 @@ void GBATimerWriteTMCNT_HI(struct GBA* gba, int timer, uint16_t control) {
|
||||||
}
|
}
|
||||||
gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->reload;
|
gba->memory.io[(REG_TM0CNT_LO + (timer << 2)) >> 1] = currentTimer->reload;
|
||||||
currentTimer->oldReload = currentTimer->reload;
|
currentTimer->oldReload = currentTimer->reload;
|
||||||
|
currentTimer->lastEvent = 0;
|
||||||
gba->timersEnabled |= 1 << timer;
|
gba->timersEnabled |= 1 << timer;
|
||||||
} else if (wasEnabled && !currentTimer->enable) {
|
} else if (wasEnabled && !currentTimer->enable) {
|
||||||
if (!currentTimer->countUp) {
|
if (!currentTimer->countUp) {
|
||||||
|
|
Loading…
Reference in New Issue