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

Wim Brul

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +23/-0
    • View Profile
    • Wim's home page
Re: DOS VDM - USB and Game port Gamepad support
« Reply #225 on: May 10, 2022, 12:44:24 am »
Hi Mark, you wrote earlier:
Quote
I'm also curious as to whether you ever attempted to run Wolfenstein 3D under DOSBOX?
No Mark, I did not until today, when I felt the time was right to install DOSBox, and see for myself what's (not) going on...

And Jochen Schäfer wrote:
Quote
SDL 1, which is used by DOSBOX, has native joystick support, so in theory Wim's USB drivers should be available in SDL 1.   
Jochen is right. It ought to work. So I did some tracing and looked into SDL_os2joystick.c to discover the culprit:

GAMEDD.SYS is missing GAME_PORT_RESET and GAME_PORT_GET functions. Without these no joysticks are detected.
The good news is that once I added those functions it all started to work (at least on my laptop that is). Will append later.

Regards, Wim.

Edit: And here it is. Only GAMEDD.SYM/GAMEDD.SYS and TRC00E8.TFF have been changed.
« Last Edit: May 10, 2022, 09:27:36 am by Wim Brul »

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #226 on: May 10, 2022, 04:09:07 am »
Hi Wim!


SDL 1, which is used by DOSBOX, has native joystick support, so in theory Wim's USB drivers should be available in SDL 1.   



Jochen is right. It ought to work. So I did some tracing and looked into SDL_os2joystick.c to discover the culprit:

GAMEDD.SYS is missing GAME_PORT_RESET and GAME_PORT_GET functions. Without these no joysticks are detected.

The good news is that once I added those functions it all started to work (at least on my laptop that is). Will append later.

Regards, Wim.

That is actually quite exciting, as I've tried a number of DOSBOX programs (5) including Wolfenstein and also TMScope and could get no feedback despite enabling DOSBOX Joystick support.

I have roughly 60 DOS programs installed under DOSBOX, of which 15 or so have joystick / gamepad support, so it would give a much larger range of programs to test.

Jochen has done a lot of good work related to ArcaOS, as the problem installing DOS programs normally under OS2 / eCS / ArcaOS at the moment is getting everything DOS based to work, with a myriad of native DOS VM settings, as well as the SET BLASTER parameter, if you want to try enabling sound - if we can get controller support working under DOSBOX, it is much easier for widespread testing.

As I've said previously, my direct VM DOS Wolfenstein installation is buggy but does work eventually, but the analogous DOSBOX installation works flawlessly immediately (including sound) - its just the game controller functions not working at the moment.

Let me know, Wim, if there is something you'd like me to test and Best!

M
« Last Edit: May 10, 2022, 04:14:10 am by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #227 on: May 10, 2022, 06:34:20 pm »
Hi Wim!

Quote

Jochen is right. It ought to work. So I did some tracing and looked into SDL_os2joystick.c to discover the culprit:

GAMEDD.SYS is missing GAME_PORT_RESET and GAME_PORT_GET functions. Without these no joysticks are detected.

The good news is that once I added those functions it all started to work (at least on my laptop that is). Will append later.

Regards, Wim.

Edit: And here it is. Only GAMEDD.SYM/GAMEDD.SYS and TRC00E8.TFF have been changed.

And ............ WE HAVE A WINNER !!!!!!

Installing the GAMEDD.SYS and GAMEDD.SYM as well as TRC00E8.TTF from you latest gamepad package (gamepad-20220510.zip) I now have game controller function in DOSBOX (at least joystick wise - Martin or others will have to confirm gamepad function)

I have tested both the original Thrustmaster Joystick on the Logilink box, Mode 2, and the new Thrustmaster T.Flight, using the original xevents.cmd (for the former) and xeventsf1c.cmd (for the latter), and both are recognized by the DOSBOX installed TMScope - not perfectly, but at least functional, so good on you, Wim - excellent work!

