Fixed a stray return; in the OPL code and a fatal flaw in my own timer API where timers were not being disabled if period is 0.0.
This commit is contained in:
@@ -175,8 +175,6 @@ opl_write(opl_t *dev, uint16_t port, uint8_t val)
|
|||||||
|
|
||||||
if (!(dev->flags & FLAG_OPL3))
|
if (!(dev->flags & FLAG_OPL3))
|
||||||
dev->port &= 0x00ff;
|
dev->port &= 0x00ff;
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -233,6 +233,8 @@ timer_advance_ex(pc_timer_t *timer, int start)
|
|||||||
} else {
|
} else {
|
||||||
if (timer->period > 0.0)
|
if (timer->period > 0.0)
|
||||||
timer_do_period(timer, (uint64_t) (timer->period * ((double) TIMER_USEC)), start);
|
timer_do_period(timer, (uint64_t) (timer->period * ((double) TIMER_USEC)), start);
|
||||||
|
else
|
||||||
|
timer_disable(timer);
|
||||||
timer->period = 0.0;
|
timer->period = 0.0;
|
||||||
timer->flags &= ~TIMER_SPLIT;
|
timer->flags &= ~TIMER_SPLIT;
|
||||||
}
|
}
|
||||||
@@ -256,5 +258,8 @@ timer_on_auto(pc_timer_t *timer, double period)
|
|||||||
if (!timer_inited || (timer == NULL))
|
if (!timer_inited || (timer == NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (period > 0.0)
|
||||||
timer_on(timer, period, (timer->period == 0.0));
|
timer_on(timer, period, (timer->period == 0.0));
|
||||||
|
else
|
||||||
|
timer_stop(timer);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user