diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-12-02 11:24:05 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-12-02 11:24:05 +0000 |
commit | c7a7963da6902fde50c09b326f851dca9b7b5bb9 (patch) | |
tree | 7bd796a0aafbeff2b8a33243b4572d3922896985 /sys/arch | |
parent | 47be3564bc984482f5c3dcbe44140cce633080b0 (diff) |
Use ri_devcmap to get corrected color values, instead of directly using
WSCOL_xxxx values.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc/dev/p9000.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc/dev/p9100.c | 7 | ||||
-rw-r--r-- | sys/arch/sparc/dev/zx.c | 8 |
3 files changed, 12 insertions, 7 deletions
diff --git a/sys/arch/sparc/dev/p9000.c b/sys/arch/sparc/dev/p9000.c index add708c2e8f..0e21f72607a 100644 --- a/sys/arch/sparc/dev/p9000.c +++ b/sys/arch/sparc/dev/p9000.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p9000.c,v 1.17 2006/11/29 19:08:22 miod Exp $ */ +/* $OpenBSD: p9000.c,v 1.18 2006/12/02 11:24:02 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. @@ -686,7 +686,7 @@ p9000_ras_do_cursor(struct rasops_info *ri) P9000_SELECT_DE_LOW(sc); P9000_WRITE_CMD(sc, P9000_DE_RASTER, (P9000_RASTER_PATTERN ^ P9000_RASTER_DST) & P9000_RASTER_MASK); - P9000_WRITE_CMD(sc, P9000_DE_FG_COLOR, WSCOL_BLACK); + P9000_WRITE_CMD(sc, P9000_DE_FG_COLOR, ri->ri_devcmap[WSCOL_BLACK]); P9000_SELECT_COORD(sc, P9000_LC_RECT); P9000_WRITE_CMD(sc, P9000_LC_RECT + P9000_COORD_XY, diff --git a/sys/arch/sparc/dev/p9100.c b/sys/arch/sparc/dev/p9100.c index 793e4d3e08d..066241abeb3 100644 --- a/sys/arch/sparc/dev/p9100.c +++ b/sys/arch/sparc/dev/p9100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p9100.c,v 1.40 2006/11/29 19:08:22 miod Exp $ */ +/* $OpenBSD: p9100.c,v 1.41 2006/12/02 11:24:02 miod Exp $ */ /* * Copyright (c) 2003, 2005, Miodrag Vallat. @@ -715,6 +715,7 @@ p9100_ras_erasecols(void *v, int row, int col, int n, long int attr) int fg, bg; ri->ri_ops.unpack_attr(v, attr, &fg, &bg, NULL); + bg = ri->ri_devcmap[bg]; n *= ri->ri_font->fontwidth; col *= ri->ri_font->fontwidth; @@ -747,6 +748,7 @@ p9100_ras_eraserows(void *v, int row, int n, long int attr) int fg, bg; ri->ri_ops.unpack_attr(v, attr, &fg, &bg, NULL); + bg = ri->ri_devcmap[bg]; p9100_drain(sc); P9100_SELECT_DE_LOW(sc); @@ -790,7 +792,8 @@ p9100_ras_do_cursor(struct rasops_info *ri) P9100_SELECT_DE_LOW(sc); P9100_WRITE_CMD(sc, P9000_DE_RASTER, (P9100_RASTER_PATTERN ^ P9100_RASTER_DST) & P9100_RASTER_MASK); - P9100_WRITE_CMD(sc, P9100_DE_COLOR0, P9100_COLOR8(WSCOL_BLACK)); + P9100_WRITE_CMD(sc, P9100_DE_COLOR0, + P9100_COLOR8(ri->ri_devcmap[WSCOL_BLACK])); P9100_SELECT_COORD(sc, P9000_LC_RECT); P9100_WRITE_CMD(sc, P9000_LC_RECT + P9000_COORD_XY, diff --git a/sys/arch/sparc/dev/zx.c b/sys/arch/sparc/dev/zx.c index d792a6aa3a3..3deb53f5aeb 100644 --- a/sys/arch/sparc/dev/zx.c +++ b/sys/arch/sparc/dev/zx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zx.c,v 1.16 2006/11/29 19:08:22 miod Exp $ */ +/* $OpenBSD: zx.c,v 1.17 2006/12/02 11:24:02 miod Exp $ */ /* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */ /* @@ -566,7 +566,7 @@ zx_fillrect(struct rasops_info *ri, int x, int y, int w, int h, long attr, ; SETREG(zd->zd_rop, rop); - SETREG(zd->zd_fg, bg << 24); + SETREG(zd->zd_fg, ri->ri_devcmap[bg] << 24); SETREG(zc->zc_extent, ZX_COORDS(w, h)); SETREG(zc->zc_fill, ZX_COORDS(x, y) | ZX_EXTENT_DIR_BACKWARDS); } @@ -650,7 +650,7 @@ zx_eraserows(void *cookie, int row, int num, long attr) ; SETREG(zd->zd_rop, ZX_STD_ROP); - SETREG(zd->zd_fg, bg << 24); + SETREG(zd->zd_fg, ri->ri_devcmap[bg] << 24); SETREG(zc->zc_extent, ZX_COORDS(ri->ri_width - 1, ri->ri_height - 1)); SETREG(zc->zc_fill, ZX_COORDS(0, 0) | ZX_EXTENT_DIR_BACKWARDS); @@ -693,6 +693,8 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr) ri = (struct rasops_info *)cookie; font = ri->ri_font; ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, &ul); + fg = ri->ri_devcmap[fg]; + bg = ri->ri_devcmap[bg]; dp = (volatile u_int32_t *)ri->ri_bits + ZX_COORDS(col * font->fontwidth, row * font->fontheight); |