diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-04-15 16:03:13 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-04-15 16:03:13 +0000 |
commit | e719e0e1d29514a4f52184def3949e95e29d792f (patch) | |
tree | 677b0966e89f59664e6edf51bc916fe9c02dd072 /sys/dev/sbus/mgx.c | |
parent | 5d42f78b945b989b44521c6b8d495bb31d881a19 (diff) |
Fix braino in mgx_loadcmap() invocation.
Diffstat (limited to 'sys/dev/sbus/mgx.c')
-rw-r--r-- | sys/dev/sbus/mgx.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/dev/sbus/mgx.c b/sys/dev/sbus/mgx.c index d813abc6fbc..44284254bab 100644 --- a/sys/dev/sbus/mgx.c +++ b/sys/dev/sbus/mgx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mgx.c,v 1.8 2007/02/18 18:38:55 miod Exp $ */ +/* $OpenBSD: mgx.c,v 1.9 2008/04/15 16:03:12 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -349,11 +349,11 @@ void mgx_setcolor(void *v, u_int index, u_int8_t r, u_int8_t g, u_int8_t b) { struct mgx_softc *sc = v; + u_int i = index * 3; - index *= 3; - sc->sc_cmap[index++] = r; - sc->sc_cmap[index++] = g; - sc->sc_cmap[index] = b; + sc->sc_cmap[i++] = r; + sc->sc_cmap[i++] = g; + sc->sc_cmap[i] = b; mgx_loadcmap(sc, index, 1); } @@ -364,17 +364,8 @@ mgx_loadcmap(struct mgx_softc *sc, int start, int ncolors) u_int8_t *color; int i; -#if 0 sc->sc_vidc[CMAP_WRITE_INDEX] = start; color = sc->sc_cmap + start * 3; -#else - /* - * Apparently there is no way to load an incomplete cmap to this - * DAC. What a waste. - */ - ncolors = 256; - color = sc->sc_cmap; -#endif for (i = ncolors * 3; i != 0; i--) sc->sc_vidc[CMAP_DATA] = *color++; } |