Lines Matching +full:cp437 +full:- +full:8 +full:x16
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
7 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org>
132 ts->ts_busy = 1; in scteken_init()
135 ta = *teken_get_defattr(&ts->ts_teken); in scteken_init()
136 teken_init(&ts->ts_teken, &scteken_funcs, scp); in scteken_init()
137 teken_set_defattr(&ts->ts_teken, &ta); in scteken_init()
139 teken_set_8bit(&ts->ts_teken); in scteken_init()
142 teken_set_cons25(&ts->ts_teken); in scteken_init()
144 teken_set_cons25keys(&ts->ts_teken); in scteken_init()
160 --sc_term_scteken.te_refcount; in scteken_term()
168 teken_stat *ts = scp->ts; in scteken_puts()
170 scp->sc->write_in_progress++; in scteken_puts()
171 teken_input(&ts->ts_teken, buf, len); in scteken_puts()
172 scp->sc->write_in_progress--; in scteken_puts()
179 teken_stat *ts = scp->ts; in scteken_ioctl()
186 scteken_te_to_sc_attr(teken_get_curattr(&ts->ts_teken)); in scteken_ioctl()
190 if (vi->size != sizeof(struct vid_info)) in scteken_ioctl()
193 attr = scteken_te_to_sc_attr(teken_get_defattr(&ts->ts_teken)); in scteken_ioctl()
194 vi->mv_norm.fore = attr & 0x0f; in scteken_ioctl()
195 vi->mv_norm.back = (attr >> 4) & 0x0f; in scteken_ioctl()
196 vi->mv_rev.fore = vi->mv_norm.back; in scteken_ioctl()
197 vi->mv_rev.back = vi->mv_norm.fore; in scteken_ioctl()
210 teken_stat *ts = scp->ts; in scteken_default_attr()
214 teken_set_defattr(&ts->ts_teken, &ta); in scteken_default_attr()
220 teken_stat *ts = scp->ts; in scteken_clear()
224 sc_vtb_clear(&scp->vtb, scp->sc->scr_map[0x20], in scteken_clear()
225 scteken_te_to_sc_attr(teken_get_curattr(&ts->ts_teken)) in scteken_clear()
226 << 8); in scteken_clear()
240 teken_stat *ts = scp->ts; in scteken_fkeystr()
246 case FKEY | F(7): case FKEY | F(8): case FKEY | F(9): in scteken_fkeystr()
248 k = TKEY_F1 + c - (FKEY | F(1)); in scteken_fkeystr()
284 return (teken_get_sequence(&ts->ts_teken, k)); in scteken_fkeystr()
292 tp.tp_col = scp->xsize; in scteken_sync_internal()
293 tp.tp_row = scp->ysize; in scteken_sync_internal()
294 teken_set_winsize_noreset(&ts->ts_teken, &tp); in scteken_sync_internal()
295 tp.tp_col = scp->xpos; in scteken_sync_internal()
296 tp.tp_row = scp->ypos; in scteken_sync_internal()
297 teken_set_cursor(&ts->ts_teken, &tp); in scteken_sync_internal()
303 scteken_sync_internal(scp, scp->ts); in scteken_sync()
332 * pure colors in the simplest mode (16-color graphics) and the in scteken_sc_to_te_attr()
335 * for reordering the non-brightness bits in the 2 color numbers. in scteken_sc_to_te_attr()
337 a->ta_format = 0; in scteken_sc_to_te_attr()
338 a->ta_fgcolor = sc_to_te_color[color & 7] | (color & 8); in scteken_sc_to_te_attr()
339 a->ta_bgcolor = sc_to_te_color[(color >> 4) & 7] | ((color >> 4) & 8); in scteken_sc_to_te_attr()
348 if (a->ta_format & TF_REVERSE) { in scteken_te_to_sc_attr()
349 fg = a->ta_bgcolor; in scteken_te_to_sc_attr()
350 bg = a->ta_fgcolor; in scteken_te_to_sc_attr()
352 fg = a->ta_fgcolor; in scteken_te_to_sc_attr()
353 bg = a->ta_bgcolor; in scteken_te_to_sc_attr()
359 attr = te_to_sc_color[fg & 7] | (fg & 8) | in scteken_te_to_sc_attr()
360 ((te_to_sc_color[bg & 7] | (bg & 8)) << 4); in scteken_te_to_sc_attr()
363 if (a->ta_format & (TF_BOLD | TF_UNDERLINE)) in scteken_te_to_sc_attr()
364 attr ^= 8; in scteken_te_to_sc_attr()
365 if (a->ta_format & TF_BLINK) in scteken_te_to_sc_attr()
376 sc_bell(scp, scp->bell_pitch, scp->bell_duration); in scteken_bell()
384 sc_move_cursor(scp, p->tp_col, p->tp_row); in scteken_cursor()
480 { 0x25ac, 0x16, 0x00 },
497 max = (sizeof(cp437table) / sizeof(struct unicp437)) - 1; in scteken_get_cp437()
506 max = mid - 1; in scteken_get_cp437()
511 *c -= cp437table[mid].unicode_base; in scteken_get_cp437()
517 /* Character not present in CP437. */ in scteken_get_cp437()
518 *attr = (FG_RED|BG_BLACK) << 8; in scteken_get_cp437()
538 attr = scteken_te_to_sc_attr(a) << 8; in scteken_putchar()
539 if (a->ta_format & TF_CJK_RIGHT) in scteken_putchar()
546 map = scp->sc->scr_map; in scteken_putchar()
548 cursor = tp->tp_row * scp->xsize + tp->tp_col; in scteken_putchar()
549 p = sc_vtb_pointer(&scp->vtb, cursor); in scteken_putchar()
550 sc_vtb_putchar(&scp->vtb, p, map[ch], attr); in scteken_putchar()
557 mark_for_update(scp, imin(cursor + 1, scp->xsize * scp->ysize - 1)); in scteken_putchar()
570 attr = scteken_te_to_sc_attr(a) << 8; in scteken_fill()
576 map = scp->sc->scr_map; in scteken_fill()
578 if (r->tr_begin.tp_col == 0 && r->tr_end.tp_col == scp->xsize) { in scteken_fill()
580 sc_vtb_erase(&scp->vtb, r->tr_begin.tp_row * scp->xsize, in scteken_fill()
581 (r->tr_end.tp_row - r->tr_begin.tp_row) * scp->xsize, in scteken_fill()
585 width = r->tr_end.tp_col - r->tr_begin.tp_col; in scteken_fill()
587 for (row = r->tr_begin.tp_row; row < r->tr_end.tp_row; row++) { in scteken_fill()
588 sc_vtb_erase(&scp->vtb, r->tr_begin.tp_row * in scteken_fill()
589 scp->xsize + r->tr_begin.tp_col, in scteken_fill()
596 r->tr_begin.tp_row * scp->xsize + r->tr_begin.tp_col); in scteken_fill()
598 (r->tr_end.tp_row - 1) * scp->xsize + (r->tr_end.tp_col - 1)); in scteken_fill()
615 if (scp->history != NULL && in scteken_copy()
616 r->tr_begin.tp_col == 0 && r->tr_end.tp_col == scp->xsize && in scteken_copy()
617 r->tr_begin.tp_row == p->tp_row + 1) { in scteken_copy()
618 sc_hist_save_one_line(scp, p->tp_row); in scteken_copy()
622 if (r->tr_begin.tp_col == 0 && r->tr_end.tp_col == scp->xsize) { in scteken_copy()
624 sc_vtb_move(&scp->vtb, r->tr_begin.tp_row * scp->xsize, in scteken_copy()
625 p->tp_row * scp->xsize, in scteken_copy()
626 (r->tr_end.tp_row - r->tr_begin.tp_row) * scp->xsize); in scteken_copy()
629 width = r->tr_end.tp_col - r->tr_begin.tp_col; in scteken_copy()
631 if (p->tp_row < r->tr_begin.tp_row) { in scteken_copy()
633 src = r->tr_begin.tp_row * scp->xsize + in scteken_copy()
634 r->tr_begin.tp_col; in scteken_copy()
635 end = r->tr_end.tp_row * scp->xsize + in scteken_copy()
636 r->tr_end.tp_col; in scteken_copy()
637 dst = p->tp_row * scp->xsize + p->tp_col; in scteken_copy()
640 sc_vtb_move(&scp->vtb, src, dst, width); in scteken_copy()
642 src += scp->xsize; in scteken_copy()
643 dst += scp->xsize; in scteken_copy()
647 src = (r->tr_end.tp_row - 1) * scp->xsize + in scteken_copy()
648 r->tr_begin.tp_col; in scteken_copy()
649 end = r->tr_begin.tp_row * scp->xsize + in scteken_copy()
650 r->tr_begin.tp_col; in scteken_copy()
651 dst = (p->tp_row + r->tr_end.tp_row - in scteken_copy()
652 r->tr_begin.tp_row - 1) * scp->xsize + p->tp_col; in scteken_copy()
655 sc_vtb_move(&scp->vtb, src, dst, width); in scteken_copy()
657 src -= scp->xsize; in scteken_copy()
658 dst -= scp->xsize; in scteken_copy()
665 p->tp_row * scp->xsize + p->tp_col); in scteken_copy()
667 (p->tp_row + r->tr_end.tp_row - r->tr_begin.tp_row - 1) * in scteken_copy()
668 scp->xsize + in scteken_copy()
669 (p->tp_col + r->tr_end.tp_col - r->tr_begin.tp_col - 1)); in scteken_copy()
693 scp->border = value & 0xff; in scteken_param()
694 if (scp == scp->sc->cur_scp) in scteken_param()
695 sc_set_border(scp, scp->border); in scteken_param()
699 v0 = (value >> 8) & 0xff; in scteken_param()
708 sc_change_cursor_shape(scp, v0, -1, -1); in scteken_param()
717 sc_change_cursor_shape(scp, -1, in scteken_param()
718 scp->font_size - v1 - 1, in scteken_param()
719 v1 - v0 + 1); in scteken_param()
721 sc_change_cursor_shape(scp, -1, in scteken_param()
722 v0, v1 - v0 + 1); in scteken_param()
728 sc_change_cursor_shape(scp, tcattrs[value], -1, -1); in scteken_param()
731 CONS_RESET_CURSOR | CONS_LOCAL_CURSOR, -1, -1); in scteken_param()
732 flags = scp->base_curs_attr.flags ^ CONS_BLINK_CURSOR; in scteken_param()
734 flags | CONS_LOCAL_CURSOR, -1, -1); in scteken_param()
739 flags = scp->base_curs_attr.flags & ~CONS_HIDDEN_CURSOR; in scteken_param()
741 flags = scp->base_curs_attr.flags | CONS_HIDDEN_CURSOR; in scteken_param()
742 sc_change_cursor_shape(scp, flags | CONS_LOCAL_CURSOR, -1, -1); in scteken_param()
745 sc_switch_scr(scp->sc, value); in scteken_param()
748 scp->bell_pitch = TP_SETBELLPD_PITCH(value); in scteken_param()
749 scp->bell_duration = TP_SETBELLPD_DURATION(value); in scteken_param()
752 scp->mouse_level = value; in scteken_param()