When I say not perfect, I found the following:

1) Again hat function is not present, running TMScope under DOSBOX, for either joystick, so I assume something is still missing there

2) I noted on the X-1 and Y-1 axis control display, pushing either joystick to the east and south, the travel indicted on TMScope is a lot less (about half) the travel noted on the display pushing the joysticks north and west (the cursor went to the maximum travel on those sides of the the display). I will explain why that may be important below

3) Perhaps I have not tested enough so far, but under DOSBOX after 5-10 minutes I did not see the Loss of Focus problem I reported earlier, so the environment under which you are playing a DOS game (ie. direct DOS VM under ArcaOS / eCS / OS2 or under DOSBOX) may be important to that issue.

Running Wolfenstein 3D, using either joystick, I was able first to calibrate the joystick (very easily in fact) and, enabling the Gravis GamePad button, as you discovered, was able to customize buttons B0-B3).

The one item I noted there from preliminary testing was the following:

4) Attempting to turn either east, or backing up south using the joystick did not work - I could move forward (north on the joysticks) and towards the west easily. So the X1 - Y1 axis problem I noted in 2) above may have some bearing on that.

Trying Comanche 2:

I was able to calibrate both Joysticks, but when I went to run the game, sight directional control, normally provided by the hat, caused the display to sight towards the left (west) to start. Moving the joystick variously either moved me in different flight directions, or changed sight directions (north, south, etc.) randomly, so there may be some confusion occurring between joystick input, perhaps between the hat inputs and the X1-Y1 axis inputs in some way (xevents does report outputs going out from both joysticks).

Its good that I can test various programs, as that issue would not be seen under Wolfenstein, due to its simple control arrangement (essentially just 4 buttons and the X-1 / Y-1 control movemennts).

With the ability to use DOSBOX as well, I plan to do testing on a wider variety of games in future, as well as exploring the mapping of the extra buttons on the newer Thrustmaster joystick. I also plan to do more testing to confirm whether the Loss of Focus problem is strictly a native DOS VM problem or whether it can be reproduced under DOSBOX. Please advise if there are any other tests you would like carried out, Wim - perhaps xevents logs may be able to define whats going on although I would have to carefully log the timing of the games while I proceed.

But in summary, Sir (and for others others looking in) I can confirm DOSBOX control of game controllers, at least with the joysticks tested, is now possible as well as under a DOS VM, so hats off to you again Wim - excellent work - only wish I could at least buy you a glass or pint of your favourite libation for your efforts and Best!

M


« Last Edit: May 10, 2022, 08:53:32 pm by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #228 on: May 11, 2022, 07:53:09 pm »
Hi Wim!

Quote

GAMEDD.SYS is missing GAME_PORT_RESET and GAME_PORT_GET functions. Without these no joysticks are detected.
The good news is that once I added those functions it all started to work (at least on my laptop that is). Will append later.

Regards, Wim.


Had a chance to do some more testing today under DOSBOX.

I now am testing 4 separate programs, including 3 games - Wolfenstein, Star Wars: Dark Forces and Comanche 2.

I will make one correction to what I reported yesterday related to item 4)

Quote

4) Attempting to turn either east, or backing up south using the joystick did not work - I could move forward (north on the joysticks) and towards the west easily. So the X1 - Y1 axis problem I noted in 2) above may have some bearing on that.


Having more games to test also allows me to test what has happen previously under different conditions and circumstances.

I was able to move both east and south under Dark Forces, after calibration there, so I went back to Wolfenstein and recalibrated, and both east and south movement is now possible with both joysticks, in both Wolfenstein and Dark Forces, so what I said previously may be a moot point.

The T.Flight joystick is noticeably faster than the older one, sometimes making certain movements a little fast, but I know the T.Flight has a manual adjustment dial under the bottom, which can increase tension, so I will try that first, and see if movement can be slowed down that way. The Mk.2 Thrustmaster (my original one) is operating just perfectly in Dark Forces, at a reasonable speed, so I don't think at least under DOSBOX much adjustment of input speed is really needed.

