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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #315 on: October 27, 2022, 02:18:04 pm »
Hmm, if I build Rock'n'Diamonds with -Dno_joystick, it works fine. If I build without the define, it doesn't see my joypad, acts weird after trying to configure the joypad, like the up arrow key is pressed, and crashes when exiting. The resulting trp file is uninformative.
I'm also not quite sure how the packaging is supposed to work so I think I manually packaged it.
Here is the full game built with -Dno_joystick along with rocksndiamonds.exe built with joystick support for you to test. Just swap the binary.
Also sdl2_mixer doesn't have mod support so some warnings from that and no music. Needs sdl2_net as well. Only lightly tested
Edit:Fixed attachments

Thanks Dave. I will check it out.

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 #316 on: October 27, 2022, 08:12:20 pm »
Heh Dave!

Hmm, if I build Rock'n'Diamonds with -Dno_joystick, it works fine. If I build without the define, it doesn't see my joypad, acts weird after trying to configure the joypad, like the up arrow key is pressed, and crashes when exiting. The resulting trp file is uninformative.
I'm also not quite sure how the packaging is supposed to work so I think I manually packaged it.
Here is the full game built with -Dno_joystick along with rocksndiamonds.exe built with joystick support for you to test. Just swap the binary.
Also sdl2_mixer doesn't have mod support so some warnings from that and no music. Needs sdl2_net as well. Only lightly tested
Edit:Fixed attachments

Found out in a rapid test today that Anne has contracted CoVid and is exhibiting flu symptoms, so had to make her comfortable - but as shes isolating it gave me time to test your builds.

The build marked RocksNDiamonds I assumed is the one without Joystick support - I downloaded the latest SDL/2 files you indicated and was able to get Rocks N Diamonds opening screen - using that version with xevents open, trying to enable any joystick support, was blanked out (blue).

I did get three mods reported as wrong audio format. Also, upon closing the desktop locked and I was only able to recover by using a hardware reset to reboot.

Switching to your -joypad based .exe file, the Rocks N Diamonds screen would only partially open (stopped in the middle of loading). I was able to kill it by invoking CAD-Popup, and doing a hard kill, which generated an exceptq.txt report based on a trap - I've attached the txt file and the window which shows both the audio mod information and the actual trap info.

I tried that both with xevents running and without, in the case of the -joypad build.

Perhaps I'm missing some DLL required by the Joystick build.

So out of luck at the moment, Dave and Best!

M

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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #317 on: October 27, 2022, 09:04:45 pm »
Same trp as I get. The mod file warning is due to sdl2_mixer missing mod support. A bit surprised the no joystick version didn't run for you, works here for a while then it crashes in sdl2_mixer and mmos2.
Hmm, building with -Zhigh-mem seems to fix that, here's a new binary, no joystick support.

Tom

  • Full Member
  • ***
  • Posts: 194
  • Karma: +5/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #318 on: October 27, 2022, 11:19:51 pm »
Perhaps I'm missing some DLL required by the Joystick build.

You can use PMDLL to check for missing DLL-dependencies: see https://hobbes.nmsu.edu/download/pub/os2/util/system/PMDLL_2-12.zip .

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #319 on: October 27, 2022, 11:25:05 pm »
Same trp as I get. The mod file warning is due to sdl2_mixer missing mod support. A bit surprised the no joystick version didn't run for you, works here for a while then it crashes in sdl2_mixer and mmos2.
Hmm, building with -Zhigh-mem seems to fix that, here's a new binary, no joystick support.

This version seems to work, Dave.

Opens normally - plays sounds at the beginning, but as I have never played RnD don't know where other audio is present.

Did level 1 w/keyboard, no problems, but also limited testing.

Tried w/Joystick and not recognized, either with xevents enabled or not - if you do a build with joystick support and high mem, will test.

Still had hard lock-up on exit but also did not as well - YMMV beta testing at the moment and Best!

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #320 on: October 28, 2022, 09:06:59 pm »
Hi Dave

I tried
- rocksndiamonds.zip
- rocksndiamonds_joypad.zip
- rocksndiamonds_high_mem.zip

All run without issues on my TP L420.

When testing "rocksndiamonds_joypad.zip" with the "PCS SNES Gamepad", the gamepad works, I can move the character, but I have something like if the "up arrow" get pressed. The xevents.cmd does not register anything. It feels like the normal state of gamepad (without any buttons pressed) is like it has the up button pressed. Anybody experienced something similar?

