void gbox_init(struct ite_data *ip) { ip->bmv = gbox_windowmove; REGBASE->write_protect = 0x0; REGBASE->interrupt = 0x4; REGBASE->rep_rule = RR_COPY; REGBASE->blink1 = 0xff; REGBASE->blink2 = 0xff; REGBASE->sec_interrupt = 0x01; /* * Set up the color map entries. We use three entries in the * color map. The first, is for black, the second is for * white, and the very last entry is for the inverted cursor. */ REGBASE->creg_select = 0x00; REGBASE->cmap_red = 0x00; REGBASE->cmap_grn = 0x00; REGBASE->cmap_blu = 0x00; REGBASE->cmap_write = 0x00; gbcm_waitbusy(ip->regbase); REGBASE->creg_select = 0x01; REGBASE->cmap_red = 0xFF; REGBASE->cmap_grn = 0xFF; REGBASE->cmap_blu = 0xFF; REGBASE->cmap_write = 0x01; gbcm_waitbusy(ip->regbase); REGBASE->creg_select = 0xFF; REGBASE->cmap_red = 0xFF; REGBASE->cmap_grn = 0xFF; REGBASE->cmap_blu = 0xFF; REGBASE->cmap_write = 0x01; gbcm_waitbusy(ip->regbase); ite_fontinfo(ip); ite_fontinit8bpp(ip); /* * Clear the display. This used to be before the font unpacking * but it crashes. Figure it out later. */ gbox_windowmove(ip, 0, 0, 0, 0, ip->dheight, ip->dwidth, RR_CLEAR); tile_mover_waitbusy(ip->regbase); /* * Stash the inverted cursor. */ gbox_windowmove(ip, charY(ip, ' '), charX(ip, ' '), ip->cblanky, ip->cblankx, ip->ftheight, ip->ftwidth, RR_COPYINVERTED); }
void gbox_setcolor(struct diofb *fb, u_int index) { volatile struct gboxfb *gb = (struct gboxfb *)fb->regkva; gb->creg_select = index; gb->cmap_red = fb->cmap.r[index]; gb->cmap_grn = fb->cmap.g[index]; gb->cmap_blu = fb->cmap.b[index]; gb->cmap_write = !!index; gbcm_waitbusy(gb); }