Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers. Also rename ite_fontinit() to ite_fontinit8bpp(). From OpenBSD.
This commit is contained in:
parent
922afc1884
commit
36ac47ef5d
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ite_dv.c,v 1.8 2011/02/08 20:20:14 rmind Exp $ */
|
||||
/* $NetBSD: ite_dv.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -115,7 +115,7 @@ dvbox_init(struct ite_data *ip)
|
|||
db_waitbusy(regbase);
|
||||
|
||||
ite_fontinfo(ip);
|
||||
ite_fontinit(ip);
|
||||
ite_fontinit8bpp(ip);
|
||||
|
||||
/*
|
||||
* Clear the (visible) framebuffer.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ite_gb.c,v 1.8 2011/02/08 20:20:14 rmind Exp $ */
|
||||
/* $NetBSD: ite_gb.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -91,7 +91,7 @@ gbox_init(struct ite_data *ip)
|
|||
gbcm_waitbusy(regbase);
|
||||
|
||||
ite_fontinfo(ip);
|
||||
ite_fontinit(ip);
|
||||
ite_fontinit8bpp(ip);
|
||||
|
||||
/*
|
||||
* Clear the display. This used to be before the font unpacking
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ite_hy.c,v 1.10 2011/02/08 20:20:14 rmind Exp $ */
|
||||
/* $NetBSD: ite_hy.c,v 1.11 2011/02/10 11:08:23 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -55,7 +55,6 @@
|
|||
#define charX(ip,c) \
|
||||
(((c) % (ip)->cpl) * ((((ip)->ftwidth + 7) / 8) * 8) + (ip)->fontx)
|
||||
|
||||
void hyper_ite_fontinit(struct ite_data *);
|
||||
void hyper_windowmove(struct ite_data *, int, int, int, int, int, int, int);
|
||||
|
||||
void
|
||||
|
@ -76,7 +75,7 @@ hyper_init(struct ite_data *ip)
|
|||
*/
|
||||
hyper_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
|
||||
|
||||
hyper_ite_fontinit(ip);
|
||||
ite_fontinit1bpp(ip);
|
||||
|
||||
/*
|
||||
* Stash the inverted cursor.
|
||||
|
@ -86,34 +85,6 @@ hyper_init(struct ite_data *ip)
|
|||
ip->ftwidth, RR_COPYINVERTED);
|
||||
}
|
||||
|
||||
void
|
||||
hyper_ite_fontinit(struct ite_data *ip)
|
||||
{
|
||||
u_char *fbmem, *dp;
|
||||
int c, l, b;
|
||||
int stride, width;
|
||||
|
||||
dp = (u_char *)(getword(ip, getword(ip, FONTROM) + FONTADDR) +
|
||||
(char *)ip->regbase) + FONTDATA;
|
||||
stride = ip->fbwidth >> 3;
|
||||
width = (ip->ftwidth + 7) / 8;
|
||||
|
||||
for (c = 0; c < 128; c++) {
|
||||
fbmem = (u_char *) FBBASE +
|
||||
(ip->fonty + (c / ip->cpl) * ip->ftheight) *
|
||||
stride;
|
||||
fbmem += (ip->fontx >> 3) + (c % ip->cpl) * width;
|
||||
for (l = 0; l < ip->ftheight; l++) {
|
||||
for (b = 0; b < width; b++) {
|
||||
*fbmem++ = *dp;
|
||||
dp += 2;
|
||||
}
|
||||
fbmem -= width;
|
||||
fbmem += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
hyper_putc(struct ite_data *ip, int c, int dy, int dx, int mode)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ite_rb.c,v 1.9 2011/02/08 20:20:14 rmind Exp $ */
|
||||
/* $NetBSD: ite_rb.c,v 1.10 2011/02/10 11:08:23 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -113,7 +113,7 @@ rbox_init(struct ite_data *ip)
|
|||
regbase->write_enable = 0x01;
|
||||
regbase->opwen = 0x00;
|
||||
|
||||
ite_fontinit(ip);
|
||||
ite_fontinit8bpp(ip);
|
||||
|
||||
/*
|
||||
* Stash the inverted cursor.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ite_subr.c,v 1.8 2011/02/10 10:44:22 tsutsui Exp $ */
|
||||
/* $NetBSD: ite_subr.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -82,7 +82,35 @@ ite_fontinfo(struct ite_data *ip)
|
|||
}
|
||||
|
||||
void
|
||||
ite_fontinit(struct ite_data *ip)
|
||||
ite_fontinit1bpp(struct ite_data *ip)
|
||||
{
|
||||
u_char *fbmem, *dp;
|
||||
int c, l, b;
|
||||
int stride, width;
|
||||
|
||||
dp = (u_char *)(getword(ip, getword(ip, FONTROM) + FONTADDR) +
|
||||
(char *)ip->regbase) + FONTDATA;
|
||||
stride = ip->fbwidth >> 3;
|
||||
width = (ip->ftwidth + 7) / 8;
|
||||
|
||||
for (c = 0; c < 128; c++) {
|
||||
fbmem = (u_char *) FBBASE +
|
||||
(ip->fonty + (c / ip->cpl) * ip->ftheight) *
|
||||
stride;
|
||||
fbmem += (ip->fontx >> 3) + (c % ip->cpl) * width;
|
||||
for (l = 0; l < ip->ftheight; l++) {
|
||||
for (b = 0; b < width; b++) {
|
||||
*fbmem++ = *dp;
|
||||
dp += 2;
|
||||
}
|
||||
fbmem -= width;
|
||||
fbmem += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ite_fontinit8bpp(struct ite_data *ip)
|
||||
{
|
||||
int bytewidth = (((ip->ftwidth - 1) / 8) + 1);
|
||||
int glyphsize = bytewidth * ip->ftheight;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ite_tc.c,v 1.8 2011/02/08 20:20:14 rmind Exp $ */
|
||||
/* $NetBSD: ite_tc.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -99,7 +99,7 @@ topcat_init(struct ite_data *ip)
|
|||
topcat_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR);
|
||||
tc_waitbusy(regbase, ip->planemask);
|
||||
|
||||
ite_fontinit(ip);
|
||||
ite_fontinit8bpp(ip);
|
||||
|
||||
/*
|
||||
* Stash the inverted cursor.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: itevar.h,v 1.10 2011/02/10 10:52:01 tsutsui Exp $ */
|
||||
/* $NetBSD: itevar.h,v 1.11 2011/02/10 11:08:23 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -186,7 +186,8 @@ extern int nitesw;
|
|||
* Prototypes.
|
||||
*/
|
||||
void ite_fontinfo(struct ite_data *);
|
||||
void ite_fontinit(struct ite_data *);
|
||||
void ite_fontinit1bpp(struct ite_data *);
|
||||
void ite_fontinit8bpp(struct ite_data *);
|
||||
|
||||
/*
|
||||
* Framebuffer-specific ITE prototypes.
|
||||
|
|
Loading…
Reference in New Issue