diff --git a/sys/dev/syscons/teken/sequences b/sys/dev/syscons/teken/sequences index eb5a9fef54f..99aa226ab97 100644 --- a/sys/dev/syscons/teken/sequences +++ b/sys/dev/syscons/teken/sequences @@ -100,6 +100,8 @@ TBC Tab Clear ^[ [ g r VPA Vertical Position Absolute ^[ [ d n # Cons25 compatibility sequences +C25ADBG Cons25 set adapter background ^[ [ = G r +C25ADFG Cons25 set adapter foreground ^[ [ = F r C25CURS Cons25 set cursor type ^[ [ = S r C25VTSW Cons25 switch virtual terminal ^[ [ z r diff --git a/sys/dev/syscons/teken/teken_subr_compat.h b/sys/dev/syscons/teken/teken_subr_compat.h index 5378bb0a966..dea30d3e801 100644 --- a/sys/dev/syscons/teken/teken_subr_compat.h +++ b/sys/dev/syscons/teken/teken_subr_compat.h @@ -33,6 +33,29 @@ teken_subr_cons25_set_cursor_type(teken_t *t, unsigned int type) teken_funcs_param(t, TP_SHOWCURSOR, type != 1); } +static void +teken_subr_cons25_set_adapter_background(teken_t *t, unsigned int c) +{ + + t->t_defattr.ta_bgcolor = c % 8; + t->t_curattr.ta_bgcolor = c % 8; +} + +static void +teken_subr_cons25_set_adapter_foreground(teken_t *t, unsigned int c) +{ + + t->t_defattr.ta_fgcolor = c % 8; + t->t_curattr.ta_fgcolor = c % 8; + if (c >= 8) { + t->t_defattr.ta_format |= TF_BOLD; + t->t_curattr.ta_format |= TF_BOLD; + } else { + t->t_defattr.ta_format &= ~TF_BOLD; + t->t_curattr.ta_format &= ~TF_BOLD; + } +} + static void teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt) {