Timer improvements for emulated printers

This commit is contained in:
Cacodemon345
2025-07-06 01:21:34 +06:00
parent f36be5ea4e
commit 9cad5f501b
3 changed files with 48 additions and 0 deletions

View File

@@ -1906,6 +1906,13 @@ strobe(uint8_t old, uint8_t val, void *priv)
/* Process incoming character. */
handle_char(dev, dev->data);
if (timer_is_enabled(&dev->timeout_timer)) {
timer_disable(&dev->timeout_timer);
#ifdef USE_DYNAREC
if (cpu_use_dynarec)
update_tsc();
#endif
}
/* ACK it, will be read on next READ STATUS. */
dev->ack = 1;
timer_set_delay_u64(&dev->pulse_timer, ISACONST);
@@ -1940,6 +1947,13 @@ write_ctrl(uint8_t val, void *priv)
/* Process incoming character. */
handle_char(dev, dev->data);
if (timer_is_enabled(&dev->timeout_timer)) {
timer_disable(&dev->timeout_timer);
#ifdef USE_DYNAREC
if (cpu_use_dynarec)
update_tsc();
#endif
}
/* ACK it, will be read on next READ STATUS. */
dev->ack = 1;
timer_set_delay_u64(&dev->pulse_timer, ISACONST);