Ejemplo n.º 1
0
void
rh_cursor(struct ite_softc *ip, int flag)
{
#if 0
	volatile u_char *ba = ip->grf->g_regkva;
#endif

	if (flag == START_CURSOROPT || flag == END_CURSOROPT)
		return;

	if (flag == ERASE_CURSOR) {
#if 0
		/* disable cursor */
		WCrt (ba, CRT_ID_CURSOR_START,
		    RCrt (ba, CRT_ID_CURSOR_START) | 0x20);
#endif
	} else {
		int pos = ip->curx + ip->cury * ip->cols;
#if 0
		/* make sure to enable cursor */
		WCrt (ba, CRT_ID_CURSOR_START,
		    RCrt (ba, CRT_ID_CURSOR_START) & ~0x20);
#endif

		/* and position it */
		RZ3SetCursorPos (ip->grf, pos);

		ip->cursorx = ip->curx;
		ip->cursory = ip->cury;
	}
}
Ejemplo n.º 2
0
void
et_cursor(struct ite_softc *ip, int flag)
{
	volatile u_char	*ba;
		 view_t	*v;
		 u_long cpos;

	ba = ((ipriv_t*)ip->priv)->regkva;
	v  = viewview(ip->grf->g_viewdev);

	/*
	 * Don't update the cursor when not on display
	 */
	if (!(v->flags & VF_DISPLAY))
		return;

	switch (flag) {
 	    case DRAW_CURSOR:
		/*WCrt(ba, CRT_ID_CURSOR_START, & ~0x20); */
	    case MOVE_CURSOR:
		cpos  =  RCrt(ba, CRT_ID_START_ADDR_LOW) & 0xff;
		cpos |= (RCrt(ba, CRT_ID_START_ADDR_HIGH) & 0xff) << 8;
		cpos += ip->curx + ip->cury * ip->cols;
		WCrt(ba, CRT_ID_CURSOR_LOC_LOW, cpos & 0xff);
		WCrt(ba, CRT_ID_CURSOR_LOC_HIGH, (cpos >> 8) & 0xff);
		WCrt(ba, CTR_ID_EXT_START, (cpos >> (16-2)) & 0x0c);

		ip->cursorx = ip->curx;
		ip->cursory = ip->cury;
		break;
	    case ERASE_CURSOR:
		/*WCrt(ba, CRT_ID_CURSOR_START, | 0x20); */
	    case START_CURSOROPT:
	    case END_CURSOROPT:
	    default:
		break;
    	}
}