From d48d00cb17252294e80fd09ebffe059b4bee78e2 Mon Sep 17 00:00:00 2001 From: bde Date: Mon, 10 Jul 2017 09:00:35 +0000 Subject: [PATCH] Fix attribute flipping for cut marking in pixel mode. The text-mode code was used, so the lightness bit was not flipped, so the flipping was unnecessarily null in some cases. E.g., the unusal color scheme of lightwhite on white (white = lightgrey in kernelspeak) is not completely unusable, except null flipping of it gave no visible marks for cut marking. Now flipping it works in pixel mode only. Fix text cursor attribute adjustment over cut marking in text mode for the usual cursor type (non-blinking full block). Apply the flipping for cut marking first and adjust that instead of vice versa. This gives a uniform color scheme for the usual text cursor type in text mode: a white block background with no change to the character foreground except for variations to avoid collisions. The old order gave a white character fg with no change in the bg in non-colliding cases. Versions before r316636 changed the bg to the non-cut-marked one about half the time using a saveunder bug; this accidentally gave something resembling a block cursor half the time. --- sys/dev/syscons/scvgarndr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/syscons/scvgarndr.c b/sys/dev/syscons/scvgarndr.c index 06df75ea0c0b..aef157f169da 100644 --- a/sys/dev/syscons/scvgarndr.c +++ b/sys/dev/syscons/scvgarndr.c @@ -534,9 +534,9 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u_short a, int flip) } else #endif /* SC_NO_FONT_LOADING */ { - a = vga_cursorattr_adj(a, TRUE); if (flip) a = vga_flipattr(a, TRUE); + a = vga_cursorattr_adj(a, TRUE); sc_vtb_putc(&scp->scr, at, c, a); } } @@ -903,7 +903,7 @@ vga_vgadraw_direct(scr_stat *scp, int from, int count, int flip) a = sc_vtb_geta(&scp->vtb, i); if (flip) - a = vga_flipattr(a, TRUE); /* XXX */ + a = vga_flipattr(a, FALSE); col1 = (a & 0x0f00) >> 8; col2 = (a & 0xf000) >> 12; @@ -957,7 +957,7 @@ vga_vgadraw_planar(scr_stat *scp, int from, int count, int flip) for (i = from; count-- > 0; ++i) { a = sc_vtb_geta(&scp->vtb, i); if (flip) - a = vga_flipattr(a, TRUE); /* XXX */ + a = vga_flipattr(a, FALSE); col1 = a & 0x0f00; col2 = (a & 0xf000) >> 4; /* set background color in EGA/VGA latch */