do the charcter mapping in a separate function

This commit is contained in:
drochner 1998-06-26 21:05:20 +00:00
parent 3957af34c2
commit 3f10af182d
3 changed files with 21 additions and 30 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcdisplay_subr.c,v 1.4 1998/06/20 21:55:05 drochner Exp $ */
/* $NetBSD: pcdisplay_subr.c,v 1.5 1998/06/26 21:05:20 drochner Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -68,25 +68,18 @@ pcdisplay_cursor(id, on, row, col)
}
}
static u_char iso2ibm437[] =
#if 0
unsigned int
pcdisplay_mapchar_simple(id, uni)
void *id;
int uni;
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0xff, 0xad, 0x9b, 0x9c, 0, 0x9d, 0, 0x40,
0x6f, 0x63, 0x61, 0xae, 0, 0, 0, 0,
0xf8, 0xf1, 0xfd, 0x33, 0, 0xe6, 0, 0xfa,
0, 0x31, 0x6f, 0xaf, 0xac, 0xab, 0, 0xa8,
0x41, 0x41, 0x41, 0x41, 0x8e, 0x8f, 0x92, 0x80,
0x45, 0x90, 0x45, 0x45, 0x49, 0x49, 0x49, 0x49,
0x81, 0xa5, 0x4f, 0x4f, 0x4f, 0x4f, 0x99, 0x4f,
0x4f, 0x55, 0x55, 0x55, 0x9a, 0x59, 0, 0xe1,
0x85, 0xa0, 0x83, 0x61, 0x84, 0x86, 0x91, 0x87,
0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b,
0, 0xa4, 0x95, 0xa2, 0x93, 0x6f, 0x94, 0x6f,
0x6f, 0x97, 0xa3, 0x96, 0x81, 0x98, 0, 0
};
if (uni < 128)
return (uni);
return (1); /* XXX ??? smiley */
}
#endif
void
pcdisplay_putchar(id, row, col, c, attr)
@ -98,23 +91,16 @@ pcdisplay_putchar(id, row, col, c, attr)
struct pcdisplayscreen *scr = id;
bus_space_tag_t memt = scr->hdl->ph_memt;
bus_space_handle_t memh = scr->hdl->ph_memh;
u_char dc;
int off;
if (c < 128)
dc = c;
else if (c < 256)
dc = iso2ibm437[c - 128];
else
return;
off = row * scr->type->ncols + col;
if (scr->active)
bus_space_write_2(memt, memh, off * 2,
dc | (attr << 8));
c | (attr << 8));
else
scr->mem[off] = dc | (attr << 8);
scr->mem[off] = c | (attr << 8);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcdisplayvar.h,v 1.2 1998/06/20 21:55:06 drochner Exp $ */
/* $NetBSD: pcdisplayvar.h,v 1.3 1998/06/26 21:05:20 drochner Exp $ */
/*
* Copyright (c) 1998
@ -77,6 +77,10 @@ static inline void _pcdisplay_6845_write(ph, reg, val)
_pcdisplay_6845_write(ph, offsetof(struct reg_mc6845, reg), val)
void pcdisplay_cursor __P((void *, int, int, int));
#if 0
unsigned int pcdisplay_mapchar_simple __P((void *, int));
#endif
unsigned int pcdisplay_mapchar __P((void *, int));
void pcdisplay_putchar __P((void *, int, int, u_int, long));
void pcdisplay_copycols __P((void *, int, int, int,int));
void pcdisplay_erasecols __P((void *, int, int, int, long));

View File

@ -1,4 +1,4 @@
/* $NetBSD: vga.c,v 1.6 1998/06/20 21:55:06 drochner Exp $ */
/* $NetBSD: vga.c,v 1.7 1998/06/26 21:05:20 drochner Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -87,6 +87,7 @@ static int vga_alloc_attr __P((void *, int, int, int, long *));
const struct wsdisplay_emulops vga_emulops = {
pcdisplay_cursor,
pcdisplay_mapchar,
pcdisplay_putchar,
pcdisplay_copycols,
pcdisplay_erasecols,