Oops, the previous commit swapped the main ega method with the main
vga planar method (for testing that was supposed to be local that the former still works). The ega method works on vga but is about twice as slow. The vga method doesn't work on ega. Optimize the main vga planar method a little. For changing the background color (which was otherwise optimized better than most things), don't switch the write mode from 3 to 0 just to select the pixel mask of 0xff obscurely by writing 0. Just write 0xff directly.
This commit is contained in:
parent
75e7a91649
commit
56e7a784ac
@ -525,9 +525,9 @@ vga_rndrinit(scr_stat *scp)
|
||||
scp->rndr->clear = vga_pxlclear_planar;
|
||||
scp->rndr->draw_border = vga_pxlborder_planar;
|
||||
if (scp->sc->adp->va_type == KD_VGA)
|
||||
scp->rndr->draw = vga_egadraw;
|
||||
else
|
||||
scp->rndr->draw = vga_vgadraw_planar;
|
||||
else
|
||||
scp->rndr->draw = vga_egadraw;
|
||||
scp->rndr->draw_cursor = vga_pxlcursor_planar;
|
||||
scp->rndr->blink_cursor = vga_pxlblink_planar;
|
||||
scp->rndr->draw_mouse = vga_pxlmouse_planar;
|
||||
@ -828,11 +828,9 @@ vga_vgadraw_planar(scr_stat *scp, int from, int count, int flip)
|
||||
/* set background color in EGA/VGA latch */
|
||||
if (bg != col2) {
|
||||
bg = col2;
|
||||
outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */
|
||||
outw(GDCIDX, bg | 0x00); /* set/reset */
|
||||
writeb(d, 0);
|
||||
writeb(d, 0xff);
|
||||
c = readb(d); /* set bg color in the latch */
|
||||
outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */
|
||||
}
|
||||
/* foreground color */
|
||||
outw(GDCIDX, col1 | 0x00); /* set/reset */
|
||||
|
Loading…
x
Reference in New Issue
Block a user