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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #120 on: January 15, 2022, 05:57:12 pm »
The HID descriptor parser has changed. Don't know where it is implemented. For usbresmg, a typo fix. Other changes probably wouldn't affect things.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #121 on: January 15, 2022, 09:06:23 pm »
USBKBD.SYS and USB MOUSE.SYS contain a HID descriptor parser.
There is nothing like that in USBCALLS.DLL or USBRESMG.SYS, at least not in my version.
If they did add something, I'll be looking forward for them to publish the interface.
I guess they added functionality so that the whole USB bus hierarchy can be queried. It's all drifting apart.

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 #122 on: February 05, 2022, 05:17:40 pm »
Hi

I want to try an SDL ported game with an USB gamepad, but I found it hard to follow all the work on this thread.

Can I try "prboom-plus-2.6um-alpha1.zip" with an USB gamepad? Are all the need/updated libraries on the Netlabs RPM so it can work with an USB gamepad?

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 #123 on: February 05, 2022, 06:54:52 pm »
As far as I know, it hasn't been implemented yet.

Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #124 on: February 05, 2022, 08:06:47 pm »
Good Morning Guys!

Been an interesting year so far - between dealing with weather and politicians (I'm not quite sure which was worse, as neither are predictable) I had a rather busy January.

I have looked in on this thread from time to time in the interim, and I commend Dave, Lars, Jochen, Bitworks and Silvan, and the others who have been trying to press all this forward.

The development types have done a lot of yeomans work - the question now is how can we user types help in alpha and beta testing of whats been done? Thats where we need some input.

As I see it we're at the state where the testers need some detail from the developers on:

1) What needs to be installed to do the testing?
2) How do we do it? (YUM/RPM, downloading certain files, how to install, etc.)
3) What tests do you want run, and what info needs to be generated, and how?
4) What equipment do you want tested (joysticks? gamepads? other USB items like cameras of other USB devices found?)
5) Generally, how do you want the tests run?
6) What do you want us to find out at this stage (and hopefully going forward)

I know some testing has been done with "hidapitester" (don't know where that was pulled from or who created it), but whatever tools we need to test need a little explanation as to how they work and what to do. If you want testing in a games environment, I think we need to know what needs to be set up, possibly in CONFIG.SYS or other places in addition to adding the DLL libraries as well as which OS environment do you wanted it tested in (currently I'm thinking DOS under ArcaOS or OS/2, or native ARCAOS or OS/2).

As mentioned , I'm not a developer, but I can help and am volunteering in compiling 1) to 5) into a post which summarizes how we do this - I have followed this thread, but as Martin has inferred, its difficult to follow, and I don't think I could get all the relevant items together coherently without some guidance by the guys who have been doing the modifications and programming, as to what needs to be put down in writing to make this work.

So if you can post some of the steps here I will attempt to put it all together (or to email me privately - I have no email on OS2World).

Perhaps, Martin, if your listening in, and if I can put together something useful, we can get it up as a development or testing Wiki to give people something to reference on a single page, instead of users trying to find the post (or multiple posts) that has the info throughout the thread

Just wanted to contribute to this in the way I am skilled at - namely methods engineering. I expect if we have sufficient people testing (including me), there will be changes needed as we go along - but at least we have a structured way to move forward.

Thoughts on this anyone? And Best!

Mark
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 #125 on: February 06, 2022, 01:42:45 am »
Hi Mark,
As far as I know, Josh hasn't made any advancements with this. Looking at his Github, he has been getting the test suite to work and hasn't committed anything joystick related.
The hope was that it would just work once hidapi was enabled and building. Currently here hidapi just returns a series of numbers, some of which change when the joystick is operated, those numbers need to be translated into buttons and x/y axis etc. It is also possible hidapi and/or libusb needs more updates.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #126 on: February 06, 2022, 02:20:53 am »
The API can be found here:

https://github.com/libusb/hidapi/blob/master/hidapi/hidapi.h

To me, hidapi looks like a very thin layer on top of libusb. It just allows to send or receive feature reports and to receive input reports. Feature reports seem to be for control or to receive settings.
However, interpreting the contents of an input report requires a HID parser. The HID parser uses the information in the HID report descriptor (burned into the device, can be read from the device just like any other descriptor) to find out what bit means what.
So, the hidapi is available (from BWW github) or from Josh but the "intelligence" is provided by the parser that is not part of hidapi.
Maybe the application that Martin suggested contains the necessary parser to actually make up something of the data that it receives via USB. That would be my hope, at least.

Here is some hopefully simple explanation of what a HID report descriptor is:
https://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #127 on: February 06, 2022, 03:38:05 am »
I was hoping that the files under src\joystick\hidapi such as SDL_hidapijoystick.c would do the parsing. SDL2 also contains it's own hidapi, currently patched for OS/2 by the looks of it.
Guess could try building it. configure --help has,
Code: [Select]
--enable-hidapi         use HIDAPI for low level joystick drivers
                        [[default=yes]]
--enable-hidapi-libusb  use libusb for low level joystick drivers
                        [[default=maybe]]