Anyway, it is awesome to see a gamepad working on a SDL game.

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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #321 on: October 29, 2022, 12:18:00 am »
Hi Martin, interesting that it works for you, doesn't with my Logitech "Dual Action". No crash on exit? Did you try calibrating the Joypad, under Setup-->Device where I assume you chose the Joypad. Or did the Joypad just work?
I get the "up arrow" pressed thing here as well.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #322 on: October 29, 2022, 02:29:41 am »
Heh Dave!

Hi Martin, interesting that it works for you, doesn't with my Logitech "Dual Action". No crash on exit? Did you try calibrating the Joypad, under Setup-->Device where I assume you chose the Joypad. Or did the Joypad just work?
I get the "up arrow" pressed thing here as well.

Checked this evening and it seems I was missing SDL2_gfx - still get the problem with opening RocksNDiamonds_gamepad original, but no hard locks with RocksNDiamonds-Himem now - if you want to do a build with both Joystick and HiMem, I'm hoping will have Joystick support and Best!

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #323 on: October 29, 2022, 04:10:56 pm »
Hi Martin, interesting that it works for you, doesn't with my Logitech "Dual Action". No crash on exit? Did you try calibrating the Joypad, under Setup-->Device where I assume you chose the Joypad. Or did the Joypad just work?
I get the "up arrow" pressed thing here as well.
Hi Dave

It worked without any configuration (of course xevents.cmd is running on the background). I didn't try to calibrate the joypad, it just worked at once (rocksndiamonds_joypad.zip ), I will check out  the calibration stuff later.

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: DOS VDM - USB and Game port Gamepad support
« Reply #324 on: October 29, 2022, 05:43:18 pm »
Hi Martin, interesting that it works for you, doesn't with my Logitech "Dual Action". No crash on exit? Did you try calibrating the Joypad, under Setup-->Device where I assume you chose the Joypad. Or did the Joypad just work?
I get the "up arrow" pressed thing here as well.

Hi

On RocksnDiamons (joy version) when I try to configure the gamepad, I go fine with button A and B. But I'm not sure about the directions keys, it tries to map the keys against a graphic of an XBox controller.

I tried to match the D-pad with the analog controller but all combinations produce me the same issue, it is like the "up" button is being kept pressed.

Dave, which USB gamepad/josytick do you have?

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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #325 on: October 29, 2022, 07:00:08 pm »
Says it is a Logitech dual Action,
Code: [Select]
Device 046D:C216  LS Logitech, Inc. F310 Gamepad [DirectInput Mode]

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #326 on: October 29, 2022, 07:07:41 pm »
Hi Mark, here's the binary with highmem and joystick support.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #327 on: November 02, 2022, 10:05:39 pm »
Hi Mark, here's the binary with highmem and joystick support.

Hi Dave!

Day 7 of CoVid for Anne (still testing positive) so haven't had much time to do anything. On top of it, went from 18 C last Wednesday to a blizzard today: -4 C, -14 wind chill, 50 km/hr winds and 15 cm of wet snow so far today.

As I'm  stuck inside, I had a chance to do some testing.

Did download your latest Highmem / Joystick enabled concoction of Rocks and Diamonds.

Enabling xevents for my older joystick I was able to have it recognized by the game, including setup as "Joystick1" - xevents needs to be enabled first, otherwise the game still locks up on opening.

You can see the game is designed for gamepads, as I also get, during the configuration setup, a picture of a gamepad and flashing buttons - I was able to have the game recognize all four buttons, but there is no response when I move the joystick around - no response also trying to map the Hat to some function as well.

Getting out of configuration I noted that, in the menus, the cursor wanted to move up the highlight to the very top of each of the menus, all by itself - using the mouse to highlight lower menu items does work, but after clicking a menu function, the cursor moves to the top of the menu displayed yet again and pegs there.

I don't know if this was what you and Martin were describing about the up arrow - its like the up arrow is stuck for some reason, sending signals constantly. This does not occur if the input device is set back to keyboard.

Starting the first game, I was able to use the joystick to move the little guy around up and down and sideways on the screen to take down walls and capture gems. However the "up arrow stick" I guess you can call it, was still there within the game, as the game is constantly wanting to move the guy up to the top of the screen. After a few minutes of playing I again was getting the "loss of focus" within the game I mentioned in previous posts to Wim - suddenly the joysticks movement functions would quit, and I'd have to close the game.

I will say that I can close the game gracefully with both HiMem and Joystick enabled (ie. not hard locks) - losing focus at worst requires me to use CAD Popup to terminate with a kill signal. However in most cases I can terminate gracefully simply using the ESC key and the Quit procedure in the game.

I can also say that I was able to use the GamePad version of Rocks and Diamonds to play but again had the loss of focus problem - exiting was a little ugly there, as I could only exit using kill in CAD popup.

