From 882cb5bfd1e40434d49ab606f34e6b0f151ea971 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Wed, 22 Sep 2010 22:16:48 +0000 Subject: MFC: r212806 Rework r210248. Although it fixed most of problems, it did not fix one particular edge case where X-axis resolution is not multiple of font width. Now we just advance enough scan lines, then deduct a partial scan line. It is more intuitive than the previous code. Apply the same wisdom to EGA and VGA planar renderers for consistency. --- sys/dev/syscons/scvgarndr.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'sys/dev/syscons') diff --git a/sys/dev/syscons/scvgarndr.c b/sys/dev/syscons/scvgarndr.c index 50e3e62728ef..79c8aa4bb5be 100644 --- a/sys/dev/syscons/scvgarndr.c +++ b/sys/dev/syscons/scvgarndr.c @@ -713,8 +713,7 @@ vga_egadraw(scr_stat *scp, int from, int count, int flip) } ++d; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff*2 - + (scp->font_size - 1)*line_width; + d += scp->font_size * line_width - scp->xsize; } outw(GDCIDX, 0x0000); /* set/reset */ outw(GDCIDX, 0x0001); /* set/reset enable */ @@ -766,9 +765,8 @@ vga_vgadraw_direct(scr_stat *scp, int from, int count, int flip) d += 8 * pixel_size; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff * scp->font_size * pixel_size + - scp->font_size * line_width - - scp->xpixel * pixel_size; + d += scp->font_size * line_width - + scp->xsize * 8 * pixel_size; } } @@ -824,8 +822,7 @@ vga_vgadraw_planar(scr_stat *scp, int from, int count, int flip) } ++d; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff*2 - + (scp->font_size - 1)*line_width; + d += scp->font_size * line_width - scp->xsize; } outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0000); /* set/reset */ -- cgit v1.3