aboutsummaryrefslogtreecommitdiff
path: root/mousetsr.c
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-20 21:46:10 +0200
committerJavier <dev.git@javispedro.com>2022-04-20 21:46:10 +0200
commit3fc8ffbe9706908efbff7b131382fc79d18f75eb (patch)
treee76a4763131cf7d8df450fc9a7ed60578ad545f6 /mousetsr.c
parent499f265118b6f849e19fc0a832023d967caeeaa2 (diff)
downloadvbados-3fc8ffbe9706908efbff7b131382fc79d18f75eb.tar.gz
vbados-3fc8ffbe9706908efbff7b131382fc79d18f75eb.zip
assume we have a wheel when using vmware, even if we can't detect it
this restores wheel support when running under vmware and (unpatched) vkd
Diffstat (limited to 'mousetsr.c')
-rw-r--r--mousetsr.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mousetsr.c b/mousetsr.c
index 3acbda1..c46089b 100644
--- a/mousetsr.c
+++ b/mousetsr.c
@@ -996,7 +996,7 @@ static void reset_mouse_hardware()
data.bios_packet_size = PS2M_PACKET_SIZE_PLAIN;
}
}
-#endif
+#endif /* USE_WIN386 */
// Try to init PS/2 BIOS with desired packet size / streaming mode
err = ps2m_init(data.bios_packet_size);
@@ -1023,7 +1023,14 @@ static void reset_mouse_hardware()
if (data.usewheel) dlog_puts("PS/2 wheel NOT detected");
data.haswheel = false;
}
-#endif
+#if USE_VMWARE
+ // With the VMware backdoor, we can get the wheel information even if
+ // we couldn't configure the PS/2 mouse at all.
+ if (data.vmwavail && data.usewheel) {
+ data.haswheel = true;
+ }
+#endif /* USE_VMWARE */
+#endif /* USE_WHEEL */
ps2m_set_resolution(PS2M_RESOLUTION_200);
ps2m_set_sample_rate(PS2M_SAMPLE_RATE_80);