-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 3.1 absolute mouse #1552
Comments
Reading the doc linked from there about the VMware back door The API seems to have some things that are useful. I guess this is as close to a sort of standard it's possible to get in host/guest communication. |
So we can add a new mouse Or we can add similar mechanism Not sure which of the above 2 |
Thanks for more fully thinking this through. One practical thing I will do is some tests to verify our driver works as this does in the gif in their README, when it comes to moving the mouse in and out of the DOSEMU2 Window, I seem to recall various instances where it's not as well synced, but that could be due to my environment not DOSEMU2 itself. |
OK, there seem to be no qemu |
Should work under vmmware (not tested). See dosemu2/dosemu2#1552
Should now be fixed. |
Wow you added this before I managed to reply :) I always thought tablet mode would = absolute mouse, but maybe not ? I probably need to setup some Windows 3.1 VMs and see how the mouse works in them, which may result in a feature request to Qemu, but if tablet mode works could be moot. Cheers for implementing this I'll do some testing. |
I just found this:
Will give it a go in a bit. |
Doesn't work for me. |
Author of the original repo here, I'm going to try this in QEMU soon. Ping me if you have any questions about my source/the interface. I've been reading the QEMU impl source too. |
Yes, there is such impl.
You can easily see both of the |
The interface is also quite
Instead of having magic numbers In what resolution do they return |
Already found an answer: |
So when you do |
Well, dosemu2 is simply not
dosemu2 keeps all the above |
Likewise, port handler doesn't |
Yes, the backdoor does clobber EAX-EDX. I do notice the PS/2 stream is altered when you switch to absolute mode; I don't know if the protocol changes and it can communicate position that way or if the stream is inert and only used as an interrupt source; either way, it seems what you're supposed to do is check for PS/2 mouse events, then disregard their contents and do hypercalls instead (once to query, if successful, again to read). If you actually read a PS/2 packet (assuming it's in the normal format), it just looks like it's drifting to the bottom right, forever. I suspect a cleaner interface can probably be done; probably as you say, extending the PS/2 interface. Obviously, that'd need driver work again. |
Maybe this is a trick to re-sync
I suppose unless you work |
I've tried moving them for a while and it doesn't seem to be changing. (PS/2 button state does seem to work fine, so it makes me believe it's not being too misinterpreted.)
I don't, but it's quite possible DOSEmu doesn't have to repeat their mistakes. 🙃 Another note is that int 33h can actually deal with absolute coordinates, but in another way. I suspect you could possibly implement a |
But we already have that. :) |
The way it is currently done, |
I'm curious what it could provide beyond the current |
Funny you mention that, because I'm implementing this in the VMware mouse driver now 😬 |
How do we support wheel? |
Are you sure your demo shows |
I can't speak for Julius' demo, but I've got my own implementation of this in a branch I haven't pushed yet, because it's kinda gross right now. What I basically do right now is:
|
Would it be possible to make |
Yes, it would have to be |
I like that, will try. |
Anyway, this is what I mean that SC2k is already jumpy even with unpatched dosemu: sc2k_dosemu.mp4Notice the vertical desync. I don't have this problem at all with my int33 driver in VBox: sc2k_vbmouse.mp4Where I am not using the speed to scale the absolute coordinates -- just the window size. |
We have emumouse tool. |
Btw, sc2000 seems to do exactly |
Argh, I have been doing sensitivity incorrectly in my driver. int33.lst says that sensitivity is the same as speed, but even cutemouse itself treats sensitivity differently! But yeah, I see SimCity does set speed to [1,1] which given screen coords 640x480 means scaled to 5120x"1920", at the same time it sets a window size 5120x3840 , so this explains the emumouse 8 y trick, the game is likely wrong. But to me it just shows we should use window size only for scaling , not speed. Also dosemu uses 100 as the default sensitivity, but cutemouse uses 50 as default (and 100 is the max), and DOSBox copied the formula from cutemouse. What a mess =) |
No problem to sync sensitivity with |
Okey I see the point. serfcity/settlers is just setting a window of "5000x5000" , not changing the mouse speed at all, then proceeds to compute its own deltas of the mouse cursor position instead of using mickeys (wtf) . As a consequence of the windowsize-based scaling the mouse moves too fast in DOSBox, while in dosemu is it usable (but I still get a lot of desyncs!). There's another problem with speed/sensitivity: the coordinate system also scales with the screen resolution. Real hw int33 drivers don't know about SVGA and so they will still assume 640x200-based coordinates, but dosemu int33 knows about SVGA and so it will give you 800x600-based coordinates. Sorry. I guess I'll just do the int66, then use int33/0x26 to see if int66 worked, otherwise do the 0x7FFF window thing for the rest. |
But desyncs are unavoidable,
Try
But you can query the resolution with |
I can query the resolution even with the Windows API, but the problem is that no other int33 driver will do the same. My intention was to set speed to [1,1] and then a window to [5120,7680]. However on 800x600. int33/26 result does not change to reflect this (in any of the drivers). Also dosemu returns bx=1 incorrectly on int33/26 (which means error / driver disabled according to int33.lst and cutemouse src), should be 0 to indicate driver enabled. |
But you can query the resolution |
This logic works in all big 4 (Dosbox(-X), dosemu, Cutemouse, MS mouse):
I couldn't use:
|
Pushed. Here's a bin if someone wants to try. |
Good algo! |
Fixed it myself. :) |
@Baron-von-Riedesel @jschwartzenberg |
I think https://depot.javispedro.com/vbox/vbados/ Thank you! |
I have updated them to the last versions. But there are no new changes to win16 mouse since the binary from #1552 (comment) We also need to see if the win16 driver is not too crashy . Not sure that all these win16 API functions are reentrant/safe to call from int33 handler. If they aren't, I'll have to move the scroll wheel logic into a usermode .DLL . |
My guess is the functions we're calling seem mostly interrupt safe, because they don't do much:
The only problem ones I could think of might be PostMessage (has to write messages somewhere). Also note a few of the DDK drivers do call USER functions. (Some is also just display drivers trying to dig for GDI functions, or stuff with pluggable components like KEYBOARD.) Some even outright call MessageBox and PostMessage, which I think would be pretty complex. (Printer drivers also do it, but they seem universally written in C and are loaded pretty late in the game, so I think they're a special case of not being a special case.) |
Just out of curiosity: |
I didn't think it was possible (cursor rendering is done by video driver on 3.x and that's quite a beast). |
Ah, as far as I can recall, we |
@javispedro Unrelated but since we're on the same thread, regarding:
in your repo, I believe there's a VMware HGFS client in [https://sites.google.com/site/chitchatvmback/vmtools](this guy's source for various utilities), some of which work on DOS, though it's quite old. Unfortunately when I last tried it, it didn't work with modern Workstation for some reason. |
Found another VMware client http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/repositories/1.3/pkg-html/vmsmount.html , this one from FreeDOS. It's also Watcom C and quite decently written. I really could have used it while writing mine. We really need a better catalog of DOS software :) |
@javispedro I am getting certificate |
Should be fixed (first time certbot setup for that machine...). |
Thank you. |
https://github.com/NattyNarwhal/vmwmouse
There is a new mouse driver for Windows 3.1 in VMware, it could provide a basis for more seamless mouse support in dosemu2 in Windows 3.1.
Apologies if this isn't needed, I'm not in front of a computer to test right now.
The text was updated successfully, but these errors were encountered: