use box drawing font if needed
This commit is contained in:
parent
8d6574053c
commit
1c134541af
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: p9100.c,v 1.54 2010/03/01 05:42:08 macallan Exp $ */
|
/* $NetBSD: p9100.c,v 1.55 2010/05/04 05:10:25 macallan Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.54 2010/03/01 05:42:08 macallan Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: p9100.c,v 1.55 2010/05/04 05:10:25 macallan Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -1085,6 +1085,7 @@ static void
|
||||||
p9100_putchar(void *cookie, int row, int col, u_int c, long attr)
|
p9100_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
{
|
{
|
||||||
struct rasops_info *ri = cookie;
|
struct rasops_info *ri = cookie;
|
||||||
|
struct wsdisplay_font *font = PICK_FONT(ri, c);
|
||||||
struct vcons_screen *scr = ri->ri_hw;
|
struct vcons_screen *scr = ri->ri_hw;
|
||||||
struct p9100_softc *sc = scr->scr_cookie;
|
struct p9100_softc *sc = scr->scr_cookie;
|
||||||
|
|
||||||
|
@ -1092,10 +1093,10 @@ p9100_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
int x, y, wi, he;
|
int x, y, wi, he;
|
||||||
|
|
||||||
wi = ri->ri_font->fontwidth;
|
wi = font->fontwidth;
|
||||||
he = ri->ri_font->fontheight;
|
he = font->fontheight;
|
||||||
|
|
||||||
if (!CHAR_IN_FONT(c, ri->ri_font))
|
if (!CHAR_IN_FONT(c, font))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bg = (u_char)ri->ri_devcmap[(attr >> 16) & 0xff];
|
bg = (u_char)ri->ri_devcmap[(attr >> 16) & 0xff];
|
||||||
|
@ -1106,15 +1107,15 @@ p9100_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
if (c == 0x20) {
|
if (c == 0x20) {
|
||||||
p9100_rectfill(sc, x, y, wi, he, bg);
|
p9100_rectfill(sc, x, y, wi, he, bg);
|
||||||
} else {
|
} else {
|
||||||
uc = c-ri->ri_font->firstchar;
|
uc = c - font->firstchar;
|
||||||
data = (uint8_t *)ri->ri_font->data + uc *
|
data = (uint8_t *)font->data + uc *
|
||||||
ri->ri_fontscale;
|
ri->ri_fontscale;
|
||||||
|
|
||||||
p9100_setup_mono(sc, x, y, wi, 1, fg, bg);
|
p9100_setup_mono(sc, x, y, wi, 1, fg, bg);
|
||||||
for (i = 0; i < he; i++) {
|
for (i = 0; i < he; i++) {
|
||||||
p9100_feed_line(sc, ri->ri_font->stride,
|
p9100_feed_line(sc, font->stride,
|
||||||
data);
|
data);
|
||||||
data += ri->ri_font->stride;
|
data += font->stride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: tcx.c,v 1.42 2009/09/17 16:39:48 tsutsui Exp $ */
|
/* $NetBSD: tcx.c,v 1.43 2010/05/04 05:10:25 macallan Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 1998, 2009 The NetBSD Foundation, Inc.
|
* Copyright (c) 1996, 1998, 2009 The NetBSD Foundation, Inc.
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.42 2009/09/17 16:39:48 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.43 2010/05/04 05:10:25 macallan Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* define for cg8 emulation on S24 (24-bit version of tcx) for the SS5;
|
* define for cg8 emulation on S24 (24-bit version of tcx) for the SS5;
|
||||||
|
@ -931,6 +931,7 @@ static void
|
||||||
tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
{
|
{
|
||||||
struct rasops_info *ri = cookie;
|
struct rasops_info *ri = cookie;
|
||||||
|
struct wsdisplay_font *font = PICK_FONT(ri, c);
|
||||||
struct vcons_screen *scr = ri->ri_hw;
|
struct vcons_screen *scr = ri->ri_hw;
|
||||||
struct tcx_softc *sc = scr->scr_cookie;
|
struct tcx_softc *sc = scr->scr_cookie;
|
||||||
uint64_t bg, fg, temp, mask;
|
uint64_t bg, fg, temp, mask;
|
||||||
|
@ -939,18 +940,17 @@ tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
uint8_t *cdata;
|
uint8_t *cdata;
|
||||||
uint16_t *wdata;
|
uint16_t *wdata;
|
||||||
|
|
||||||
addr = ri->ri_xorigin +
|
addr = ri->ri_xorigin + col * font->fontwidth +
|
||||||
col * ri->ri_font->fontwidth +
|
(ri->ri_yorigin + row * font->fontheight) * ri->ri_width;
|
||||||
(ri->ri_yorigin + row * ri->ri_font->fontheight) * ri->ri_width;
|
|
||||||
|
|
||||||
/* check if the character is crossing a 32 pixel boundary */
|
/* check if the character is crossing a 32 pixel boundary */
|
||||||
if ((addr & 0xffffe0) ==
|
if ((addr & 0xffffe0) ==
|
||||||
((addr + ri->ri_font->fontwidth - 1) & 0xffffe0)) {
|
((addr + font->fontwidth - 1) & 0xffffe0)) {
|
||||||
/* phew, not split */
|
/* phew, not split */
|
||||||
shift = addr & 0x1f;
|
shift = addr & 0x1f;
|
||||||
addr &= 0xffffe0;
|
addr &= 0xffffe0;
|
||||||
fmask = 0xffffffff >> (32 - ri->ri_font->fontwidth);
|
fmask = 0xffffffff >> (32 - font->fontwidth);
|
||||||
fmask = fmask << (32 - ri->ri_font->fontwidth - shift);
|
fmask = fmask << (32 - font->fontwidth - shift);
|
||||||
mask = fmask;
|
mask = fmask;
|
||||||
bg = 0x3000000000000000LL |
|
bg = 0x3000000000000000LL |
|
||||||
((uint64_t)ri->ri_devcmap[(attr >> 16) & 0xff] &
|
((uint64_t)ri->ri_devcmap[(attr >> 16) & 0xff] &
|
||||||
|
@ -959,12 +959,12 @@ tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
temp = 0x3000000000000000LL |
|
temp = 0x3000000000000000LL |
|
||||||
((uint64_t)ri->ri_devcmap[(attr >> 24) & 0xff] & 0xff) <<
|
((uint64_t)ri->ri_devcmap[(attr >> 24) & 0xff] & 0xff) <<
|
||||||
32;
|
32;
|
||||||
uc = c - ri->ri_font->firstchar;
|
uc = c - font->firstchar;
|
||||||
cdata = (uint8_t *)ri->ri_font->data + uc * ri->ri_fontscale;
|
cdata = (uint8_t *)font->data + uc * ri->ri_fontscale;
|
||||||
|
|
||||||
if (ri->ri_font->fontwidth < 9) {
|
if (font->fontwidth < 9) {
|
||||||
/* byte by byte */
|
/* byte by byte */
|
||||||
for (i = 0; i < ri->ri_font->fontheight; i++) {
|
for (i = 0; i < font->fontheight; i++) {
|
||||||
sc->sc_rstip[addr] = bg;
|
sc->sc_rstip[addr] = bg;
|
||||||
if (*cdata != 0) {
|
if (*cdata != 0) {
|
||||||
if (shift > 24) {
|
if (shift > 24) {
|
||||||
|
@ -979,10 +979,10 @@ tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
cdata++;
|
cdata++;
|
||||||
addr += ri->ri_width;
|
addr += ri->ri_width;
|
||||||
}
|
}
|
||||||
} else if (ri->ri_font->fontwidth < 17) {
|
} else if (font->fontwidth < 17) {
|
||||||
/* short by short */
|
/* short by short */
|
||||||
wdata = (uint16_t *)cdata;
|
wdata = (uint16_t *)cdata;
|
||||||
for (i = 0; i < ri->ri_font->fontheight; i++) {
|
for (i = 0; i < font->fontheight; i++) {
|
||||||
sc->sc_rstip[addr] = bg;
|
sc->sc_rstip[addr] = bg;
|
||||||
if (*wdata != 0) {
|
if (*wdata != 0) {
|
||||||
if (shift > 16) {
|
if (shift > 16) {
|
||||||
|
@ -1007,7 +1007,7 @@ tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
addr &= 0xffffe0;
|
addr &= 0xffffe0;
|
||||||
mask = 0xffffffff >> shift;
|
mask = 0xffffffff >> shift;
|
||||||
maskr = (uint64_t)(0xffffffffUL <<
|
maskr = (uint64_t)(0xffffffffUL <<
|
||||||
(32 - (ri->ri_font->fontwidth + shift - 32)));
|
(32 - (font->fontwidth + shift - 32)));
|
||||||
bg = 0x3000000000000000LL |
|
bg = 0x3000000000000000LL |
|
||||||
((uint64_t)ri->ri_devcmap[(attr >> 16) & 0xff] &
|
((uint64_t)ri->ri_devcmap[(attr >> 16) & 0xff] &
|
||||||
0xff) << 32;
|
0xff) << 32;
|
||||||
|
@ -1017,12 +1017,12 @@ tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
((uint64_t)ri->ri_devcmap[(attr >> 24) & 0xff] & 0xff) <<
|
((uint64_t)ri->ri_devcmap[(attr >> 24) & 0xff] & 0xff) <<
|
||||||
32;
|
32;
|
||||||
|
|
||||||
uc = c - ri->ri_font->firstchar;
|
uc = c - font->firstchar;
|
||||||
cdata = (uint8_t *)ri->ri_font->data + uc * ri->ri_fontscale;
|
cdata = (uint8_t *)font->data + uc * ri->ri_fontscale;
|
||||||
|
|
||||||
if (ri->ri_font->fontwidth < 9) {
|
if (font->fontwidth < 9) {
|
||||||
/* byte by byte */
|
/* byte by byte */
|
||||||
for (i = 0; i < ri->ri_font->fontheight; i++) {
|
for (i = 0; i < font->fontheight; i++) {
|
||||||
sc->sc_rstip[addr] = bg;
|
sc->sc_rstip[addr] = bg;
|
||||||
sc->sc_rstip[addr + 32] = bgr;
|
sc->sc_rstip[addr + 32] = bgr;
|
||||||
bork = *cdata;
|
bork = *cdata;
|
||||||
|
@ -1035,10 +1035,10 @@ tcx_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
cdata++;
|
cdata++;
|
||||||
addr += ri->ri_width;
|
addr += ri->ri_width;
|
||||||
}
|
}
|
||||||
} else if (ri->ri_font->fontwidth < 17) {
|
} else if (font->fontwidth < 17) {
|
||||||
/* short by short */
|
/* short by short */
|
||||||
wdata = (uint16_t *)cdata;
|
wdata = (uint16_t *)cdata;
|
||||||
for (i = 0; i < ri->ri_font->fontheight; i++) {
|
for (i = 0; i < font->fontheight; i++) {
|
||||||
sc->sc_rstip[addr] = bg;
|
sc->sc_rstip[addr] = bg;
|
||||||
sc->sc_rstip[addr + 32] = bgr;
|
sc->sc_rstip[addr + 32] = bgr;
|
||||||
bork = *wdata;
|
bork = *wdata;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: zx.c,v 1.35 2010/01/05 05:04:38 macallan Exp $ */
|
/* $NetBSD: zx.c,v 1.36 2010/05/04 05:10:25 macallan Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.35 2010/01/05 05:04:38 macallan Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.36 2010/05/04 05:10:25 macallan Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -993,9 +993,9 @@ static void
|
||||||
zx_putchar(void *cookie, int row, int col, u_int uc, long attr)
|
zx_putchar(void *cookie, int row, int col, u_int uc, long attr)
|
||||||
{
|
{
|
||||||
struct rasops_info *ri = cookie;
|
struct rasops_info *ri = cookie;
|
||||||
|
struct wsdisplay_font *font = PICK_FONT(ri, uc);
|
||||||
struct vcons_screen *scr = ri->ri_hw;
|
struct vcons_screen *scr = ri->ri_hw;
|
||||||
struct zx_softc *sc = scr->scr_cookie;
|
struct zx_softc *sc = scr->scr_cookie;
|
||||||
struct wsdisplay_font *font;
|
|
||||||
volatile uint32_t *dp;
|
volatile uint32_t *dp;
|
||||||
uint8_t *fb;
|
uint8_t *fb;
|
||||||
int fs, i, ul;
|
int fs, i, ul;
|
||||||
|
@ -1007,15 +1007,13 @@ zx_putchar(void *cookie, int row, int col, u_int uc, long attr)
|
||||||
if (uc == ' ') {
|
if (uc == ' ') {
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
x = ri->ri_xorigin + ri->ri_font->fontwidth * col;
|
x = ri->ri_xorigin + font->fontwidth * col;
|
||||||
y = ri->ri_yorigin + ri->ri_font->fontheight * row;
|
y = ri->ri_yorigin + font->fontheight * row;
|
||||||
zx_fillrect(sc, x, y, ri->ri_font->fontwidth,
|
zx_fillrect(sc, x, y, font->fontwidth,
|
||||||
ri->ri_font->fontheight, bg, ZX_STD_ROP);
|
font->fontheight, bg, ZX_STD_ROP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
font = ri->ri_font;
|
|
||||||
|
|
||||||
dp = (volatile uint32_t *)sc->sc_pixels +
|
dp = (volatile uint32_t *)sc->sc_pixels +
|
||||||
((row * font->fontheight + ri->ri_yorigin) << 11) +
|
((row * font->fontheight + ri->ri_yorigin) << 11) +
|
||||||
(col * font->fontwidth + ri->ri_xorigin);
|
(col * font->fontwidth + ri->ri_xorigin);
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#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/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -1345,6 +1345,7 @@ void
|
||||||
cgsix_putchar(void *cookie, int row, int col, u_int c, long attr)
|
cgsix_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
{
|
{
|
||||||
struct rasops_info *ri = cookie;
|
struct rasops_info *ri = cookie;
|
||||||
|
struct wsdisplay_font *font = PICK_FONT(ri, c);
|
||||||
struct vcons_screen *scr = ri->ri_hw;
|
struct vcons_screen *scr = ri->ri_hw;
|
||||||
struct cgsix_softc *sc = scr->scr_cookie;
|
struct cgsix_softc *sc = scr->scr_cookie;
|
||||||
int inv;
|
int inv;
|
||||||
|
@ -1359,10 +1360,10 @@ cgsix_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
int x, y, wi, he;
|
int x, y, wi, he;
|
||||||
volatile struct cg6_fbc *fbc = sc->sc_fbc;
|
volatile struct cg6_fbc *fbc = sc->sc_fbc;
|
||||||
|
|
||||||
wi = ri->ri_font->fontwidth;
|
wi = font->fontwidth;
|
||||||
he = ri->ri_font->fontheight;
|
he = font->fontheight;
|
||||||
|
|
||||||
if (!CHAR_IN_FONT(c, ri->ri_font))
|
if (!CHAR_IN_FONT(c, font))
|
||||||
return;
|
return;
|
||||||
inv = ((attr >> 8) & WSATTR_REVERSE);
|
inv = ((attr >> 8) & WSATTR_REVERSE);
|
||||||
if (inv) {
|
if (inv) {
|
||||||
|
@ -1383,15 +1384,15 @@ cgsix_putchar(void *cookie, int row, int col, u_int c, long attr)
|
||||||
if (c == 0x20) {
|
if (c == 0x20) {
|
||||||
cgsix_rectfill(sc, x, y, wi, he, bg);
|
cgsix_rectfill(sc, x, y, wi, he, bg);
|
||||||
} else {
|
} else {
|
||||||
uc = c-ri->ri_font->firstchar;
|
uc = c - font->firstchar;
|
||||||
data = (uint8_t *)ri->ri_font->data + uc *
|
data = (uint8_t *)font->data + uc *
|
||||||
ri->ri_fontscale;
|
ri->ri_fontscale;
|
||||||
|
|
||||||
cgsix_setup_mono(sc, x, y, wi, 1, fg, bg);
|
cgsix_setup_mono(sc, x, y, wi, 1, fg, bg);
|
||||||
for (i = 0; i < he; i++) {
|
for (i = 0; i < he; i++) {
|
||||||
cgsix_feed_line(sc, ri->ri_font->stride,
|
cgsix_feed_line(sc, font->stride,
|
||||||
data);
|
data);
|
||||||
data += ri->ri_font->stride;
|
data += font->stride;
|
||||||
}
|
}
|
||||||
/* put the chip back to normal */
|
/* put the chip back to normal */
|
||||||
fbc->fbc_incy = 0;
|
fbc->fbc_incy = 0;
|
||||||
|
|
Loading…
Reference in New Issue