So, Martin, if your following, and want to take this to Orlando on the weekend:

1) SDL also works with joysticks in ArcaOS, as proof of concept, as illustrated by Rocks and Diamonds, when Wims xevents.cmd and his drivers are used - unfortunately unless someone is using the same joysticks as I am, they may not be able to use the two custom xevents.cmd files I am using to reproduce this.

2) The implementation is not perfect, but thanks to your porting Rocks and Diamonds, Dave, we now know it is possible, in addition to playing OS/2, DOS and DOSBox related games to address SDL games, using Wims drivers

If anyone else has tried using the xevents files I posted, with success, setting up Wims drivers as per the guide I published, I would like to hear about it - also if some bright REXX savvy programmer has modified one of those REXX files to address their Joystick successfully, I would like to hear about that too - looking at the xevents files I have, there is a lot of commonality in what Wim rather brilliantly put together, between the two files, but as always the devil is in the details - perhaps with a little head scratching, pooling our resources and skills, we can get other joysticks to work as well.

Of course, this also applies to the GamePads - I don't know how much commonality exists with those - using Martins xevents.cmd, it may be easier to either use, or modify accordingly.

Anyway Christmas has come early, quickly and unexpectedly to Alberta (either that or a freezing hell, as by the end of the week their talking -15 to -16C as highs ......... that's January, not November weather  :'( )

Best of the week, Dave, and to everyone else as well!

M
« Last Edit: November 02, 2022, 10:18:12 pm by Mark Szkolnicki »
Vincit Que Se Vincit - "He Who Conquers Self Succeeds"

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #328 on: November 02, 2022, 11:15:32 pm »
Hi Mark, seems to be a lot of Covid going around, hope your wife doesn't get lied out for weeks.
Cold here too, with another atmospheric river coming, which will hopefully replenish the reservoirs.
The up movement seems to be common to all of us, not sure if it is a Rocks'n'Diamonds bug or SDL2.
I also expected that SDL2 would not need the xevents.cmd thing, guess I was expecting too much. I do know that way back Rocks'n'Diamonds worked fine with a regular native joypad, no SDL, it used X.
I found this gamecontollerdb.txt in the source, wonder if it would help figure out xevents. Perhaps see if your joystick is in it and any correspondence to your xevents

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #329 on: November 03, 2022, 01:45:47 am »
Heh Dave!

Hi Mark, seems to be a lot of Covid going around, hope your wife doesn't get lied out for weeks.
Cold here too, with another atmospheric river coming, which will hopefully replenish the reservoirs.
The up movement seems to be common to all of us, not sure if it is a Rocks'n'Diamonds bug or SDL2.
I also expected that SDL2 would not need the xevents.cmd thing, guess I was expecting too much. I do know that way back Rocks'n'Diamonds worked fine with a regular native joypad, no SDL, it used X.
I found this gamecontollerdb.txt in the source, wonder if it would help figure out xevents. Perhaps see if your joystick is in it and any correspondence to your xevents

My wife is bustling about - made 6 Christmas Fruit Cakes yesterday and a Salmon Souffle today, but flags out quickly at the moment - she has an important doctors consultation tomorrow but was lucky enough to phone today and change it to a telephone consultation instead of in person, as she's been waiting for months for this - has a lot of damage in her left shoulder, cause unknown, but it affects the rotator cup most especially.

Instant snow is not how it normally occurs here, especially with 15 cm so far - I suspect we're in for a long cold winter - I'm originally from Winnipeg (for the uninitiated also know as "Winterpeg") so we're used to Siberia, but with the price of heating was hoping it would be warmer - I cross country ski, so that may occur early this year.

As to SDL, it may be the culprit or not - I seem to recall one of the joysticks having a drift problem at one point (I think the newer) in DosBox but Wim and I couldn't quite pin down why - this change is so marked with all of us in this case, from keyboard to game controller and reproducible, that it may be related to our implementation of SDL or SDL/2 or related to interactions with this OS itself - as I said xevents, being a REXX CMD file is really designed to feed data to Wims multipurpose Extended Control driver based on the way the specific piece of equipment operates and sends out signals, as I understand it. But that may be a simplistic explanation.

I have downloaded the Windows version of Rocks N Diamonds, and want to do a little more testing there with both joysticks on one of my Windows games partitions to see how things are supposed to function - I think I'll also do some fishing, and troll around to see if a bug of this nature has ever been encountered before with Rocks N Diamonds - its amazing how many times in the last few months, I've seen that the same problems have been encountered before in other OS's - the question really is - can we do anything about it here.

Best!

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