Module Name: src
Committed By: uwe
Date: Sun May 15 16:43:39 UTC 2022
Modified Files:
src/sys/dev/rasops: rasops.c
Log Message:
rasops: fix automagic box chars for stride > 1 on little endian
This makes DEC line drawing (acsc) work correctly for "iso" fonts of
large sizes, e.g. spleen16x32 on x86.
To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/dev/rasops/rasops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/rasops/rasops.c
diff -u src/sys/dev/rasops/rasops.c:1.127 src/sys/dev/rasops/rasops.c:1.128
--- src/sys/dev/rasops/rasops.c:1.127 Sun May 15 16:12:52 2022
+++ src/sys/dev/rasops/rasops.c Sun May 15 16:43:39 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops.c,v 1.127 2022/05/15 16:12:52 uwe Exp $ */
+/* $NetBSD: rasops.c,v 1.128 2022/05/15 16:43:39 uwe Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.127 2022/05/15 16:12:52 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.128 2022/05/15 16:43:39 uwe Exp $");
#ifdef _KERNEL_OPT
#include "opt_rasops.h"
@@ -1195,6 +1195,11 @@ rasops_make_box_chars_16(struct rasops_i
vert_mask = 0xc000U >> ((ri->ri_font->fontwidth >> 1) - 1);
hmask_left = 0xff00U << (8 - (ri->ri_font->fontwidth >> 1));
hmask_right = hmask_left >> ((ri->ri_font->fontwidth + 1) >> 1);
+
+ vert_mask = htobe16(vert_mask);
+ hmask_left = htobe16(hmask_left);
+ hmask_right = htobe16(hmask_right);
+
mid = (ri->ri_font->fontheight + 1) >> 1;
/* 0x00 would be empty anyway so don't bother */
@@ -1234,6 +1239,7 @@ rasops_make_box_chars_8(struct rasops_in
vert_mask = 0xc0U >> ((ri->ri_font->fontwidth >> 1) - 1);
hmask_left = 0xf0U << (4 - (ri->ri_font->fontwidth >> 1));
hmask_right = hmask_left >> ((ri->ri_font->fontwidth + 1) >> 1);
+
mid = (ri->ri_font->fontheight + 1) >> 1;
/* 0x00 would be empty anyway so don't bother */
@@ -1273,6 +1279,11 @@ rasops_make_box_chars_32(struct rasops_i
vert_mask = 0xc0000000U >> ((ri->ri_font->fontwidth >> 1) - 1);
hmask_left = 0xffff0000U << (16 - (ri->ri_font->fontwidth >> 1));
hmask_right = hmask_left >> ((ri->ri_font->fontwidth + 1) >> 1);
+
+ vert_mask = htobe32(vert_mask);
+ hmask_left = htobe32(hmask_left);
+ hmask_right = htobe32(hmask_right);
+
mid = (ri->ri_font->fontheight + 1) >> 1;
/* 0x00 would be empty anyway so don't bother */