Author Topic: DOS VDM - USB and Game port Gamepad support  (Read 612 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 617
  • -Receive: 123
  • Posts: 3315
  • Karma: +28/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
DOS VDM - USB and Game port Gamepad support
« on: September 30, 2021, 11:33:38 pm »
Hi

At Warpstock there was a quick Q&A with Lewis and there was some talk about ArcaOS as a retro gaming platform.
There was some fast comment about gamepads/joysticks and DOS old games.

I asked on the FreeDOS mailinglist if there was something like a way to connect an USB gamepad and some "interpreter" that will allow old DOS games see it as a game port joystick. (So, in the end you can be able to play games that are supposed to use a game port joystick with an USB joystick).

Bret Johnson, that developed some USB device drivers for DOS (http://bretjohnson.us/) , answer me that it is possible with his driver, but under a very specific USB hardware set running FreeDOS.

The final idea will be to be able to support an USB gamepad under DOS VDM for old DOS games, but it seems we are still some steps behind.

I just post this as a discussion topic and maybe something of the open source DOS USB driver/program can be useful someday for the OS/2 platform.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Mentore

  • Jr. Member
  • **
  • Thank You
  • -Given: 20
  • -Receive: 5
  • Posts: 81
  • Karma: +3/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #1 on: October 02, 2021, 11:02:28 am »
Hi

At Warpstock there was a quick Q&A with Lewis and there was some talk about ArcaOS as a retro gaming platform.
There was some fast comment about gamepads/joysticks and DOS old games.

I asked on the FreeDOS mailinglist if there was something like a way to connect an USB gamepad and some "interpreter" that will allow old DOS games see it as a game port joystick. (So, in the end you can be able to play games that are supposed to use a game port joystick with an USB joystick).

Bret Johnson, that developed some USB device drivers for DOS (http://bretjohnson.us/) , answer me that it is possible with his driver, but under a very specific USB hardware set running FreeDOS.

The final idea will be to be able to support an USB gamepad under DOS VDM for old DOS games, but it seems we are still some steps behind.

I just post this as a discussion topic and maybe something of the open source DOS USB driver/program can be useful someday for the OS/2 platform.

Regards

ISTR that Wim Brul developed usbecd**.zip "generic" drivers, which may be useful to understand/read classless devices. Maybe one could try these?

(Too bad I currently do not have an ArcaOS machine. Need time to install the latest beta for the italian NLV!)

Mentore

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 617
  • -Receive: 123
  • Posts: 3315
  • Karma: +28/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #2 on: October 02, 2021, 02:27:11 pm »
ISTR that Wim Brul developed usbecd**.zip "generic" drivers, which may be useful to understand/read classless devices. Maybe one could try these?

Hi Mentore

That may be interesting as a first step. Trying to see if with "USBRESMG.SYS" and/or the Wim Brul' drivers something came out of a USB gamepad attached to OS/2.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Lars

  • Hero Member
  • *****
  • Thank You
  • -Given: 2
  • -Receive: 78
  • Posts: 834
  • Karma: +25/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #3 on: October 02, 2021, 03:55:32 pm »
US CALLS and USBRESMG are completely generic and you can set up any control,bulk,IRQ transfer that you want. But you will need some layer that maps the USB response packets to the packets that an analog or digital joystick would return (as far as I understand it).

Roderick Klein

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 28
  • Posts: 432
  • Karma: +9/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #4 on: October 02, 2021, 04:04:47 pm »
This whole thing has two sides to it.

First of all its the device driver it self that needs to communicate with the USB joystick or gamepad. How that can be done. While writing the device driver should not be that difficult I do not know how well standardized gamepads and USB joysticks are.  Is there a USB class for such devices ?

However if you have an OS/2 driver that is the first step. What I do not know is if Wim Brull his driver or usbresmgr.sys can used for such a project.
USBRESMGR in my understanding seems to effectively a ring 3 to ring 0 device driver that enables you to use a DLL to control equipment from OS/2 with a DLL. A good example of this is TAME.

You then automatically come with the second portion. You will need a VDD for DOS sessions. This VDD would emulate a legacy Joystick. I think the hex address is 301 or for a Joystick port ? The VDD would need to capture port 301 and send the data from and to the USB OS/2 driver.

Since joysticks are so timing senstive a command given on a USB stick should arrive up at the game ASAP!
So you need a driver that the DOS VDM driver can directly talk at ring 0. I do not know if thsi can be done at ring0 with USBRESMGR.SYS or Wim Brul his driver.

Joystockv.sys (VDM driver)-> USB PDD->USB stack->Joystick

Roderick Klein

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 617
  • -Receive: 123
  • Posts: 3315
  • Karma: +28/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #5 on: October 02, 2021, 05:24:47 pm »
Thanks.

I guess the idea will be something like this graphic, to have some gamepad/joystick support for ArcaOS with an USB gamepad.
The red squares are the things that do not exist.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 226
  • Posts: 3154
  • Karma: +59/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #6 on: October 02, 2021, 05:42:07 pm »
First of all its the device driver it self that needs to communicate with the USB joystick or gamepad. How that can be done. While writing the device driver should not be that difficult I do not know how well standardized gamepads and USB joysticks are.  Is there a USB class for such devices ?

Joysticks are standardized USB Human Interface Devices (HID) https://en.wikipedia.org/wiki/USB_human_interface_device_class#Game_controllers so pretty standardized with one driver supporting most USB joysticks.