int topcat_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop, int16_t planemask) { volatile struct tcboxfb *tc = (struct tcboxfb *)fb->regkva; tc_waitbusy(tc, fb->planemask); tc->wen = planemask; tc->wmrr = rop; if (planemask != 0xff) { tc->wen = planemask ^ 0xff; tc->wmrr = rop ^ 0x0f; tc->wen = fb->planemask; } tc->source_y = sy; tc->source_x = sx; tc->dest_y = dy; tc->dest_x = dx; tc->wheight = cy; tc->wwidth = cx; tc->wmove = fb->planemask; tc_waitbusy(tc, fb->planemask); return (0); }
void topcat_init(struct ite_data *ip) { ip->bmv = topcat_windowmove; /* * Catseye looks a lot like a topcat, but not completely. * So, we set some bits to make it work. */ if (REGBASE->fbid != GID_TOPCAT) { while ((REGBASE->catseye_status & 1)) ; REGBASE->catseye_status = 0x0; REGBASE->vb_select = 0x0; REGBASE->tcntrl = 0x0; REGBASE->acntrl = 0x0; REGBASE->pncntrl = 0x0; REGBASE->rug_cmdstat = 0x90; } /* * Determine the number of planes by writing to the first frame * buffer display location, then reading it back. */ REGBASE->wen = ~0; REGBASE->fben = ~0; REGBASE->prr = RR_COPY; *FBBASE = 0xFF; ip->planemask = *FBBASE; /* * Enable reading/writing of all the planes. */ REGBASE->fben = ip->planemask; REGBASE->wen = ip->planemask; REGBASE->ren = ip->planemask; REGBASE->prr = RR_COPY; ite_fontinfo(ip); /* * Clear the framebuffer on all planes. */ topcat_windowmove(ip, 0, 0, 0, 0, ip->fbheight, ip->fbwidth, RR_CLEAR); tc_waitbusy(ip->regbase, ip->planemask); ite_fontinit8bpp(ip); /* * Stash the inverted cursor. */ topcat_windowmove(ip, charY(ip, ' '), charX(ip, ' '), ip->cblanky, ip->cblankx, ip->ftheight, ip->ftwidth, RR_COPYINVERTED); }
void topcat_windowmove(struct ite_data *ip, int sy, int sx, int dy, int dx, int h, int w, int func) { struct tcboxfb *rp = REGBASE; if (h == 0 || w == 0) return; tc_waitbusy(ip->regbase, ip->planemask); rp->wmrr = func; rp->source_y = sy; rp->source_x = sx; rp->dest_y = dy; rp->dest_x = dx; rp->wheight = h; rp->wwidth = w; rp->wmove = ip->planemask; }