i = usec2ticks(sc->timeout[joypart(dev)]);
i = USEC2TICKS(sc->timeout[JOYPART(dev)]);
joyread(dev, uio, flag)	dev_t   dev;	struct uio *uio;	int     flag;{	int     unit = JOYUNIT(dev);	struct joy_softc *sc = joycd.cd_devs[unit];	int     port = sc->port;	int     i, t0, t1;	int     state = 0, x = 0, y = 0;	struct joystick c;	disable_intr();	outb(port, 0xff);	t0 = get_tick();	t1 = t0;	i = usec2ticks(sc->timeout[joypart(dev)]);	while (t0 - t1 < i) {		state = inb(port);		if (joypart(dev) == 1)			state >>= 2;		t1 = get_tick();		if (t1 > t0)			t1 -= TIMER_FREQ / hz;		if (!x && !(state & 0x01))			x = t1;		if (!y && !(state & 0x02))			y = t1;		if (x && y)			break;	}	enable_intr();	c.x = x ? sc->x_off[joypart(dev)] + ticks2usec(t0 - x) : 0x80000000;	c.y = y ? sc->y_off[joypart(dev)] + ticks2usec(t0 - y) : 0x80000000;	state >>= 4;	c.b1 = ~state & 1;	c.b2 = ~(state >> 1) & 1;	return uiomove((caddr_t) & c, sizeof(struct joystick), uio);}