diff options
author | 2002-11-24 00:36:16 +0000 | |
---|---|---|
committer | 2002-11-24 00:36:16 +0000 | |
commit | fb550d669b57cfb0642ddd462189392005e805c0 (patch) | |
tree | ac3942fbc51aba1580a317207bc4dd96ad78a6dd | |
parent | Sync with sbin/kbd/Makefile (diff) | |
download | wireguard-openbsd-fb550d669b57cfb0642ddd462189392005e805c0.tar.xz wireguard-openbsd-fb550d669b57cfb0642ddd462189392005e805c0.zip |
When initializing the colormap on low depth frame buffers, pick values
from rasops_cmap table, rather than providing our own, especially when
they are wrong.
-rw-r--r-- | sys/arch/sparc/dev/fb.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c index e9d8b05315c..e01eb66f149 100644 --- a/sys/arch/sparc/dev/fb.c +++ b/sys/arch/sparc/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.22 2002/11/06 21:06:20 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.23 2002/11/24 00:36:16 miod Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -414,15 +414,17 @@ fbwscons_setcolormap(sf, setcolor) struct sunfb *sf; void (*setcolor)(void *, u_int, u_int8_t, u_int8_t, u_int8_t); { + int i; + u_char *color; + if (sf->sf_depth <= 8 && setcolor != NULL) { + for (i = 0; i < 16; i++) { + color = (u_char *)&rasops_cmap[i * 3]; + setcolor(sf, i, color[0], color[1], color[2]); + } + /* compensate for BoW palette */ setcolor(sf, WSCOL_BLACK, 0, 0, 0); - setcolor(sf, 255, 0, 0, 0); - setcolor(sf, WSCOL_RED, 255, 0, 0); - setcolor(sf, WSCOL_GREEN, 0, 255, 0); - setcolor(sf, WSCOL_BROWN, 154, 85, 46); - setcolor(sf, WSCOL_BLUE, 0, 0, 255); - setcolor(sf, WSCOL_MAGENTA, 255, 255, 0); - setcolor(sf, WSCOL_CYAN, 0, 255, 255); + setcolor(sf, 255, 0, 0, 0); /* cursor */ setcolor(sf, WSCOL_WHITE, 255, 255, 255); } } |