TMXR: Enforce output rate limiting when output is produced by instructions

Calls to tmxr_putc_ln() executed directly within instruction simulation code
(as opposed to during event servicing) will delay reasonable times
This commit is contained in:
Mark Pizzolato 2017-05-11 08:42:31 -07:00
parent 1e8af71081
commit d0bd4fbdff
2 changed files with 5 additions and 0 deletions

Binary file not shown.

View file

@ -2056,6 +2056,11 @@ if ((lp->txbfd && !lp->notelnet) || (TXBUF_AVAIL(lp) > 1)) {/* room for char (+
sim_oline = save_oline; /* resture output socket */
}
sim_exp_check (&lp->expect, chr); /* process expect rules as needed */
if ((sim_interval > 0) && /* not called within sim_process_event? */
(lp->txbps) && (lp->txdelta > 1000)) { /* and rate limiting output slower than 1000 cps */
tmxr_send_buffered_data (lp); /* put data on wire */
sim_os_ms_sleep((lp->txdelta - 1000) / 1000); /* wait an approximate character delay */
}
return SCPE_OK; /* char sent */
}
++lp->txdrp; lp->xmte = 0; /* no room, dsbl line */