Skip to content

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

Open
felixrieseberg wants to merge 2 commits intocopy:masterfrom
felixrieseberg:vmware-abspointer
Open

Add VMware absolute-pointer backdoor (port 0x5658)#1542
felixrieseberg wants to merge 2 commits intocopy: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

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.
Comment thread src/vmware.js Outdated
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.
@copy
Copy link
Copy Markdown
Owner

copy commented Apr 19, 2026

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

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