1
0
mirror of https://github.com/simh/simh.git synced 2026-01-11 23:52:58 +00:00
Mark Pizzolato 912f421144 CONSOLE: Add general support for SET CONSOLE SPEED=nnn
The original SET CONSOLE SPEED=nnn was added to a allow direct wired
terminal connected to a host system serial port to be a simulator's console.
The current change generalizes all console I/O such that speed is a reliable
option for direct console connections as well as serial and telnet connections.

The simple recipe to get well behaved console output speed is:
1) call tmxr_set_console_units() in the reset routine of the console DEVICE.
2) In the code path that engages console output do something similar
    to this as appropriate for the system being simulated:
        void txdb_wr (int32 data)
        {
        tto_unit.buf = data & 0377;
        tto_csr = tto_csr & ~CSR_DONE;
        CLR_INT (TTO);
        sim_activate (&tto_unit, tto_unit.wait);
        }

3) In the output unit's service routine the console output unit's service
    routine do something similar to this as appropriate for the system
    being simulated:
        t_stat tto_svc (UNIT *uptr)
        {
        int32 c;

        c = sim_tt_outcvt (tto_unit.buf, TT_GET_MODE (uptr->flags));
        if (c >= 0) {
            t_stat r;

            if ((r = sim_putchar_s (c)) != SCPE_OK) {           /* output; error? */
                sim_activate (uptr, uptr->wait);                /* retry */
                return ((r == SCPE_STALL)? SCPE_OK: r);         /* !stall? report */
                }
            }
        tto_csr = tto_csr | CSR_DONE;
        if (tto_csr & CSR_IE)
        SET_INT (TTO);
        }
The almost all of the current simh simulators already are implemented
with logic like the above example.  These will work just fine with the
newly regulated console speed.
2025-06-24 09:57:49 -10:00
..
2018-01-12 14:48:50 -08:00
2022-03-03 16:25:48 -07:00
2018-06-03 17:37:24 -07:00