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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #180 on: April 04, 2022, 10:00:42 pm »
Hi

Just checking online. This DOS Joystick Testing utilities works with my VDM DOS session with my USB game pad ("xevents.cmd" running on the background).

Check it out: (DOS_Joystick_Testing_Utilities.zip)

Here it is a quick video I made with my phone: https://youtu.be/tw1VOcdxnHc

Regards
« Last Edit: April 05, 2022, 03:49:40 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #181 on: April 04, 2022, 11:26:31 pm »
Heh Martin!

Hi

I found my issue with MakMan.

- ArcaOS 5.0.4
- USB gamepad PCSIGP  081#:##01:0106
- gamepad-20220317.zip  Installed
- oinput.cmd and xevents.cmd showing feedback while pressing the gamepad buttons

Makman was working, with an older test release, as Jostick B, and stopped working for me with the latest release. But it was because I was missing something important from the instrucctions.
"I have to keep "xevents.cmd" running on the background". When "xevents.cmd" keeps running in the command line the USB gamepad works with Makman as joypad B.

Now, I have some issue with Wolf3D (DOS VDM).
- I keep running "xevent.cmd" the background
- Now when I run Wolf3d and ask me to press a key, I can press the gamepad button and will continue (means the USB Gamepad is being recognized in some way by the DOS game).
When I go to the WolF3D menu and select "Jostick", it asks me to caligrabrate the joystick. Now the buttons works, First it ask me to press "Upper Left + Button 0", and Later "Lower Righ + Button 1", it works ,but when I finish the Joystick "yellow light" does not turn on and I keep on the same configuration loop.

I need to further test other DOS VDM software.

Regards

Out of curiosity what other DOS game related settings are you using to run WOLF3D (other than GAME_DIRECT_ACCESS and GAME_DIGITAL_RESPONSE)?

As I said the VDM I set up has some start-up problems - I haven't had time to play with the other settings to see what I can do to solve it.

As to your button problem for calibration, was GAME_DIGITAL_RESPONSE set to ON or OFF at the time? That may make a difference as to whether the button response was acting correctly during calibration. You might want to try the opposite setting to what it currently is, to see if that makes any difference. Also there is an OPTIONS setting further down that menu, where you can change the button settings - you may wish to see if you can do that, which may also indicate whether your game pad is being seen.

When I did the calibration routine it took a number of presses to get the joystick to be recognized, both shifting it (the joystick) to top left and pressing button 0 (the trigger) and then shifting it to bottom right (and then pressing button 1) - once I was able to complete calibration, I haven't had to do it again.

Best!

M
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #182 on: April 05, 2022, 02:56:44 pm »
Hi Mark
Out of curiosity what other DOS game related settings are you using to run WOLF3D (other than GAME_DIRECT_ACCESS and GAME_DIGITAL_RESPONSE)?
I have:
- GAME_DIRECT_ACCESS - OFF
- GAME_DIGITAL_RESPONSE - ON
I think both are the default.

If I change  GAME_DIGITAL_RESPONSE  to OFF I don't see a difference. But I'm guessing that is some issue with Wolf3D or how do I interpret joystick calibration should work. I got good results with the Joystick testing tool I found and the default DOS VDM settings.

I need some more time to try other games. I will try to find some DOS DOOM and see what happens.

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

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #183 on: April 05, 2022, 06:43:34 pm »
Hi Martin!

I have:
- GAME_DIRECT_ACCESS - OFF
- GAME_DIGITAL_RESPONSE - ON
I think both are the default.

If I change  GAME_DIGITAL_RESPONSE  to OFF I don't see a difference. But I'm guessing that is some issue with Wolf3D or how do I interpret joystick calibration should work. I got good results with the Joystick testing tool I found and the default DOS VDM settings.

I need some more time to try other games. I will try to find some DOS DOOM and see what happens.

Regards

I was curious about something.

In the CONTROLS section of my version of WOLF3D, I have both a JOYSTICK button, which if pressed goes into the calibration sequence you described, for a joystick.

However, two menu items below that it has a button setting entitled "GRAVIS GAME PAD ENABLED".

Do you have that setting, and if so have you tried that with your Game Pad?

M

P.S. BTW I completed a DRAFT of a Game Controller Testing Guide, in PDF, which I have attached below. Its really a first cut at documenting some standardized way to do this testing,  and answering a few questions I have asked, myself, as I've been going through this process - it may be too early to have something like this for use by others, but if you want to have a look and see if you think it would be useful, with any comments, that would be great!

Best!

M Too
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #184 on: April 05, 2022, 10:21:01 pm »
Hi