In my first tests with Dark Forces, it maps only 2 buttons in addition to joystick movement, and, unlike some of the other games, does not allow a choice of joystick type. I also noted that I did not adjust the "auto" switch to "fcs" in the DOSBOX conf file to start, and the DOSBOX start-up screen seems to indicate that it automatically thinks 2 joysticks are present, so I will attempt to adjust that and see what happens.

I also played Dark Forces for over 45 minutes without any indication of Loss of Focus and played around with TMScope for over 30 minutes with no freezing requiring input from the keyboard to unlock the joystick, so indeed it might be different between environments. The joystick(s) are both playing nicely with both the keyboard and mouse under DOSBOX.

I'm not going to go infinite related to adding more games to play, but I'm currently planning to add two more games to the mix:

Mechwarrior 2 - the Mechwarrior series has a very complex set of controls, and does have customizable settings for Joysticks and recognizes and supports the Thrustmaster Mk. 2 specifically, so I may be able to map at least 4 buttons and the hat to useful gameplay functions.

Wing Commander - a Wolfenstein era game of space flight and battle to allow me to compare joystick flight control between games. I am still looking to see whether I have a game that is flight control customizable for air or spacecraft use.

This has been a very interesting experience, Wim, in beta testing, and you make an excellent teammate in same. I think we're making great progress in this and Best!

M



« Last Edit: May 11, 2022, 07:56:35 pm by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Wim Brul

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +23/-0
    • View Profile
    • Wim's home page
Re: DOS VDM - USB and Game port Gamepad support
« Reply #229 on: May 11, 2022, 11:51:47 pm »
Hi Mark,

Quote
I was able to move both east and south under Dark Forces, after calibration there, so I went back to Wolfenstein and recalibrated, and both east and south movement is now possible with both joysticks, in both Wolfenstein and Dark Forces, so what I said previously may be a moot point.
Probably not. My experience was that, although Wolfenstein 3D worked after calibration, I still had to recalibrate always first. That was not necessary when running outside DOSBox. So I tweaked gamedd.sys a little bit to remedy that. See attached. Now I don't need to recalibrate anymore and joycheck.exe and TMScope are working satisfactorily too. In dosbox.conf I need to have joysticktype=auto, timed=true and deadzone=0 for that.

Quote
I also played Dark Forces for over 45 minutes without any indication of Loss of Focus and played around with TMScope for over 30 minutes with no freezing requiring input from the keyboard to unlock the joystick, so indeed it might be different between environments. The joystick(s) are both playing nicely with both the keyboard and mouse under DOSBOX.
Makes sense. I have to use Martin Kiewitz's vCOMPAT.SYS with COMPATIBILITY_DPMI_CLI set ON in order to get several games to run.

Quote
This has been a very interesting experience, Wim, in beta testing, and you make an excellent teammate in same. I think we're making great progress in this and Best!
Yes we do. Thank you for that. It is a pleasure working with you.

Regards, Wim.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #230 on: May 12, 2022, 02:45:10 am »
Hi Wim!

Just installed your new gamepad driver set (gamepad-20220511) and have ran into a problem in DOSBOX in Wolfenstein.

Start-up is fine and runs through the start-up screens (3) as per normal, but then the game immediately shows the messages for ending or continuing the program, where the response Y or N is required. Typing N simply goes to an alternate version of the same shutdown challenge. Typing Y ends the program.

I installed all the files from this gamepad set and rebooted before testing - also got a black screen trap starting up Wolfenstein once each but will have to run it again as I didn't note the message before rebooting. This happens both with xevents.cmd and the Mk. 2 Thrustmaster, and with the T.Flight and xeventsf1c.

TMScope works fine and the joystick travel is vastly improved and balanced to the east and south. Haven't done any other testing at the moment - my evening exercise time awaits .........

Best!

