Fixed the InPort mouse, again.
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
*
|
*
|
||||||
* Based on an early driver for MINIX 1.5.
|
* Based on an early driver for MINIX 1.5.
|
||||||
*
|
*
|
||||||
* Version: @(#)mouse_bus.c 1.0.35 2018/05/21
|
* Version: @(#)mouse_bus.c 1.0.36 2018/05/22
|
||||||
*
|
*
|
||||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
*
|
*
|
||||||
@@ -255,34 +255,37 @@ ms_write(mouse_t *dev, uint16_t port, uint8_t val)
|
|||||||
case MSMOUSE_DATA:
|
case MSMOUSE_DATA:
|
||||||
picintc(1 << dev->irq);
|
picintc(1 << dev->irq);
|
||||||
|
|
||||||
if (val == MSDATA_IRQ) {
|
if (val == MSDATA_IRQ)
|
||||||
picint(1<<dev->irq);
|
picint(1 << dev->irq);
|
||||||
} else {
|
else {
|
||||||
switch (dev->r_cmd) {
|
switch (dev->r_cmd) {
|
||||||
case MSCTRL_COMMAND:
|
case MSCTRL_COMMAND:
|
||||||
valxor = (dev->r_ctrl ^ val);
|
valxor = (dev->r_ctrl ^ val);
|
||||||
|
|
||||||
if (valxor & MSCTRL_FREEZE) {
|
if (valxor & MSCTRL_FREEZE) {
|
||||||
if (val & LTCTRL_FREEZE) {
|
if (val & MSCTRL_FREEZE) {
|
||||||
/* Hold the sampling while we do something. */
|
/* Hold the sampling while we do something. */
|
||||||
dev->flags |= FLAG_FROZEN;
|
dev->flags |= FLAG_FROZEN;
|
||||||
} else {
|
} else {
|
||||||
/* Reset current state. */
|
/* Reset current state. */
|
||||||
dev->flags &= ~FLAG_FROZEN;
|
dev->flags &= ~FLAG_FROZEN;
|
||||||
|
|
||||||
|
dev->x = dev->y = 0;
|
||||||
|
dev->but = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (val & (MSCTRL_IENB_M | MSCTRL_IENB_A))
|
if (val & (MSCTRL_IENB_M | MSCTRL_IENB_A))
|
||||||
dev->flags |= FLAG_INTR;
|
dev->flags |= FLAG_INTR;
|
||||||
else
|
else
|
||||||
dev->flags &= ~FLAG_INTR;
|
dev->flags &= ~FLAG_INTR;
|
||||||
|
|
||||||
dev->r_ctrl = val;
|
dev->r_ctrl = val;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user