| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: rasops15.c,v 1.28 2019/07/25 15:18:53 rin Exp $ */ | | 1 | /* $NetBSD: rasops15.c,v 1.29 2019/07/28 02:45:52 rin Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Andrew Doran. | | 8 | * by Andrew Doran. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.28 2019/07/25 15:18:53 rin Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: rasops15.c,v 1.29 2019/07/28 02:45:52 rin Exp $"); |
34 | | | 34 | |
35 | #include "opt_rasops.h" | | 35 | #include "opt_rasops.h" |
36 | | | 36 | |
37 | #include <sys/param.h> | | 37 | #include <sys/param.h> |
38 | #include <sys/systm.h> | | 38 | #include <sys/systm.h> |
39 | #include <sys/time.h> | | 39 | #include <sys/time.h> |
40 | | | 40 | |
41 | #include <dev/wscons/wsdisplayvar.h> | | 41 | #include <dev/wscons/wsdisplayvar.h> |
42 | #include <dev/wscons/wsconsio.h> | | 42 | #include <dev/wscons/wsconsio.h> |
43 | #include <dev/rasops/rasops.h> | | 43 | #include <dev/rasops/rasops.h> |
44 | | | 44 | |
45 | static void rasops15_putchar(void *, int, int, u_int, long attr); | | 45 | static void rasops15_putchar(void *, int, int, u_int, long attr); |
46 | static void rasops15_putchar_aa(void *, int, int, u_int, long attr); | | 46 | static void rasops15_putchar_aa(void *, int, int, u_int, long attr); |
| @@ -144,27 +144,27 @@ rasops15_putchar_aa(void *cookie, int ro | | | @@ -144,27 +144,27 @@ rasops15_putchar_aa(void *cookie, int ro |
144 | | | 144 | |
145 | rrp = (ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); | | 145 | rrp = (ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale); |
146 | rp = (uint16_t *)rrp; | | 146 | rp = (uint16_t *)rrp; |
147 | | | 147 | |
148 | height = font->fontheight; | | 148 | height = font->fontheight; |
149 | width = font->fontwidth; | | 149 | width = font->fontwidth; |
150 | | | 150 | |
151 | clr[0] = ri->ri_devcmap[(attr >> 16) & 0xf]; | | 151 | clr[0] = ri->ri_devcmap[(attr >> 16) & 0xf]; |
152 | clr[1] = ri->ri_devcmap[(attr >> 24) & 0xf]; | | 152 | clr[1] = ri->ri_devcmap[(attr >> 24) & 0xf]; |
153 | | | 153 | |
154 | if (uc == ' ') { | | 154 | if (uc == ' ') { |
155 | for (cnt = 0; cnt < width; cnt++) | | 155 | for (cnt = 0; cnt < width; cnt++) |
156 | buffer[cnt] = clr[0]; | | 156 | buffer[cnt] = clr[0]; |
157 | while (height--) { | | 157 | for (y = 0; y < height; y++) { |
158 | dp = rp; | | 158 | dp = rp; |
159 | DELTA(rp, ri->ri_stride, uint16_t *); | | 159 | DELTA(rp, ri->ri_stride, uint16_t *); |
160 | memcpy(dp, buffer, width << 1); | | 160 | memcpy(dp, buffer, width << 1); |
161 | } | | 161 | } |
162 | } else { | | 162 | } else { |
163 | fr = FONT_GLYPH(uc, font, ri); | | 163 | fr = FONT_GLYPH(uc, font, ri); |
164 | | | 164 | |
165 | fgo = ((attr >> 24) & 0xf) * 3; | | 165 | fgo = ((attr >> 24) & 0xf) * 3; |
166 | bgo = ((attr >> 16) & 0xf) * 3; | | 166 | bgo = ((attr >> 16) & 0xf) * 3; |
167 | | | 167 | |
168 | r0 = rasops_cmap[bgo]; | | 168 | r0 = rasops_cmap[bgo]; |
169 | r1 = rasops_cmap[fgo]; | | 169 | r1 = rasops_cmap[fgo]; |
170 | g0 = rasops_cmap[bgo + 1]; | | 170 | g0 = rasops_cmap[bgo + 1]; |