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.
This commit is contained in:
bde 2017-07-10 09:00:35 +00:00
parent 9c007eb775
commit d48d00cb17

View File

@ -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 */