I found an issue. I was running Quake 1.01 on DOS VMD. (DOS Quake, not OS/2). It recogniced the gamepad (button 1 and button 2 only, I can not make the axis work yet).
If I unplugged suddenly the USB gamepad, I get this OS/2 trap on USBEHCD.
Workarround: Do not unplugg the gamepad  ;D

Let me know if the trap also happens on other systems, and also whatever data is needed to try to debug this.

Regards
« Last Edit: April 05, 2022, 10:30:13 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #185 on: April 05, 2022, 11:39:36 pm »
In the CONTROLS section of my version of WOLF3D, I have both a JOYSTICK button, which if pressed goes into the calibration sequence you described, for a joystick.

However, two menu items below that it has a button setting entitled "GRAVIS GAME PAD ENABLED".

Do you have that setting, and if so have you tried that with your Game Pad?
When I run Wolfenstein, on the first screen I see the joystick in "yellow". I can press a button on the USB gamepad to continue. (picture 001)
But when I go to "Control - Joystick Enable" I do the calibration but the "yellow light" does not show up (picture 002)
If I go to "Customize Control" it jumps from "Mouse" to "Keyboard" and do not let me change anything on "Joystick".

I'm still not sure if it something I'm doing wrong.

P.S. BTW I completed a DRAFT of a Game Controller Testing Guide, in PDF, which I have attached below. Its really a first cut at documenting some standardized way to do this testing,  and answering a few questions I have asked, myself, as I've been going through this process - it may be too early to have something like this for use by others, but if you want to have a look and see if you think it would be useful, with any comments, that would be great!
I had read the document and it is very good. It describes in a very good fashion how to do the USB gamepad testing.
I can also publish it on the OS2World wiki if you want to.  As I next step I want to learn more about tweaking the "xevents.cmd" to map the buttons.

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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #186 on: April 06, 2022, 02:01:22 am »
I found an issue. I was running Quake 1.01 on DOS VMD. (DOS Quake, not OS/2). It recogniced the gamepad (button 1 and button 2 only, I can not make the axis work yet).
If I unplugged suddenly the USB gamepad, I get this OS/2 trap on USBEHCD.
Workarround: Do not unplugg the gamepad  ;D

Let me know if the trap also happens on other systems, and also whatever data is needed to try to debug this.


Looks like something to open an issue up with, assuming you're using the Arca Noae USB stack

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: DOS VDM - USB and Game port Gamepad support
« Reply #187 on: April 06, 2022, 11:27:51 am »
Hi Martin,
Quote
Now when I run Wolf3d and ask me to press a key, I can press the gamepad button and will continue (means the USB Gamepad is being recognized in some way by the DOS game).
When I go to the WolF3D menu and select "Jostick", it asks me to calibrate the joystick. Now the buttons works, First it ask me to press "Upper Left + Button 0", and Later "Lower Righ + Button 1", it works ,but when I finish the Joystick "yellow light" does not turn on and I keep on the same configuration loop.
I tried and reproduced your wolf3d calibration problem. You need to press select button once and then do the calibration. That will work. Apparently you became victim of xevent.cmd builtin joystick axis swap function. In hindsight I think it is better to remove that function altogether. Will do so in the future. You could use TMScope Setup Utility (thank you for finding) to see what your gamepad delivers. See tms0.png for hardware setup, tms1.png for upper-left position, tms2.png for lower-right position.

Regards, Wim.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #188 on: April 06, 2022, 02:51:03 pm »
Hi Martin,
Quote
Now when I run Wolf3d and ask me to press a key, I can press the gamepad button and will continue (means the USB Gamepad is being recognized in some way by the DOS game).
When I go to the WolF3D menu and select "Jostick", it asks me to calibrate the joystick. Now the buttons works, First it ask me to press "Upper Left + Button 0", and Later "Lower Righ + Button 1", it works ,but when I finish the Joystick "yellow light" does not turn on and I keep on the same configuration loop.
I tried and reproduced your wolf3d calibration problem. You need to press select button once and then do the calibration. That will work. Apparently you became victim of xevent.cmd builtin joystick axis swap function. In hindsight I think it is better to remove that function altogether. Will do so in the future. You could use TMScope Setup Utility (thank you for finding) to see what your gamepad delivers. See tms0.png for hardware setup, tms1.png for upper-left position, tms2.png for lower-right position.

Regards, Wim.

It worked. Thanks Wim
I didn't know that the "select" button did that axis change. I should suspect about that by looking on the xevents output log.
Now Wolf3D is working fine with the USB Gamepad.

I think my next steps will be to try the Huskee PSX adapter with the Playstation controller.

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

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: DOS VDM - USB and Game port Gamepad support
« Reply #189 on: April 06, 2022, 05:56:45 pm »
Hi Lars,

