VOGONS


First post, by ludicrous_peridot

User metadata
Rank Member
Rank
Member

I've been at it before - using (more or less) modern controllers with DOS games (and no Win9X), but this time I had an idea for a new twist.

So, Bret Johnson's driver TSR already offers good customization options for game controllers for relatively modern MoBo-s. It only works with EMM386 however. For old games to have sound with those relatively modern MoBo-s JEMM + HDPMI combination is likely required (in conjunction with e.g. VSBHDA). But, as written just above, joystick drivers are unable to take advantage of port virtualization that JEMM and HDPMI offer, since the latter is not compatible with EMM386.

So I decided to combine the two: have my fork of VSBHDA run as usual, but specifically for port 201 forward the calls to joystick service routine from pre-loaded TSR. This way both joystick driver and sound driver can coexist, and hopefully not much development effort is required. I guess, I was inspired with how Doom was interfacing stats server.

So far as a proof of concept I decided to start with keys2joy TSR and with the approach, I am able to have (Bret Johnson's) THRUST.COM joystick tester pick up "joystick movement" from port 201 with JEMM + HDPMI + sound driver loaded, which is promissing (the TSR maps keyboard presses to joystick "inputs", effectively creating a virtual joystick).

There's little point in testing game compatibility of this toy version, as games will likely intercept keyboard input anyway resulting in unpredictable behavior (Keen and Wolf3D don't really work), but next step - trying this with Mr Johnson's USB stack is a very interesting one, so wish me luck 😀

Last edited by ludicrous_peridot on 2026-03-21, 19:38. Edited 1 time in total.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - CMI-8738 - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924
https://archive.org/details/peridot-26

Reply 1 of 3, by oso2k

User metadata
Rank Member
Rank
Member
ludicrous_peridot wrote on 2026-03-17, 22:39:

So, Bret Johnson's driver TSR already offers good customization options for game controllers for relatively modern MoBo-s. It only works with EMM386 however. For old games to have sound with those relatively modern MoBo-s JEMM + HDPMI combination is likely required (in conjunction with e.g. VSBHDA). But, as written just above, joystick drivers are unable to take advantage of port virtualization that JEMM and HDPMI offer, since the latter is not compatible with EMM386.

So Bret and Japheth are both active on the BttR forum. Bret is also active on the FreeDOS mailing lists. Maybe ask at one of those forums. Bret's work is pretty stable at this point. Japheth is more frequently taking patches on GitHub these days. There's a chance one or both could be interested in helping.

Reply 2 of 3, by ludicrous_peridot

User metadata
Rank Member
Rank
Member

A sound advice, although I somehow doubt that Bret Johnson would want to change the port virtualization code of his TSRs "after all these years", or that Baron-von-Riedesel will be keen to pull USB stack into his sound driver. So I am trying to solve this in a non-intrusive way, by effectively marrying the two, but keeping them largely stand-alone. I also think a fork is generally a better place for this type of thing, than a well established product, each of the two offerings are.

Anyway, I tested actual USBUHCIL/USBJSTIK combination with this approach using my old trusty Rumble Pad and got some very promissing results:

- Bret Johnson's own THRUST worked in port access mode
- Keen 4 picked up the joystick and allowed me to calibrate; in the menus there was a lot of drift, but ingame everything felt playable, no drift
- Wacky Wheels setup picked up the joysticks, allowed me to calibrate and successfully test
- Wacky Wheels had joystick controls operational post the setup, as well as digitized sound

Now Wacky Wheels did crash after a few minutes, with me actually pressing joystick button at the time, so some debugging is due, but overall SB emulation with VSBHDA fork in real and protected mode, can coexist with USB stack TSR, and VSBHDA can "offer port virtualization services" to the latter.

Once I try more games more systemically, and make sure they dont crash more often than they should, will be happy to post binaries for testing.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - CMI-8738 - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924
https://archive.org/details/peridot-26

Reply 3 of 3, by ludicrous_peridot

User metadata
Rank Member
Rank
Member

Okaaay... so things are much better than I anticipated. I played a few games, including Wacky Wheels again, and could not reproduce crashes anymore.
In fact I am quite excited that with the combination of VSBCMI and USBJSTIK, I am getting a whole array of amusing options for the controllers I have lying around...

The attachment 5330017602631308303.jpg is no longer available
The attachment 5330017602631308302.jpg is no longer available
The attachment 5330017602631308301.jpg is no longer available

Despite the experiment note being over yet, I have published the source code and "alpha-grade" binary in the VSBCMI repo.

Also posting the limitations and usage notes here:

To run:

  • obtain and unpack USBDOS.ZIP (FreeDOS also ships the drivers; they may or may not work)
  • run USBUHCIL
  • run USBJSTIK
  • run VSBCMI as usual (see HOWTO in source distribution for details) only with adding /J argument
  • to tweak joystick mapping or a particular game, run USBJSTIK < GAME.CFG which will refresh joystick TSR settings without need to unload or reboot anything.

When /J is not given, joystick support is ignored; TSR should work as usual.

Caveats and limitation (take note of alpha in version name):

  • only WATCOM build functions at the moment, DJGPP build is likely to be broken and has not been tested
  • 16-bit variant of VSBCMI crashes with /J option activated
  • because VSBCMI looks for exact version of USBJSTIK loaded in memory, it may or may not work with the driver installed on an arbitrary PC; version available on the official site linked above was tested
  • "virtual joystick port" to expose is hardcoded to 201h

Will be doing more rounds of testing, including on more than one machine and with actual HDA audio chip, and updating this post with the results.
One problem I am seeing is axis jitter, which also seems to result in "drift" that makes the solution hard to use in some games.
I am very surprised to see jitter and drift in a "fully digital" solution, and yet it's there.
It is also observed with USBJSTIK on its own (i.e. without JEMM+VSBCMI) and the degree seems to change depending on CPU speed settings.
I have not studied USBJSTIK source code just yet and, guess will be reaching out to Bret Johnson for advice on this eventually.

GA-G41M-Combo G41/ICH7 - Core 2 Quad Q9550 - DDR3 1033 - Radeon RX570 - CMI-8738 - X3MB (Buran)
Beetle/M/i815+ICH2 - Celeron 566Mhz - Opti 924
https://archive.org/details/peridot-26