Module Name: src Committed By: macallan Date: Tue May 4 05:11:06 UTC 2010
Modified Files: src/sys/dev/sun: cgsix.c Log Message: use box drawing font if needed To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/dev/sun/cgsix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/sun/cgsix.c diff -u src/sys/dev/sun/cgsix.c:1.46 src/sys/dev/sun/cgsix.c:1.47 --- src/sys/dev/sun/cgsix.c:1.46 Sat Sep 19 07:07:43 2009 +++ src/sys/dev/sun/cgsix.c Tue May 4 05:11:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: cgsix.c,v 1.46 2009/09/19 07:07:43 tsutsui Exp $ */ +/* $NetBSD: cgsix.c,v 1.47 2010/05/04 05:11:06 macallan Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.46 2009/09/19 07:07:43 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.47 2010/05/04 05:11:06 macallan Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1345,6 +1345,7 @@ cgsix_putchar(void *cookie, int row, int col, u_int c, long attr) { struct rasops_info *ri = cookie; + struct wsdisplay_font *font = PICK_FONT(ri, c); struct vcons_screen *scr = ri->ri_hw; struct cgsix_softc *sc = scr->scr_cookie; int inv; @@ -1359,10 +1360,10 @@ int x, y, wi, he; volatile struct cg6_fbc *fbc = sc->sc_fbc; - wi = ri->ri_font->fontwidth; - he = ri->ri_font->fontheight; + wi = font->fontwidth; + he = font->fontheight; - if (!CHAR_IN_FONT(c, ri->ri_font)) + if (!CHAR_IN_FONT(c, font)) return; inv = ((attr >> 8) & WSATTR_REVERSE); if (inv) { @@ -1383,15 +1384,15 @@ if (c == 0x20) { cgsix_rectfill(sc, x, y, wi, he, bg); } else { - uc = c-ri->ri_font->firstchar; - data = (uint8_t *)ri->ri_font->data + uc * + uc = c - font->firstchar; + data = (uint8_t *)font->data + uc * ri->ri_fontscale; cgsix_setup_mono(sc, x, y, wi, 1, fg, bg); for (i = 0; i < he; i++) { - cgsix_feed_line(sc, ri->ri_font->stride, + cgsix_feed_line(sc, font->stride, data); - data += ri->ri_font->stride; + data += font->stride; } /* put the chip back to normal */ fbc->fbc_incy = 0;