From 490770af47fa3c547e3103cf2adf57dd33f67ac0 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Mon, 19 Jul 2010 18:56:18 +0000 Subject: [PATCH] Fix two long-standing line wrapping bugs in VGA renderer for pixel mode. Font size may be smaller than 16 and logical scan line may be larger than the displayed scan line. MFC after: 3 days --- sys/dev/syscons/scvgarndr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/syscons/scvgarndr.c b/sys/dev/syscons/scvgarndr.c index dbee6f200d4a..50e3e62728ef 100644 --- a/sys/dev/syscons/scvgarndr.c +++ b/sys/dev/syscons/scvgarndr.c @@ -766,8 +766,9 @@ 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 * 16 * pixel_size + - (scp->font_size - 1) * line_width; + d += scp->xoff * scp->font_size * pixel_size + + scp->font_size * line_width - + scp->xpixel * pixel_size; } }