Have to boot to a system where the latest libusb along with the latest pthreads is installed.
I'll see if it builds and perhaps start another thread.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #128 on: February 06, 2022, 04:25:45 am »
Ah, ok, yes, so SDL does not implement a full blown HID parser but it knows the input packet format for a couple of known devices.Yes, that is what is needed.

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 #129 on: February 06, 2022, 05:44:35 pm »
Hi Mark.
Perhaps, Martin, if your listening in, and if I can put together something useful, we can get it up as a development or testing Wiki to give people something to reference on a single page, instead of users trying to find the post (or multiple posts) that has the info throughout the thread
Just let me know what do you have in mind. We can use the OS2World wiki. Since  you register some years ago, I think you have access to the wiki with the same UserID and password. Feel free to write me a private message on this forum, or write to my gmail (martiniturbide -at- gmail.com).

Regards

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

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +27/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #130 on: February 06, 2022, 06:51:39 pm »
As I stated before, the HIDAPI part of SDL2 only works with game controller at the moment. My PS4 controller works just fine.
I don't know what the road map for USB joysticks is, but I find that having game  controller support is a first step.
But at the moment, I'm more worried about the problem SDL2-os2 has with relative mouse mode, because that's the issue with the PrBoom port.
I'm at that problem, but I have only so much time, with all the other ports and  hobbies going on, so please be patient ;-)


Mark Szkolnicki

  • Sr. Member
  • ****
  • Posts: 433
  • Karma: +18/-0
    • View Profile
Re: DOS VDM - USB and Game port Gamepad support
« Reply #131 on: February 06, 2022, 07:46:32 pm »
Hi Dave!

Hi Mark,
As far as I know, Josh hasn't made any advancements with this. Looking at his Github, he has been getting the test suite to work and hasn't committed anything joystick related.
The hope was that it would just work once hidapi was enabled and building. Currently here hidapi just returns a series of numbers, some of which change when the joystick is operated, those numbers need to be translated into buttons and x/y axis etc. It is also possible hidapi and/or libusb needs more updates.

Actually a series of numbers similar to a calibration program does tell us something to start - namely that the device is being recognized by the OS, which is a good start - if devices are not being recognized, at least we know which ones, and can use that as a baseline, for testing purposes. As updates and modifications advance at least those simple advances are one way to measure success.

The tests I was doing for Wim are an example of that - but as a tester, I need to know what needs to be installed and running to understand how I can generate data that may be used by the developers at various levels to determine how to proceed. And it does help to have a reference for any tools like hidapitester, so that everyone knows what needs to be done with the tool and how to do it.

Very few here as developers have time at the moment to document that, but I happen to at the moment - so if I can first get an idea as to the set-up needed to undertake some alpha testing and what you gentlemen may need, I can help out with this in a small way, hopefully.

Best!

Mark



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 #132 on: February 06, 2022, 08:07:55 pm »
Hi Martin!

Just let me know what do you have in mind. We can use the OS2World wiki. Since  you register some years ago, I think you have access to the wiki with the same UserID and password. Feel free to write me a private message on this forum, or write to my gmail (martiniturbide -at- gmail.com).


Just got the idea for doing something like this after perusing roughly 75 pages of Paul Smedley's thread related to UniAud32.sys. Paul has been doing absolutely yeoman's service in updating that driver, and the testers are all very enthusiastic, and now know everything Paul needs to further update and development - however, coming in very late (read years) in those very exciting developments, I found I'm having to piece together from roughly 800 posts on how to test the driver, what data needed to be generated and forwarded to Paul, and how that needed to be accomplished.

I plan to address that issue on my systems soon in future, but I've found I've been taking a lot of notes working through the posts, so that I would be able to undertake my own hardware tests on two systems using Paul's updated UniAud32 driver.

This USB support issue is a much more complex project in that its not just a driver involved, but libraries and various other items at various levels and layers which may need to be integrated to successfully test not only game controller/pad support, but also as an extension possibly other HID device support. This is the reason I'm suggesting that a Development / Testing Wiki related to this project may be of some use to help coordinate at these efforts coherently. I'm sure we all have notes we've been jotting down on things we've learned on the subjects we each have of interest - I'm just suggesting pooling the various items together into a testing "how-to" may help us all push things forward on this project.

Best!

Mark
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 #133 on: March 06, 2022, 06:51:35 pm »
As far as I know, it hasn't been implemented yet.

Hi Dave!

Hope the year is going well for you. I have an appellation for every year, and I'm starting to dub this one the "Year of Strange"

Had a question for you about your version of hidapitester.

Was going to do some testing this weekend and this week. I've installed the new experimental libraries that were in the ANPM repositiories and was wondering if your build of hidapitester was compiled to use information solely in your directories, or whether it would use the experimental DLL's installed by ANPM.

I was curious as to what devices may be seen by your build of the tester, in addition to any gaming equipment it may find.

Went silent for a month, as February was very busy.

While the Coutts border occupation by protestors was strictly an RCMP operation, we had to open the Provincial Emergency Operations Centre and man it yet again, to coordinate communications between enforcement services and provincial authorities, so busy at that for a couple of weeks, then all the paperwork and follow-up critiques, briefings and reports. Interesting times, Sir 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 #134 on: March 06, 2022, 08:09:45 pm »
Hi Mark, this whole decade is turning out weird, strange and horrible.
That version of hdiapitester should work with the DLLs installed by YUM/RPM, if not you'll find a sys2070 in popuplog and I can always rebuild. You may need the usbcalls.dll from Arca Noae.
Unluckily things seem incomplete and I don;t have the knowledge to fix them so have been patiently hoping someone more knowledgeable gets things working better.