Sync with sys/dev/syscons/scterm-sc.c revisions 1.6 and 1.7.

This commit is contained in:
Yoshihiro Takahashi 2000-06-22 10:03:28 +00:00
parent 714c609be5
commit 9c9e869881
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61950
2 changed files with 34 additions and 14 deletions

View File

@ -487,6 +487,11 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
tcp->cur_color.fg = ansi_col[n - 30];
tcp->cur_attr = mask2attr(tcp);
break;
case 39:
tcp->attr_mask &= ~FG_CHANGED;
tcp->cur_color.fg = tcp->std_color.fg;
tcp->cur_attr = mask2attr(tcp);
break;
case 40: case 41: /* set bg color */
case 42: case 43: case 44:
case 45: case 46: case 47:
@ -494,6 +499,11 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
tcp->cur_color.bg = ansi_col[n - 40];
tcp->cur_attr = mask2attr(tcp);
break;
case 49:
tcp->attr_mask &= ~BG_CHANGED;
tcp->cur_color.bg = tcp->std_color.bg;
tcp->cur_attr = mask2attr(tcp);
break;
}
}
break;
@ -515,7 +525,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
else
n = tcp->param[0];
switch (n) {
case 0: /* reset attributes */
case 0: /* reset colors and attributes */
tcp->attr_mask = NORMAL_ATTR;
tcp->cur_color = tcp->std_color =
tcp->dflt_std_color;
@ -534,7 +544,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
ansi_col[tcp->param[1] & 0x0f];
tcp->cur_attr = mask2attr(tcp);
break;
case 3: /* set ansi attribute directly */
case 3: /* set video attribute directly */
tcp->attr_mask &= ~(FG_CHANGED | BG_CHANGED);
tcp->cur_color.fg = tcp->std_color.fg =
tcp->param[1] & 0x0f;
@ -552,7 +562,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
ansi_col[tcp->param[1] & 0x0f];
tcp->cur_attr = mask2attr(tcp);
break;
case 7: /* set ansi reverse video directly */
case 7: /* set reverse video attribute directly */
tcp->rev_color.fg = tcp->param[1] & 0x0f;
tcp->rev_color.bg = (tcp->param[1] >> 4) & 0x0f;
tcp->cur_attr = mask2attr(tcp);
@ -632,7 +642,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
splx(i);
break;
case 'F': /* set ansi foreground */
case 'F': /* set foreground */
if (tcp->num_param == 1) {
tcp->attr_mask &= ~FG_CHANGED;
tcp->cur_color.fg = tcp->std_color.fg =
@ -641,7 +651,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
}
break;
case 'G': /* set ansi background */
case 'G': /* set background */
if (tcp->num_param == 1) {
tcp->attr_mask &= ~BG_CHANGED;
tcp->cur_color.bg = tcp->std_color.bg =
@ -650,14 +660,14 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
}
break;
case 'H': /* set ansi reverse video foreground */
case 'H': /* set reverse video foreground */
if (tcp->num_param == 1) {
tcp->rev_color.fg = tcp->param[0] & 0x0f;
tcp->cur_attr = mask2attr(tcp);
}
break;
case 'I': /* set ansi reverse video background */
case 'I': /* set reverse video background */
if (tcp->num_param == 1) {
tcp->rev_color.bg = tcp->param[0] & 0x0f;
tcp->cur_attr = mask2attr(tcp);

View File

@ -487,6 +487,11 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
tcp->cur_color.fg = ansi_col[n - 30];
tcp->cur_attr = mask2attr(tcp);
break;
case 39:
tcp->attr_mask &= ~FG_CHANGED;
tcp->cur_color.fg = tcp->std_color.fg;
tcp->cur_attr = mask2attr(tcp);
break;
case 40: case 41: /* set bg color */
case 42: case 43: case 44:
case 45: case 46: case 47:
@ -494,6 +499,11 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
tcp->cur_color.bg = ansi_col[n - 40];
tcp->cur_attr = mask2attr(tcp);
break;
case 49:
tcp->attr_mask &= ~BG_CHANGED;
tcp->cur_color.bg = tcp->std_color.bg;
tcp->cur_attr = mask2attr(tcp);
break;
}
}
break;
@ -515,7 +525,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
else
n = tcp->param[0];
switch (n) {
case 0: /* reset attributes */
case 0: /* reset colors and attributes */
tcp->attr_mask = NORMAL_ATTR;
tcp->cur_color = tcp->std_color =
tcp->dflt_std_color;
@ -534,7 +544,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
ansi_col[tcp->param[1] & 0x0f];
tcp->cur_attr = mask2attr(tcp);
break;
case 3: /* set ansi attribute directly */
case 3: /* set video attribute directly */
tcp->attr_mask &= ~(FG_CHANGED | BG_CHANGED);
tcp->cur_color.fg = tcp->std_color.fg =
tcp->param[1] & 0x0f;
@ -552,7 +562,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
ansi_col[tcp->param[1] & 0x0f];
tcp->cur_attr = mask2attr(tcp);
break;
case 7: /* set ansi reverse video directly */
case 7: /* set reverse video attribute directly */
tcp->rev_color.fg = tcp->param[1] & 0x0f;
tcp->rev_color.bg = (tcp->param[1] >> 4) & 0x0f;
tcp->cur_attr = mask2attr(tcp);
@ -632,7 +642,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
splx(i);
break;
case 'F': /* set ansi foreground */
case 'F': /* set foreground */
if (tcp->num_param == 1) {
tcp->attr_mask &= ~FG_CHANGED;
tcp->cur_color.fg = tcp->std_color.fg =
@ -641,7 +651,7 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
}
break;
case 'G': /* set ansi background */
case 'G': /* set background */
if (tcp->num_param == 1) {
tcp->attr_mask &= ~BG_CHANGED;
tcp->cur_color.bg = tcp->std_color.bg =
@ -650,14 +660,14 @@ scterm_scan_esc(scr_stat *scp, term_stat *tcp, u_char c)
}
break;
case 'H': /* set ansi reverse video foreground */
case 'H': /* set reverse video foreground */
if (tcp->num_param == 1) {
tcp->rev_color.fg = tcp->param[0] & 0x0f;
tcp->cur_attr = mask2attr(tcp);
}
break;
case 'I': /* set ansi reverse video background */
case 'I': /* set reverse video background */
if (tcp->num_param == 1) {
tcp->rev_color.bg = tcp->param[0] & 0x0f;
tcp->cur_attr = mask2attr(tcp);