Skip to content

Add VMware absolute-pointer backdoor (port 0x5658)#1542

Merged
copy merged 4 commits into
copy:masterfrom
felixrieseberg:vmware-abspointer
Jun 8, 2026
Merged

Add VMware absolute-pointer backdoor (port 0x5658)#1542
copy merged 4 commits into
copy:masterfrom
felixrieseberg:vmware-abspointer

Conversation

@felixrieseberg

Copy link
Copy Markdown
Contributor

Implements GETVERSION + ABSPOINTER_{COMMAND,STATUS,DATA} so a guest driver (VBADOS VBMOUSE, vmwmouse, Linux vmmouse) can read the host cursor position and track it 1:1 without pointer lock.

The queue is fed by the existing mouse-absolute bus event that MouseAdapter already emits; PS/2 still supplies IRQ12 (the driver reads this port on each mouse IRQ). Move-only packets are coalesced in place so the guest never falls more than one packet behind regardless of how slowly it drains. Emits vmware-absolute-mouse on the bus when the guest toggles absolute mode so the embedder can drop pointer lock and hide the host cursor.

In practice, this is what it looks like on Windows 95:

cursor.mov

Comment thread src/vmware.js Outdated
@copy

copy commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Nice work, thanks.

This breaks mouse movement when the mouse is locked. We should probably have at least one of these, preferably both:

  1. When a device uses absolute mouse positions, clicking on the screen doesn't lock the mouse (and possibly removes mouse lock when the OS initialises the device)
  2. If the mouse is locked (for example for games), send relative positions instead of absolute (if possible)

Oh, and updating the documentation how to install the driver on old Windows versions would be nice. I tested on Arch and it works out of the box.

@felixrieseberg

Copy link
Copy Markdown
Contributor Author

Sounds good, thanks for the feedback - I'll add it! Give me a week or so

Implements GETVERSION + ABSPOINTER_{COMMAND,STATUS,DATA} so a guest
driver (VBADOS VBMOUSE, vmwmouse, Linux vmmouse) can read the host
cursor position and track it 1:1 without pointer lock.

The queue is fed by the existing mouse-absolute bus event that
MouseAdapter already emits; PS/2 still supplies IRQ12 (the driver reads
this port on each mouse IRQ). Move-only packets are coalesced in place
so the guest never falls more than one packet behind regardless of how
slowly it drains. Emits vmware-absolute-mouse on the bus when the guest
toggles absolute mode so the embedder can drop pointer lock and hide the
host cursor.

State save/restore covers the enabled/absolute flags.
DEBUG builds assert on unregistered IO widths; some guests probe 0x5658
with IN AX,DX during detection. Answer 8/16-bit reads as an empty port
and ignore writes.

The |0 on the ABSPOINTER subcommand case labels was sign-coercion to
match Int32Array reads, but all four constants fit in 31 bits so it was
a no-op.
- Don't lock the pointer on screen click while the guest uses absolute
  positioning, and release an existing lock when the guest driver enables
  absolute mode
- While the pointer is locked (e.g. for games), report movement as relative
  packets instead of absolute positions, since no meaningful absolute
  position exists under pointer lock
- Document VMware Tools mouse driver installation for Windows 9x and 2000/XP
Comment thread docs/windows-nt.md Outdated
@copy copy merged commit 3f8f9ea into copy:master Jun 8, 2026
2 of 3 checks passed
@copy

copy commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Nice contribution, thanks!

@copy

copy commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Small follow-up: 7919dfb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants