rem: wheel_ydelta = ((packet[3] & 0x8) ? 0xFF : 0) | (packet[3] & 0x7);    if (wheel_ydelta == -2 || wheel_ydelta == 2) { wheel_xdelta = wheel_ydelta; wheel_ydelta = 0; }
add: switch (packet[3] & 0x0F) { case 0x01: wheel_ydelta = +1; break; case 0x0F: wheel_ydelta = -1; break; case 0x02: wheel_xdelta = +1; break; case 0x0E: wheel_xdelta = -1; break; }
context: ps2_packet_to_movement(uint8 packet[], mouse_movement *pos){	int buttons = packet[0] & 7;	int xDelta = ((packet[0] & 0x10) ? 0xFFFFFF00 : 0) | packet[1];	int yDelta = ((packet[0] & 0x20) ? 0xFFFFFF00 : 0) | packet[2];  	bigtime_t currentTime = system_time();	int8 wheel_ydelta = 0;	int8 wheel_xdelta = 0;  	  	if (buttons != 0) {  		if (sButtonsState == 0) {  			if (sLastClickTime + sClickSpeed > currentTime)  				sClickCount++;  			else  				sClickCount = 1;  		}  	}  	  	sLastClickTime = currentTime;  	sButtonsState = buttons;  	  	if (sPacketSize == PS2_PACKET_INTELLIMOUSE) {   		wheel_ydelta = ((packet[3] & 0x8) ? 0xFF : 0) | (packet[3] & 0x7);  		  		// Two wheeled mice use this nice trick:  		// they report -2 or +2 when the second wheel moved  		if (wheel_ydelta == -2 || wheel_ydelta == 2) {  			wheel_xdelta = wheel_ydelta;  			wheel_ydelta = 0;  		}  	}  	  	if (pos) {		pos->xdelta = xDelta;		pos->ydelta = yDelta;		pos->buttons = buttons;		pos->clicks = sClickCount;		pos->modifiers = 0;		pos->timestamp = currentTime;		pos->wheel_ydelta = (int)wheel_ydelta;		pos->wheel_xdelta = (int)wheel_xdelta;	}}