t_stat ptp_svc (UNIT *uptr) { int32 i; t_stat r = SCPE_OK; if (ptp_ldr) { /* need leader? */ for (i = 0; i < 12; i++) { /* punch leader */ if ((r = ptp_out (0))) break; } } ptp_ldr = 0; /* clear flag */ chan_set_ordy (ptp_dib.chan); /* ptp ready */ return r; }
t_stat lpt_svc (UNIT *uptr) { t_stat r = SCPE_OK; if (lpt_sta & SET_XFR) /* need lpt xfr? */ chan_set_ordy (lpt_dib.chan); if (lpt_sta & SET_EOR) { /* printing? */ chan_set_flag (lpt_dib.chan, CHF_EOR); /* set eor flg */ r = lpt_bufout (uptr); /* output buf */ } if (lpt_sta & SET_SPC) { /* spacing? */ if (uptr->flags & UNIT_ATT) { /* attached? */ int32 ln = LPT_GETLN (lpt_spc); /* get lines, ch */ if (lpt_spc & 0200) /* n lines? */ lpt_space (uptr, ln); /* upspace */ else lpt_crctl (uptr, ln); /* carriage ctl */ } r = lpt_status (uptr); /* update status */ } lpt_sta = 0; /* clear state */ return r; }
t_stat tto_svc (UNIT *uptr) { int32 asc; t_stat r; if (uptr->buf == TT_CR) /* control chars? */ asc = '\r'; else if (uptr->buf == TT_BS) asc = '\b'; else if (uptr->buf == TT_TB) asc = '\t'; else asc = sds_to_ascii[uptr->buf]; /* translate */ if ((r = sim_putchar_s (asc)) != SCPE_OK) { /* output; error? */ sim_activate (uptr, uptr->wait); /* retry */ return ((r == SCPE_STALL)? SCPE_OK: r); /* !stall? report */ } uptr->pos = uptr->pos + 1; /* inc position */ chan_set_ordy (tto_dib.chan); /* tto rdy */ if (asc == '\r') { /* CR? */ sim_putchar ('\n'); /* add lf */ uptr->pos = uptr->pos + 1; /* inc position */ } return SCPE_OK; }