How does this all relate to :
https://github.com/OS2World/DRV-USBLib/tree/master/drivers/src/usbjoy
Markus Montkowski created USBJOY.SYS (USB Joystick Client) and GENGAME.SYS (Gamedevice Manager) back in 2001 and it's source ended up in the above repository. This is yet another way to have gamepad/joystick support in our favorite operating system. It obsoletes GAMEVDD.SYS and replaces GAMEDD.SYS such that GAME$ provides enhanced fuctionality to OS/2 applications while maintaining backward compatibility. This is the good news. The bad news is that in its currend state it does not work at all.

Quote
Is the gamepad a USB device ? If yes, should we not modify those USB joystick drivers to interface with GAMEDD.SYS ? That's at least how it was solved for the USB mouse:
we have USBMOUSE.SYS and that interfaces with AMOUSE.SYS / MOUSE.SYS.
Yes, this is about USB gamepad/joystick devices. But I am not so sure what should be done. Perhaps it is better to start with cloning the currently working USBKBD.SYS into a new USBJOY.SYS rather than trying to fix that not working ancient version. And then the question arises: does it has to interface to my new GAMEDD.SYS or to GENGAME.SYS and go all that way? I think there is a lot of work involved. May be too much...

Regards, Wim.         



Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #190 on: April 06, 2022, 06:42:11 pm »
Hi Wim!


I tried and reproduced your wolf3d calibration problem. You need to press select button once and then do the calibration. That will work. Apparently you became victim of xevent.cmd builtin joystick axis swap function. In hindsight I think it is better to remove that function altogether. Will do so in the future. You could use TMScope Setup Utility (thank you for finding) to see what your gamepad delivers. See tms0.png for hardware setup, tms1.png for upper-left position, tms2.png for lower-right position.

Regards, Wim.

I'm glad Martin found TMScope - I actually remember the utility back many years past, as it was designed by Thrustmaster, as a calibration utility specifically for the stick I am using.

As you may have already read in my previous posts from Sunday past, I included my testing results on both Comanche 2 and Castle Wolfenstein 3D from a couple of days ago. I have now got TMScope working in both a VDM and in a DOSBOX session.

Interestingly I am seeing the same behaviors I observed in both programs running TMScope.

In the DOS VDM, after using TMScope to test a few of the controls, the joystick seems to lose focus - I can push a couple of buttons, or move the joystick, or activate the hat a few times and then none of the Joystick inputs function. Using reset TMS I was able to get the controls functioning again, once, but then had to use the mouse pointer to exit the program and reenter.

As to DOSBOX, I have got TMScope functioning and if I have a a look at the SET HARDWARE screen it reports a "Top Gun USB" joystick present, so it is seeing the joystick, but again I am unable to get DOSBOX to recognize any of the joystick inputs.

So I don't know if the focus problem in a DOS VDM is somehow related to xevents or not. I was also curious, Wim - are all the versions of xevents.cmd in each of the folders you provided the same, or is the game pad version different from the one provided for my joystick?

But I think using TMScope for first testing of device inputs is a good standardized way of first seeing if inputs are being recognized under a  DOS VDM.

Best Sir as always!

M

« Last Edit: April 06, 2022, 06:49:28 pm by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #191 on: April 06, 2022, 06:59:06 pm »
Hi Martin!


P.S. BTW I completed a DRAFT of a Game Controller Testing Guide, in PDF, which I have attached below. Its really a first cut at documenting some standardized way to do this testing,  and answering a few questions I have asked, myself, as I've been going through this process - it may be too early to have something like this for use by others, but if you want to have a look and see if you think it would be useful, with any comments, that would be great!
I had read the document and it is very good. It describes in a very good fashion how to do the USB gamepad testing.
I can also publish it on the OS2World wiki if you want to.  As I next step I want to learn more about tweaking the "xevents.cmd" to map the buttons.

Regards

I actually was specifically thinking having a Wiki on this would be a good idea, as well as a place to house test versions of Wim's set of drivers for download.

If you want to upload the current version of my testing guide, by all means - given you have found TMScope v1.12 (which I had forgotten about, as it was developed by Thrustmaster originally for the joystick I have here). Perhaps that can be placed somewhere for download as well.

I think it would be a subject to add to the next version (v1.1) of the testing guide - as it does represent a good standard way to first test any game pad / joystick to see it a DOS VDM accepts the inputs and as a method of calibration prior to running a game.

Best as always, Sir!

M
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: DOS VDM - USB and Game port Gamepad support
« Reply #192 on: April 06, 2022, 09:54:34 pm »
Hi Mark,

Quote
In the DOS VDM, after using TMScope to test a few of the controls, the joystick seems to lose focus - I can push a couple of buttons, or move the joystick, or activate the hat a few times and then none of the Joystick inputs function. Using reset TMS I was able to get the controls functioning again, once, but then had to use the mouse pointer to exit the program and reenter.
I don't understand what you mean by "Using reset TMS". There is no button for that on TMScope display. What did you actually do to get the controls functioning again?

