t_stat ttpi_svc (UNIT *uptr) { int32 c, out; sim_activate (uptr, KBD_WAIT (uptr->wait, lfc_poll)); /* continue poll */ ttp_sta = ttp_sta & ~STA_FR; /* clear break */ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; ttp_sta = ttp_sta & ~STA_PF; /* clear parity err */ if (ttp_kchp) /* overrun? */ ttp_sta = ttp_sta | STA_OVR; if (ttp_karm) SET_INT (v_TTP); if (c & SCPE_BREAK) { /* break? */ ttp_sta = ttp_sta | STA_FR; /* framing error */ uptr->buf = 0; /* no character */ } else { out = c & 0x7F; /* echo is 7b */ c = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); if (TT_GET_MODE (uptr->flags) != TT_MODE_8B) /* not 8b mode? */ c = pas_par (ttp_cmd, c); /* apply parity */ uptr->buf = c; /* save char */ uptr->pos = uptr->pos + 1; /* incr count */ ttp_kchp = 1; /* char pending */ if (ttp_cmd & CMD_ECHO) { out = sim_tt_outcvt (out, TT_GET_MODE (uptr->flags)); if (c >= 0) sim_putchar (out); ttp_unit[TTO].pos = ttp_unit[TTO].pos + 1; } } return SCPE_OK; }
t_stat tti_reset (DEVICE *dptr) { tti_buf = 0; tti_csr = 0; tti_int = 0; sim_activate_abs (&tti_unit, KBD_WAIT (tti_unit.wait, tmr_poll)); return SCPE_OK; }
t_stat tti_reset (DEVICE *dptr) { tti_unit.buf = 0; tti_csr = 0; CLR_INT (TTI); sim_activate (&tti_unit, KBD_WAIT (tti_unit.wait, tmr_poll)); return SCPE_OK; }
t_stat fe_reset (DEVICE *dptr) { fei_unit.buf = feo_unit.buf = 0; M[FE_CTYIN] = M[FE_CTYOUT] = 0; apr_flg = apr_flg & ~(APRF_ITC | APRF_CON); sim_activate (&fei_unit, KBD_WAIT (fei_unit.wait, tmxr_poll)); return SCPE_OK; }
t_stat tti_reset (DEVICE *dptr) { tti_unit.buf = 0; dev_done = dev_done & ~INT_TTI; /* clear done, int */ int_req = int_req & ~INT_TTI; int_enable = int_enable | INT_TTI; /* set enable */ sim_activate_abs (&tti_unit, KBD_WAIT (tti_unit.wait, tmxr_poll)); return SCPE_OK; }
t_stat tti_reset (DEVICE *dptr) { tmxr_set_console_units (&tti_unit, &tto_unit); tti_unit.buf = 0; tti_csr = 0; CLR_INT (TTI); sim_activate_abs (&tti_unit, KBD_WAIT (tti_unit.wait, tmr_poll)); return SCPE_OK; }
t_stat tti_reset (DEVICE *dptr) { tmxr_set_console_units (&tti_unit, &tto_unit); tti_unit.buf = 0; dev_done = dev_done & ~INT_TTI; /* clear done, int */ int_req = int_req & ~INT_TTI; int_enable = int_enable | INT_TTI; /* set enable */ if (!sim_is_running) /* RESET (not CAF)? */ sim_activate (&tti_unit, KBD_WAIT (tti_unit.wait, tmxr_poll)); return SCPE_OK; }
t_stat tti_svc (UNIT *uptr) { int32 c; sim_activate (uptr, KBD_WAIT (uptr->wait, tmr_poll)); /* continue poll */ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) return c; /* no char or error? */ if (c & SCPE_BREAK) uptr->buf = 0; /* break? */ else uptr->buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); uptr->pos = uptr->pos + 1; tti_csr = tti_csr | CSR_DONE; if (tti_csr & CSR_IE) SET_INT (TTI); return SCPE_OK; }
t_stat tti_svc (UNIT *uptr) { int32 c; sim_activate (uptr, KBD_WAIT (uptr->wait, tmxr_poll)); /* continue poll */ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; if (c & SCPE_BREAK) /* break? */ uptr->buf = 0; else uptr->buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags) | TTUF_KSR); uptr->pos = uptr->pos + 1; dev_done = dev_done | INT_TTI; /* set done */ int_req = INT_UPDATE; /* update interrupts */ return SCPE_OK; }
t_stat tti_svc (UNIT *uptr) { int32 c; sim_activate (uptr, KBD_WAIT (uptr->wait, tmr_poll)); /* continue poll */ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; if (c & SCPE_BREAK) /* break? */ tti_buf = RXDB_ERR | RXDB_FRM; else tti_buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); uptr->pos = uptr->pos + 1; tti_csr = tti_csr | CSR_DONE; if (tti_csr & CSR_IE) tti_int = 1; return SCPE_OK; }
t_stat ttp_reset (DEVICE *dptr) { if (dptr->flags & DEV_DIS) sim_cancel (&ttp_unit[TTI]); else sim_activate_abs (&ttp_unit[TTI], KBD_WAIT (ttp_unit[TTI].wait, lfc_poll)); sim_cancel (&ttp_unit[TTO]); CLR_INT (v_TTP); /* clear int */ CLR_ENB (v_TTP); CLR_INT (v_TTP + 1); /* disable int */ CLR_ENB (v_TTP + 1); ttp_karm = ttp_tarm = 0; /* disarm int */ ttp_cmd = 0; ttp_sta = 0; ttp_kchp = 0; return SCPE_OK; }
t_stat fe_reset (DEVICE *dptr) { tmxr_set_console_units (&fe_unit[0], &fe_unit[1]); fei_unit.buf = feo_unit.buf = 0; M[FE_CTYIN] = M[FE_CTYOUT] = 0; M[FE_KLININ] = M[FE_KLINOUT] = 0; M[FE_KEEPA] = INT64_C(0003740000000); /* PARITY STOP, CRM, DP PAREN, CACHE EN, 1MSTMR, TRAPEN */ kaf_unit.u3 = 0; kaf_unit.u4 = 0; apr_flg = apr_flg & ~(APRF_ITC | APRF_CON); sim_activate (&fei_unit, KBD_WAIT (fei_unit.wait, tmxr_poll)); sim_activate_after (&kaf_unit, kaf_unit.wait); return SCPE_OK; }
t_stat fei_svc (UNIT *uptr) { int32 temp; sim_activate (uptr, KBD_WAIT (uptr->wait, clk_cosched (tmxr_poll))); /* continue poll */ if ((temp = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return temp; if (temp & SCPE_BREAK) /* ignore break */ return SCPE_OK; uptr->buf = temp & 0177; uptr->pos = uptr->pos + 1; M[FE_CTYIN] = uptr->buf | FE_CVALID; /* put char in mem */ apr_flg = apr_flg | APRF_CON; /* interrupt KS10 */ return SCPE_OK; }
t_stat tti_svc (UNIT *uptr) { int32 c; sim_activate (uptr, KBD_WAIT (uptr->wait, tmr_poll)); /* continue poll */ if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; if (c & SCPE_BREAK) { /* break? */ if (sysd_hlt_enb ()) /* if enabled, halt */ hlt_pin = 1; tti_unit.buf = TTIBUF_ERR | TTIBUF_FRM | TTIBUF_RBR; } else tti_unit.buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); uptr->pos = uptr->pos + 1; tti_csr = tti_csr | CSR_DONE; if (tti_csr & CSR_IE) SET_INT (TTI); return SCPE_OK; }
t_stat tti_svc (UNIT *uptr) { int32 c; sim_clock_coschedule (uptr, KBD_WAIT (uptr->wait, tmr_poll)); /* continue poll */ if ((tti_csr & CSR_DONE) && /* input still pending and < 500ms? */ ((sim_os_msec () - tti_buftime) < 500)) return SCPE_OK; if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; if (c & SCPE_BREAK) /* break? */ tti_buf = RXDB_ERR; else tti_buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); tti_buftime = sim_os_msec (); uptr->pos = uptr->pos + 1; tti_csr = tti_csr | CSR_DONE; if (tti_csr & CSR_IE) tti_int = 1; return SCPE_OK; }
t_stat tti_svc (UNIT *uptr) { int32 c; sim_clock_coschedule (uptr, KBD_WAIT (uptr->wait, tmr_poll)); /* continue poll */ if ((tti_csr & CSR_DONE) && /* input still pending and < 500ms? */ ((sim_os_msec () - tti_buftime) < 500)) return SCPE_OK; if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */ return c; if (c & SCPE_BREAK) { /* break? */ if (sysd_hlt_enb ()) /* if enabled, halt */ hlt_pin = 1; tti_unit.buf = TTIBUF_ERR | TTIBUF_FRM | TTIBUF_RBR; } else tti_unit.buf = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags)); tti_buftime = sim_os_msec (); uptr->pos = uptr->pos + 1; tti_csr = tti_csr | CSR_DONE; if (tti_csr & CSR_IE) SET_INT (TTI); return SCPE_OK; }