M

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

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #231 on: May 12, 2022, 05:35:27 am »
Hi Wim!

Final message for today here.

After my exercise ride this evening, undertook a complete mission in Star Wars Dark Forces - the developers decided that there would be no save files in between so was busy for about 1.5 hours, completing the mission.

I changed the joystick type to fcs, prior to starting - all it added for either joystick is one button which added a "crouch" function to its mapping, so three buttons enabled as opposed to two.

I used the older Thrustmaster for the mission and it worked perfectly - no Loss of Focus, buttons that did work, worked fine, joystick control was as expected. I had calibrated using the newer stick and experienced no need to recalibrate.

So currently, from my end the two issues using the latest gamepad package are:

1) The rather strange issue related to Wolfenstein trying to exit once the program, has started as per my previous message, and

2) Hat functions on the Thrustmaster joysticks still not being recognized under DOSBOX

Otherwise things seem to be ticking along - you didn't mention why you needed vcompat.sys, otherwise I would test that too (I know I have used it in the past - but can't remember why, under eCS / OS2)

Hope your day is going well - the end of mine this evening and Best!



« Last Edit: May 12, 2022, 05:13:11 pm by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #232 on: May 13, 2022, 04:57:39 pm »
Hi Wim!

I noted one other thing with the new driver package (gamepad-20220511) this morning

Running TMScope under a DOS VM, Hat functions for the T.Flight would only point north or east when changing the hat position when I first brought it up (south or west hat positions would report as east). Hitting the Recal TMS button, I could then get north east or south, but west output would not be shown on the display. This was with xeventsf1c.

Running the last xevents and the older Mk2 Thrustmaster, hat positions were all registering correctly with the new drivers package, so there may be something different between the two packages related to the hat registration.

Its such fine weather here at the moment that I may be out for most of the weekend as there is yard work to be done after our winter, but will try to see if I can setup Mechwarrior 2 using your drivers under DOSBOX, and try running a training mission or 2.

Best of the weekend to you Sir!

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

Wim Brul

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +23/-0
    • View Profile
    • Wim's home page
Re: DOS VDM - USB and Game port Gamepad support
« Reply #233 on: May 17, 2022, 04:02:40 pm »
Hi Mark,

Congratulations with your upcoming birthday. I celebrated mine last Saturday with my family. Clicking my picture reveals my new age.

Quote
Just installed your new gamepad driver set (gamepad-20220511) and have ran into a problem in DOSBOX in Wolfenstein.

Start-up is fine and runs through the start-up screens (3) as per normal, but then the game immediately shows the messages for ending or continuing the program, where the response Y or N is required. Typing N simply goes to an alternate version of the same shutdown challenge. Typing Y ends the program.
When I implemented the missing functions I made a mistake. This resulted into all 4 buttons being signalled as being pressed on startup. Fixed now.

Quote
Hat functions on the Thrustmaster joysticks still not being recognized under DOSBOX
Perhaps I made another mistake. I did some experimenting and failed to change some values back the way these were before. Try the attached version.

Like before you need to copy *.sym and *.sys files to \OS2\MDOS and copy TRC00E8.TFF to \OS2\SYSTEM\TRACE and then reboot your system.

Happy birthday,

Wim.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3636
  • Karma: +34/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #234 on: May 17, 2022, 07:02:30 pm »
Quote
gamepad-20220517.zip

Hi Wim.

I confirm the drivers keep working in my system.
- ArcaOS 5.0.6 with PCSIGP
- Wolfenstein - VDM
- Wolfenstein - DOSBox 2021/01/24
- Makman - OS/2

Regards
« Last Edit: May 17, 2022, 07:06:05 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #235 on: May 17, 2022, 08:10:53 pm »
Hi Mark,

Congratulations with your upcoming birthday. I celebrated mine last Saturday with my family. Clicking my picture reveals my new age.

Happy birthday,

Wim.


