PS/2: fix dead code.

hrev50506 extended the range of acceptable X and Y movement for PS/2
mouse. However, the value is sent on 1 byte (+ sign) so the check would
now always be valid.

Remove the check completely, we now rely only on bit 3 of the first byte
to be set (and not missing packets) to remain in sync with the mouse.

Thanks to Marcus Overhagen for reviewing the changes.
This commit is contained in:
Adrien Destugues 2016-08-26 07:10:01 +02:00
parent adc0f76e64
commit 8ae5ad2ccd

View File

@ -230,22 +230,10 @@ standard_mouse_handle_int(ps2_dev* dev)
if (cookie->packet_index == 1) {
int xDelta
= ((cookie->buffer[0] & 0x10) ? 0xFFFFFF00 : 0) | data;
if (xDelta < -256 || xDelta > 255) {
INFO("ps2: strange mouse data, x-delta %d, trying resync\n",
xDelta);
cookie->packet_index = 0;
return B_HANDLED_INTERRUPT;
}
}
if (cookie->packet_index == 2) {
int yDelta
= ((cookie->buffer[0] & 0x20) ? 0xFFFFFF00 : 0) | data;
if (yDelta < -256 || yDelta > 255) {
INFO("ps2: strange mouse data, y-delta %d, trying resync\n",
yDelta);
cookie->packet_index = 0;
return B_HANDLED_INTERRUPT;
}
}
cookie->buffer[cookie->packet_index++] = data;