joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.59k stars 376 forks source link

How to get mouse wheel support in windows 98? #4099

Open superblobster opened 1 year ago

superblobster commented 1 year ago

Question

I can't get the mouse wheel to work in win98. I've tried manually adding intellimouse drivers, but the system keeps automatically going back to the standard ps/2 port mouse. The auxdevice in the dosbox keyboard config is set to intellimouse, but it still won't work.

Is it even possible to get wheel support in win98? Can anyone confirm that it works (and post settings)?

Have you checked that no similar question(s) exist?

Code of Conduct & Contributing Guidelines

Torinde commented 1 year ago

Related wiki pages: Mouse, Win98 - unfortunately it seems you already tried those and if so somebody else has to help.

superblobster commented 1 year ago

Related wiki pages: Mouse, Win98 - unfortunately it seems you already tried those and if so somebody else has to help.

Yes, yes, I've tried all that, except VBMOUSE.EXE from the first link. However, this also doesn't do anything in w98 (apart from stating that the driver is loaded), and according to the website it is not designed for w9x at all.

I'm once again asking anyone to please confirm if mouse wheel scrolling works for you in a dosbox-x win98 guest OS.

rderooy commented 1 year ago

VBMOUSE.EXE is clearly meant for DOS. It will not work for Windows.

superblobster commented 1 year ago

@joncampbell123 Do you happen to know anything about this?

rderooy commented 1 year ago

Scroll wheel support in a Windows guest OS does not work at this point. Even if you install the MS IntelliPoint 4.12 drivers in Windows 98/98SE/ME or the MS IntelliPoint 4.01 drivers in Win95. Even if you force the IntelliPoint mouse driver, Windows is not cooperating.

joncampbell123 commented 1 year ago

Technical explanation: Windows 95/98/ME use the BIOS PS/2 functions to talk to the PS/2 mouse. They do not talk directly to the AUX port on the keyboard. At startup, it sets up the BIOS callback for 3 byte packets, then it does the Intellimouse setup which at the mouse device level changes the data to 4 byte packets, however it never tells the BIOS this change. So somehow... 3 bytes at a time, the 4 byte packet is to be read and scroll wheel info extracted.

I'm not entirely sure how that would even work. Perhaps it really does read the 4 byte packets 3 bytes at a time. Or maybe, since Windows 3.1/95/98/ME are known to virtualize I/O ports and interrupts for everything including DOS and the BIOS, maybe the VxD traps all actual I/O to the PS/2 keyboard and mouse controller, gathers all 4 bytes, then presents only the first 3 to the BIOS for the PS/2 callback function?

Also in DOSBox-X, as in other DOSBox forks, the PS/2 mouse callback function only provides the mouse movement and buttons, no scroll wheel data.

So far the only version of Windows known to work with DOSBox-X scroll wheel emulation is Windows 2000, which talks directly to the AUX port and never uses the BIOS. Windows XP might work too, but getting XP properly set up in DOSBox-X at this time is fairly iffy, has some strange problem with Windows Activation, and requires the use of an activation crack to make the desktop functional.

Torinde commented 1 year ago

@javispedro, do you know how to fix scroll wheel in Win9x?

Off-topic: VirtualBox horizontal scroll (tilt wheel) also needs fixing:

Torinde commented 1 year ago

dosbox-staging/dosbox-staging/pull/2287 by @FeralChild64 states: "Microsoft IntelliMouse Explorer is now emulated (5 buttons + wheel); relevant to Windows 9x only, tested with Windows 95 and IntelliPoint 3.0 driver (2.0 does not support this model, 4.0 contains some bloatware)"

joncampbell123 commented 1 year ago

dosbox-staging/dosbox-staging/pull/2287 by @FeralChild64 states: "Microsoft IntelliMouse Explorer is now emulated (5 buttons + wheel); relevant to Windows 9x only, tested with Windows 95 and IntelliPoint 3.0 driver (2.0 does not support this model, 4.0 contains some bloatware)"

Was this done by implementing INT 15h PS/2 code to handle each byte as it comes in instead of the DOSBox SVN hackery of just calling the PS/2 callback with stored mouse motion? Considering this issue I was considering that, if you've already done it in Staging that's really cool.

FeralChild64 commented 1 year ago

There is still some hackery in the PS/2 mouse BIOS, but much less, limited to initialization functions. Mouse movement BIOS support now handles bytes as they come from the Intel 8042 controller. The controller emulation was rewritten, register-level PS/2 mouse emulation should work properly unless software does something really non-standard (like accessing undocumented microcontroller memory, manipulating I/O lines, or using vendor-specific extensions).

javispedro commented 1 year ago

VBMOUSE.EXE is clearly meant for DOS. It will not work for Windows.

VBMOUSE.DRV does work under Win9x -- just install it manually i.e. edit autoexec.bat to load vbmouse.exe and system.ini to load mouse.drv=vbmouse.drv.

This will not give wheel support. Under all 386 protected mode windows (incl. 3.x & win9x) VKD.386 will not allow VMs to use the BIOS in 4-packet mode so there will not be any wheel support. The reason VBMOUSE.DRV works under DOSBox even when using 386 Windows is due to the hackery mentioned above -- the DOSBox int33 driver is able to "read the real mouse" without going through the PS2 IO ports and therefore without going through VKD. But under real hardware, the int33 mouse driver (e.g. vbmouse.exe) will have to go through PS2 ports, VKD virtualization, and therefore fail to read the 4th byte, so you will have no wheel. I have some patches for VKD on the vbmouse website to make it work.

Even under Windows 98+, VKD seems to be doing the same -- so no wheel support. It is not clear to me how the Intellimouse driver works around it (or even win98's native driver vmouse.vxd), but it seems to disable/reenable VKD at strategic points, thereby allowing raw IO access. For all I know it may be hooking int15 itself...

Torinde commented 1 year ago

Related notes: dosbox-x/NOTES/DOSBox mouse emulation assumptions and why they failed Windows NT and Windows ME

ghost commented 7 months ago

nvm, I won't help people who treat me with contempt