Thank-you Sir and many wishes back - it is actually tomorrow (May 18 - which when you read this will most likely be today). My morning today was spent taking our 2 cats for their annual veterinary trip, which as always involved a fair bit of cat-cophany

I always thought EVERYONE got a holiday on their birthday - my birthday has coincided many times with the old queens (Victoria's) birthday celebration which we celebrate as a May long weekend, every year in Canada.

Age is an attitude, Sir - as I mentioned to Paul and Dave in another thread, while we can't do much about health except accept and treat it, as necessary, I find few of the amazingly bright and gifted individuals here who act as if they are a certain age or resigned to be so. You are one of the prime examples of someone who seems unconcerned about the number involved, as long as you can do interesting things like play tennis, keep your programming mind sharp doing interesting projects, and most of all .......... live.

I live with another one of those - my wife Anne is actually twelve years older than me and slightly younger than you - she plays harp, knits, embroiders, gardens and overall enjoys the positives of life - she looks in her 50's and has a similar attitude, despite health issues - I actually look older than her, but keep fit (something that was important at the height of my emergency response days) and have fingers in many pies (it used to be in dams in a crisis - I find pies MUCH more tasty).

Most of all I always try to stay both interested, and interesting - life would be tremendously dull if there weren't a few buttons to press <sic>.

With that in mind - off to see what is in your latest gamepad package and Best!

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

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #236 on: May 17, 2022, 08:17:13 pm »
Heh Martin!

How are things going related to your Dad?

And how is your family doing?

Also where can I find Makman OS/2?

Best!

M
« Last Edit: May 17, 2022, 08:19:37 pm by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Sigurd Fastenrath

  • Hero Member
  • *****
  • Posts: 500
  • Karma: +21/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #237 on: May 17, 2022, 09:55:02 pm »
Hi Mark,

Congratulations with your upcoming birthday. I celebrated mine last Saturday with my family. Clicking my picture reveals my new age.

Quote
Just installed your new gamepad driver set (gamepad-20220511) and have ran into a problem in DOSBOX in Wolfenstein.

Start-up is fine and runs through the start-up screens (3) as per normal, but then the game immediately shows the messages for ending or continuing the program, where the response Y or N is required. Typing N simply goes to an alternate version of the same shutdown challenge. Typing Y ends the program.
When I implemented the missing functions I made a mistake. This resulted into all 4 buttons being signalled as being pressed on startup. Fixed now.

Quote
Hat functions on the Thrustmaster joysticks still not being recognized under DOSBOX
Perhaps I made another mistake. I did some experimenting and failed to change some values back the way these were before. Try the attached version.

Like before you need to copy *.sym and *.sys files to \OS2\MDOS and copy TRC00E8.TFF to \OS2\SYSTEM\TRACE and then reboot your system.

Happy birthday,

Wim.



Happy birthday to All of you as well! Wim I celebrated my 56 birthday last saturday as well... :D  That is really funny! :)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3636
  • Karma: +34/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #238 on: May 17, 2022, 11:52:37 pm »
How are things going related to your Dad?
Also where can I find Makman OS/2?
Hi

I'm going fine, still some paperwork I need finish.

Makman is very basic and you only use the pad to move the Pacman, and I'm not sure if it is the best sample to use a Joypad with OS/2, it is the one that I found first. But you can get it here.

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

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: +15/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #239 on: May 18, 2022, 03:43:00 am »
Hi Martin

How are things going related to your Dad?
Also where can I find Makman OS/2?
Hi

I'm going fine, still some paperwork I need finish.

Makman is very basic and you only use the pad to move the Pacman, and I'm not sure if it is the best sample to use a Joypad with OS/2, it is the one that I found first. But you can get it here.

Regards

Unfortunately I can't find anything to test thats native OS/2 so thought that would come closest at the moment, Sir - the new joystick has buttons 5-8 at the base, which may provide a similar control experience if not directional control.

Unfortunately, there seems to be little in the way of native OS/2 derived items to test and Best!

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