Quote
As to DOSBOX, I have got TMScope functioning and if I have a a look at the SET HARDWARE screen it reports a "Top Gun USB" joystick present, so it is seeing the joystick, but again I am unable to get DOSBOX to recognize any of the joystick inputs.
It is my understanding that the SET HARDWARE screen does not show which joystick is present. It merely shows how it has been setup. I have it currently setup as Std Joystick and 2nd Joystick. Therefore it thinks it has 2 joysticks attached to the game port and displays data accordingly.

Quote
So I don't know if the focus problem in a DOS VDM is somehow related to xevents or not. I was also curious, Wim - are all the versions of xevents.cmd in each of the folders you provided the same, or is the game pad version different from the one provided for my joystick?
Somehow you are not getting a steady stream of joystick events into e.g. TMScope. What you can do: Start xevents.cmd and run TmsScope. When you don't get input data anymore, keep using the joystick for another 30 seconds. Use Ctrl+C to cancel xevents.cmd and note the time that you did that. Append xevents.log for me to inspect. I am curious to see what happened during those 30 seconds. And no, not all versions of xevents.cmd are equal. Yours does not have the swap axis functionality. You were doing that yourself.

Happy motoring, Wim.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #193 on: April 06, 2022, 11:42:26 pm »
Heh Wim


I don't understand what you mean by "Using reset TMS". There is no button for that on TMScope display. What did you actually do to get the controls functioning again?


Apologies, Wim - the button I pressed to get that is the top button on the left and it is called "Recal TMS"

Quote
It is my understanding that the SET HARDWARE screen does not show which joystick is present. It merely shows how it has been setup. I have it currently setup as Std Joystick and 2nd Joystick. Therefore it thinks it has 2 joysticks attached to the game port and displays data accordingly.

OOOOPS, you are correct Sir - Read the help screens first Mark.

As I said it has been a while since I used TMScope.

However I am curious - did you when you entered SET HARDWARE see the first item checked - just asking as I'm trying to determine whether a joystick in DOSBOX is being seen or not.


Quote
So I don't know if the focus problem in a DOS VDM is somehow related to xevents or not. I was also curious, Wim - are all the versions of xevents.cmd in each of the folders you provided the same, or is the game pad version different from the one provided for my joystick?

Somehow you are not getting a steady stream of joystick events into e.g. TMScope. What you can do: Start xevents.cmd and run TmsScope. When you don't get input data anymore, keep using the joystick for another 30 seconds. Use Ctrl+C to cancel xevents.cmd and note the time that you did that. Append xevents.log for me to inspect. I am curious to see what happened during those 30 seconds. And no, not all versions of xevents.cmd are equal. Yours does not have the swap axis functionality. You were doing that yourself.

Happy motoring, Wim.

xevents attached - representing a single session.

By my reckoning, the session lasted about 1 minute and 34 seconds before the joystick lost focus this time and I continued moving the stick and using both buttons and hat for an additional 30 or so seconds before terminating first TMScope and then Ctrl-C to terminate XEVENTS.

Tried the same experiment 5 times - the time before the joystick lost focus varied from 20 seconds to one minute and 36 seconds.
« Last Edit: April 07, 2022, 02:00:04 am by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: DOS VDM - USB and Game port Gamepad support
« Reply #194 on: April 07, 2022, 05:30:26 pm »
Hi Mark,

Quote
However I am curious - did you when you entered SET HARDWARE see the first item checked - just asking as I'm trying to determine whether a joystick in DOSBOX is being seen or not.
No, I did not. When you uncheck all items and then use SAVE CONFIG then that is what you get the next time you strart TMScope. This information cannot be used to determine whether or not a joystick in DOSBOX is being seen.

Quote
xevents attached - representing a single session. By my reckoning, the session lasted about 1 minute and 34 seconds before the joystick lost focus this time and I continued moving the stick and using both buttons and hat for an additional 30 or so seconds before terminating first TMScope and then Ctrl-C to terminate XEVENTS.
Thank you for that. Unfortunately it did not help me to draw any conclusion. I have no clue what is going on. So I have 2 more questions:

1. What does "lost focus" actually mean? I think it means that how hard you try, you do not see any changes on TMScope display occurring. In other words, you first see -RAW DATA- changing, and then after a while you see -RAW DATA- not changing anymore, and that is the so called "lost focus"? Please confirm.

2. When TMScope is in the "lost focus" situation, and you switch away from that session so you can see the xevents command window, do you still see live events occurring in that window when you manipulate your joystick? I am asking because I want to pinpoint where to look next.

Cheers, Wim.