本文整理汇总了C++中TT_GET_MODE函数的典型用法代码示例。如果您正苦于以下问题:C++ TT_GET_MODE函数的具体用法?C++ TT_GET_MODE怎么用?C++ TT_GET_MODE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TT_GET_MODE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: muxi_rtc_svc
t_stat muxi_rtc_svc (UNIT *uptr)
{
t_stat r;
int32 newln, ln, c;
if ((mux_unit[MUXC].flags & UNIT_ATT) == 0) /* attached? */
return SCPE_OK;
newln = tmxr_poll_conn (&mux_desc); /* look for connect */
if ((newln >= 0) && (mux_sta[newln] & MUXL_REP)) { /* rcv enb pending? */
mux_ldsc[newln].rcve = 1; /* enable rcv */
mux_sta[newln] &= ~MUXL_REP; /* clr pending */
}
tmxr_poll_rx (&mux_desc); /* poll for input */
for (ln = 0; ln < MUX_NUMLIN; ln++) { /* loop thru lines */
if (mux_ldsc[ln].conn) { /* connected? */
if (c = tmxr_getc_ln (&mux_ldsc[ln])) { /* get char */
if (c & SCPE_BREAK) /* break? */
mux_sta[ln] |= MUXL_RBP; /* set rcv brk */
else { /* normal char */
mux_sta[ln] &= ~MUXL_RBP; /* clr rcv brk */
c = sim_tt_inpcvt (c, TT_GET_MODE (muxl_unit[ln].flags));
mux_rbuf[ln] = c; /* save char */
if ((muxc_cmd == MUXC_RCV) && /* chan active? */
(r = muxi_put_char (c, ln))) /* char to chan */
return r;
} /* end else char */
} /* end if char */
} /* end if conn */
else mux_sta[ln] &= ~MUXL_RBP; /* disconnected */
} /* end for */
return SCPE_OK;
}
示例2: tti_svc
t_stat tti_svc (UNIT *uptr)
{
int32 c;
uptr->wait = sim_rtcn_calb (POLL_RATE, TMR_POLL); /* calibrate poll timer */
sim_activate (uptr, uptr->wait); /* continue poll */
tty_shin = 0377; /* assume inactive */
if (tty_lf) { /* auto lf pending? */
c = 012; /* force lf */
tty_lf = 0;
}
else {
if ((c = sim_poll_kbd ()) < SCPE_KFLAG) return c; /* no char or error? */
if (c & SCPE_BREAK) c = 0; /* break? */
else c = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags));
tty_lf = ((c & 0177) == 015) && (uptr->flags & UNIT_AUTOLF);
}
if (tty_mode & TM_KBD) { /* keyboard enabled? */
tty_buf = c; /* put char in buf */
uptr->pos = uptr->pos + 1;
ttyio (&tty_dib, ioENF, 0); /* set flag */
if (c) {
tto_out (c); /* echo? */
return ttp_out (c); /* punch? */
}
}
else tty_shin = c; /* no, char shifts in */
return SCPE_OK;
}
示例3: ttix_svc
t_stat ttix_svc (UNIT *uptr)
{
int32 ln, c, temp;
if ((uptr->flags & UNIT_ATT) == 0) /* attached? */
return SCPE_OK;
sim_clock_coschedule (uptr, tmxr_poll); /* continue poll */
ln = tmxr_poll_conn (&ttx_desc); /* look for connect */
if (ln >= 0) /* got one? rcv enb*/
ttx_ldsc[ln].rcve = 1;
tmxr_poll_rx (&ttx_desc); /* poll for input */
for (ln = 0; ln < TTX_LINES; ln++) { /* loop thru lines */
if (ttx_ldsc[ln].conn) { /* connected? */
if (dev_done & (INT_TTI1 << ln)) /* Last character still pending? */
continue;
if ((temp = tmxr_getc_ln (&ttx_ldsc[ln]))) { /* get char */
if (temp & SCPE_BREAK) /* break? */
c = 0;
else c = sim_tt_inpcvt (temp, TT_GET_MODE (ttox_unit[ln].flags));
ttix_buf[ln] = c;
dev_done = dev_done | (INT_TTI1 << ln);
int_req = INT_UPDATE;
}
}
}
return SCPE_OK;
}
示例4: tti_svc
t_stat tti_svc (UNIT *uptr)
{
int32 out, c;
UNIT *ruptr = &tty_unit[TTR];
sim_activate (uptr, uptr->wait); /* continue poll */
if ((c = sim_poll_kbd ()) >= SCPE_KFLAG) { /* character? */
out = c & 0177; /* mask echo to 7b */
if (c & SCPE_BREAK) /* break? */
c = 0;
else c = sim_tt_inpcvt (c, TT_GET_MODE (uptr->flags) | TTUF_KSR);
uptr->pos = uptr->pos + 1;
}
else if (c != SCPE_OK) /* error? */
return c;
else if ((ruptr->flags & UNIT_ATT) && /* TTR attached */
(ruptr->STA & RUNNING)) { /* and running? */
if (ruptr->STA & LF_PEND) { /* lf pending? */
c = 0212; /* char is lf */
ruptr->STA &= ~LF_PEND; /* clear flag */
}
else { /* normal read */
if ((c = getc (ruptr->fileref)) == EOF) { /* read byte */
if (feof (ruptr->fileref)) { /* EOF? */
ruptr->STA &= ~RUNNING; /* stop reader */
if (ttr_stopioe)
printf ("TTR end of file\n");
else return SCPE_OK;
}
else perror ("TTR I/O error");
clearerr (ruptr->fileref);
return SCPE_IOERR;
}
if ((ruptr->flags & UNIT_UASC) && (c == '\n')) {
c = 0215; /* Unix ASCII NL? */
ruptr->STA |= LF_PEND; /* LF pending */
}
else if ((ruptr->flags & UNIT_ASC) && (c != 0))
c = c | 0200; /* ASCII nz? cvt */
ruptr->pos = ftell (ruptr->fileref);
}
if (ttr_xoff_read != 0) { /* reader stopping? */
if (c == RUBOUT) /* rubout? stop */
ttr_xoff_read = 0;
else ttr_xoff_read--; /* else decr state */
if (ttr_xoff_read == 0) /* delay done? */
ruptr->STA &= ~RUNNING; /* stop reader */
}
else if ((c & 0177) == XOFF) /* XOFF read? */
ttr_xoff_read = 2;
out = c; /* echo char */
}
else return SCPE_OK; /* no char */
if (tty_mode == 0) { /* input mode? */
tty_buf = c & 0377; /* put char in buf */
SET_INT (INT_TTY); /* set flag */
}
tto_write (out); /* echo to printer */
return ttp_write (out); /* and punch */
}
示例5: tto_echo
void tto_echo (int32 c)
{
uint32 cnt;
cnt = 1;
if (c == '\r')
tto_pos = 0;
else if (c == '\n') {
tto_pos = 0;
sim_putchar ('\r');
tt_unit[TTO].pos = tt_unit[TTO].pos + 1;
}
else if (c == '\t') {
c = ' ';
cnt = 8 - (tto_pos % 8);
}
else c = sim_tt_outcvt (c, TT_GET_MODE (tt_unit[TTO].flags));
if (c >= 0) {
while (cnt-- > 0) {
sim_putchar (c);
tto_pos++;
tt_unit[TTO].pos = tt_unit[TTO].pos + 1;
}
}
return;
}
示例6: tto_write
t_stat tto_write (int32 c)
{
UNIT *tuptr = &tty_unit[TTO];
c = sim_tt_outcvt (c, TT_GET_MODE (tuptr->flags) | TTUF_KSR);
tuptr->pos = tuptr->pos + 1;
if (c >= 0)
return sim_putchar_s (c);
else return SCPE_OK;
}
示例7: tti_svc
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;
}
示例8: tti_svc
t_stat tti_svc (UNIT *uptr)
{
int32 c;
sim_activate (uptr, uptr->wait); /* 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);
dev_done = dev_done | INT_TTI; /* set ready */
uptr->pos = uptr->pos + 1;
return SCPE_OK;
}
示例9: tti_svc
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;
}
示例10: tto_out
t_stat tto_out (int32 c)
{
t_stat r;
if (tty_mode & TM_PRI) { /* printing? */
c = sim_tt_outcvt (c, TT_GET_MODE (tty_unit[TTO].flags));
if (c >= 0) { /* valid? */
r = sim_putchar_s (c); /* output char */
if (r != SCPE_OK)
return r;
tty_unit[TTO].pos = tty_unit[TTO].pos + 1;
}
}
return SCPE_OK;
}
示例11: tti_svc
t_stat tti_svc (UNIT *uptr)
{
int32 c;
sim_clock_coschedule (uptr, 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));
uptr->pos = uptr->pos + 1;
tti_csr = tti_csr | CSR_DONE;
if (tti_csr & CSR_IE)
SET_INT (TTI);
return SCPE_OK;
}
示例12: tto_svc
t_stat tto_svc (UNIT *uptr)
{
int32 c;
t_stat r;
c = sim_tt_outcvt (uptr->buf, TT_GET_MODE (uptr->flags) | TTUF_KSR);
if (c >= 0) {
if ((r = sim_putchar_s (c)) != SCPE_OK) { /* output; error? */
sim_activate (uptr, uptr->wait); /* try again */
return ((r == SCPE_STALL)? SCPE_OK: r); /* !stall? report */
}
}
dev_done = dev_done | INT_TTO; /* set ready */
uptr->pos = uptr->pos + 1;
return SCPE_OK;
}
示例13: tti_svc
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;
}
示例14: tto_svc
t_stat tto_svc (UNIT *uptr)
{
int32 c;
t_stat r;
c = sim_tt_outcvt (uptr->buf, TT_GET_MODE (uptr->flags));
if (c >= 0) {
if ((r = sim_putchar_s (c)) != SCPE_OK) { /* output; error? */
sim_activate (uptr, uptr->wait); /* try again */
return ((r == SCPE_STALL)? SCPE_OK: r); /* !stall? report */
}
}
tto_csr = tto_csr | CSR_DONE;
if (tto_csr & CSR_IE) SET_INT (TTO);
uptr->pos = uptr->pos + 1;
return SCPE_OK;
}
示例15: tti_svc
t_stat tti_svc (UNIT *uptr)
{
int32 c;
sim_clock_coschedule (uptr, tmxr_poll); /* continue poll */
if (dev_done & INT_TTI) /* prior character still pending? */
return SCPE_OK;
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;
}