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/arch/sparc | |
parent | 5d42f78b945b989b44521c6b8d495bb31d881a19 (diff) |
Fix braino in mgx_loadcmap() invocation.
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/dev/mgx.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/arch/sparc/dev/mgx.c b/sys/arch/sparc/dev/mgx.c index 7729f383838..198c548dd7d 100644 --- a/sys/arch/sparc/dev/mgx.c +++ b/sys/arch/sparc/dev/mgx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mgx.c,v 1.12 2007/02/18 18:38:54 miod Exp $ */ +/* $OpenBSD: mgx.c,v 1.13 2008/04/15 16:03:08 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -291,11 +291,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); } @@ -306,17 +306,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++; } |