VOGONS

Common searches


First post, by Yonibear

User metadata
Rank Newbie
Rank
Newbie

Bored on new years eve, we decided that we wanted to play Settler 2 multiplayer through dosbox on Linux. For those who do not remember, Settler's multiplayer solution was to split screen and attach a second mouse to the COM Port.
Unfortunately the basic X11 API does not provide a way to distinguish between mouses (We are investigating the usefulness of XInput though). The only solution is to use the evdev devices (/dev/input/event*) and grab the raw mouse events. To make this a bit simpler, we used the input library libGII, which offered a driver using these input devices.
We implemented a serial port driver to emulate the second mouse, and still use dosbox' PS/2 emulation for the primary mouse. This means that the second mouse must be made invisible to X, since it generates both evdev and X CorePointer events. Newer Xservers using the evdev input driver use HAL to detect the available input devices. Our quick solution was to create a HAL policy that blocks the second mouse to be used by X11.

With a patched dosbox version, your dosbox.conf should have a section like this:

[serial]
serial1=mouse giidriver:input-linux-evdev:/dev/input/event4

You have to figure out the correct /dev/input/event* yourself, and also may have to chown it to 666, because current distributions usually do not make it user readable.
You can try other GII drivers on your own, but beware, since your computer will propably explode.

If you start the game now, you will notice that the secondary mouse will control both player. To prevent the second mouse being detected by X, you have to create a special HAL policy.
First you will have to find out the exact vendor and product ID of your mouse with lsusb (first column).
Then you create a file named like 10-dosbox-mouse.fdi and place it in /etc/hal/fdi/policy/ .

The file content should look like this, adapt it with your USB IDs:
Pay attention that leading zero's are stripped, so that 046d:c018 from lsusb gets converted to usb_device_46d_c018, like in the example.

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.mouse">
<match key="info.udi" contains="usb_device_46d_c018">
<merge key="input.x11_driver" type="string"></merge>
</match>
</match>
</device>
</deviceinfo>

Restart HAL, replug the mouse and enjoy your dysfunctional mouse. To reverse, just delete the .fdi file and repeat.

We are aware that this is not really a solid solution yet. We are currently investigating if we can achieve grabbing of a certain mouse with XInput, but the state of Linux APIs in this field seems to be rather sorry.

Attachments

  • Filename
    dosbox_multimouse_screenshot.png
    File size
    1.09 MiB
    Downloads
    19 downloads
    File comment
    Screenshot
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox_multimouse.diff
    File size
    13.16 KiB
    Downloads
    121 downloads
    File comment
    Dosbox code patch against CVS
    File license
    Fair use/fair dealing exception

Reply 1 of 3, by bugs_bugger

User metadata
Rank Member
Rank
Member

Sounds like great work. I did not try your patch though, as I own a serial mouse to play Settlers 2 multiplayer games. I think you should split your project into two parts. One that is OS independent and one that is OS dependent and connect them trough Network. The task of the first part would be to receive network packages and to translate them into the serial mouse protocol. The second part would be responsible for grabbing the mouse which also could happen on a different PC. In comination with transmitted image and sound it could lead to Network play and also solve the problem of two mice at one X11 screen. Your project would also become less OS dependent.

Reply 2 of 3, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Looks like fun 😀

You might want to check out sdl 1.3, specifically the manymouse tree
(don't know if this is merged into the development tree) :
http://www.libsdl.org/cgi/viewvc.cgi/branches … 2008_manymouse/

Reply 3 of 3, by anamika

User metadata
Rank Newbie
Rank
Newbie

It's probably not possible to get MIDI daugtherboards working in Win7, as Microsoft removed support for DB15 joystick ports due to the performance hit from having to poll them. As a result, Creative dropped all support for the whole joystick+MPU401 subsystem of their cards. I found this out the hard way when I tried putting my old SB Live in a Win7 machine to use as an MPU401 interface.

If you are looking for fast success in pass4-sure.us exams then join today to explore complete Rochester College dumps resources.