summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2002-11-24 00:36:17 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2002-11-24 00:36:17 +0000
commit24f4d7536ffe031c91b2faf5c05d7808fe25da87 (patch)
tree0a16c72c0e9d849995bd23be065f1580a7cf97e0 /sys/arch/sparc
parente03ba8aee2dcb9ca26601d50b1040b92fdac04b1 (diff)
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.
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r--sys/arch/sparc/dev/fb.c18
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);
}
}