#ifdef ITECONSOLE
#include <sys/param.h>
#include <hp300/stand/common/itereg.h>
#include <hp300/stand/common/grf_dvreg.h>
#include <hp300/stand/common/samachdep.h>
#include <hp300/stand/common/itevar.h>
static void dv_reset(struct dvboxfb *);
static void dvbox_windowmove(struct ite_data *, int, int, int, int,
int, int, int);
void
dvbox_init(struct ite_data *ip)
{
struct dvboxfb *regbase;
int i;
ip->bmv = dvbox_windowmove;
regbase = (void *)ip->regbase;
dv_reset(regbase);
DELAY(4000);
regbase->interrupt = 0x04;
regbase->drive = 0x10;
regbase->rep_rule = RR_COPY << 4 | RR_COPY;
regbase->opwen = 0x01;
regbase->fbwen = 0x0;
regbase->fold = 0x01;
regbase->vdrive = 0x0;
regbase->dispen = 0x01;
regbase->opvenp = 0x01;
regbase->opvens = 0x01;
regbase->ovly0p = 0x0;
regbase->ovly0s = 0x0;
regbase->ovly1p = 0x0;
regbase->ovly1s = 0x0;
regbase->fv_trig = 0x1;
DELAY(400);
for (i = 0; i <= 1; i++) {
regbase->cmapbank = i;
regbase->rgb[0].red = 0x00;
regbase->rgb[0].green = 0x00;
regbase->rgb[0].blue = 0x00;
regbase->rgb[1].red = 0xFF;
regbase->rgb[1].green = 0xFF;
regbase->rgb[1].blue = 0xFF;
}
regbase->cmapbank = 0;
db_waitbusy(regbase);
ite_fontinfo(ip);
ite_fontinit8bpp(ip);
dvbox_windowmove(ip, 0, 0, 0, 0, ip->dheight, ip->dwidth, RR_CLEAR);
db_waitbusy(regbase);
dvbox_windowmove(ip, charY(ip, ' '), charX(ip, ' '),
ip->cblanky, ip->cblankx, ip->ftheight,
ip->ftwidth, RR_COPYINVERTED);
db_waitbusy(regbase);
}
static void
dvbox_windowmove(struct ite_data *ip, int sy, int sx, int dy, int dx, int h,
int w, int func)
{
struct dvboxfb *dp = (void *)ip->regbase;
if (h == 0 || w == 0)
return;
db_waitbusy(dp);
dp->rep_rule = func << 4 | func;
dp->source_y = sy;
dp->source_x = sx;
dp->dest_y = dy;
dp->dest_x = dx;
dp->wheight = h;
dp->wwidth = w;
dp->wmove = 1;
}
static void
dv_reset(struct dvboxfb *dbp)
{
dbp->reset = 0x80;
DELAY(400);
dbp->interrupt = 0x04;
dbp->en_scan = 0x01;
dbp->fbwen = ~0;
dbp->opwen = ~0;
dbp->fold = 0x01;
dbp->drive = 0x01;
dbp->rep_rule = 0x33;
dbp->alt_rr = 0x33;
dbp->zrr = 0x33;
dbp->fbvenp = 0xFF;
dbp->dispen = 0x01;
dbp->fbvens = 0x0;
dbp->fv_trig = 0x01;
DELAY(400);
dbp->vdrive = 0x0;
dbp->zconfig = 0x0;
while (dbp->wbusy & 0x01)
DELAY(400);
dbp->cmapbank = 0;
dbp->red0 = 0;
dbp->red1 = 0;
dbp->green0 = 0;
dbp->green1 = 0;
dbp->blue0 = 0;
dbp->blue1 = 0;
dbp->panxh = 0;
dbp->panxl = 0;
dbp->panyh = 0;
dbp->panyl = 0;
dbp->zoom = 0;
dbp->cdwidth = 0x50;
dbp->chstart = 0x52;
dbp->cvwidth = 0x22;
dbp->pz_trig = 1;
}
#endif