Jump to content
LaunchBox Community Forums

Pre Configured Controls Xinput for Teknoparrot. Pre-rlz (early alpha)


Recommended Posts

It's a project inspired by @Warped Polygon work to make a pre-configured pack for xinput controller (and arcade pads)
It will autoconfigure your game inputs according to your xinput controllers.

It's something that require a massive amount of work, and i'm not quite sure i can pull it.
So i'm testing the water with an early alpha version with very few games to see if people are interested.

 

How to make it work : 
1- Run the exe, it will popup the config.
image.thumb.png.2b4b7d8c67bdc60a6da730fc750343d2.png

2- You can now just run something like TeknoparrotAutoXinput.exe "C:\teknoparrot\UserProfiles\Daytona3.xml" and that's it.
Easy to add in launchbox.

 

Few notes : 

-

image.png.61e3ed5187f85fb5cba4c2309a8f8bd3.png

The app will manage the controller setup, not the game settings ! Be sure the game is able to run and configured as xinput.
This will maybe change in the future where some options will be set, but for now, i only focus on the controller settings.

- The option, to enable Binding to Test, Service1, Service2 needs ViGEm Bus Driver (https://github.com/nefarius/ViGEmBus/releases) because to make it work, i create a virtual 360 controller that i bind to keyboard keys.

- The launcher will not mess with your existing config, your xml file in UserProfile will never be altered, it's a new one that's created.

- To differentiate between gamepad and arcade stick, i use the Arcade xinput subtype, but some arcade stick just mimic a 360 controller, so i will not be able to determine that's an arcade stick. I will make a command line argument later.

- Source are here : https://github.com/nixxou/TeknoparrotAutoXinput
Supported game list can be listed here : https://github.com/nixxou/TeknoparrotAutoXinput/tree/main/img

 

TeknoparrotAutoXinput_alpha_v0.09.zip

 

Edited by Nixx
  • Like 5
  • Game On 5
Link to comment
Share on other sites

Work in progress in the configuration page.
Not tested enough to upload a release, i will do that back from xmas.

image.thumb.png.92477ff0e421f9645b09b7ce47729a49.png

You can now edit how the app detect if an Xinput device detect if the controller is a gamepad, an arcade stick or a wheel.
Like if the arcade stick falsy register as a gamepad, but have (for example), ProductID different from your controller, you can use that to match your ArcadeStick.

Add the ability to configure different deadzone for Wheel and Gamepad.

Add few extra command line : 
--passthrough : will ignore everything and launch TP with it's original config
--forceslot<xinputsplot>=type (exemple : --forceslot0=arcade ) : will force the xinput slot to be recognise as the type (can be arcade, wheel or gamepad). Slot number start with 0, not 1.

I want also to add the possibility to bind a DINPUT wheel as wheel, but i have some work to do to make that happen.

Link to comment
Share on other sites

Started working on the interface option to bind a DINPUT Wheel instead of an XINPUT Wheel.
Still have work to do, for now, i have the form and i'm able to register buttons pressed, but i have now to register them and use them in the main program. Not here for xmas, so not before few days.

image.thumb.png.cb5e02773d95a574f5880d3cd32f691c.png

 

Link to comment
Share on other sites

Posted (edited)

Big game update, now 187 games supported.
Except Lightgun games and few games that wont run on my PC, i think i'm done.

Now i have to figure out what to do next, i have few ideas of things to do before starting doing the light gun games.

One of the thing i have in mind is doing some per-games options with the ability to run ahk code before/after, switch resolution, and auto add/remove files in the TeknoParrot/OpenParrotWin32/OpenParrotx64/ElfLdr2 to have 'per games' extra dll files (like ffb plugin, reshade, some wrapper or stuff like that)

I'm using Siden gun and i need to apply border, so having some per game stuff to do that is kinda mandatory for me.

TeknoparrotAutoXinput_alpha_v0.06.zip

Edited by Nixx
  • Like 1
Link to comment
Share on other sites

5 minutes ago, drady said:

could this adapted for other ffb games / emulators e.g. flycast etc.?

 

You mean, modify the ffb ini file to put the device id inside ?
Don't know, for now i'm just using it with teknoparrot, only got my wheel recently.

But if it's the same ffb plugin, yeah, should be doable. I don't have the time right now, but i will get a look.

Link to comment
Share on other sites

@Nixx  You are very good, congratulations nice work.

I have several xinput controllers, considering that windows often keeps the controller position in memory even if you disconnect it, I often have to disconnect all of them in order to get back to the correct player 1.

It would be nice to have a test of the controllers directly in launchbox, that way a person can start teknoparrot safely by choosing the correct controller.
There has already been one person who has started to do this, unfortunately it is not yet completed, have a look here if you think it might be an idea to create an un plugin for launchbox

https://forums.launchbox-app.com/topic/68276-ctrlr-cyclr-select-any-controller-you-want-from-launchbox/

Windows always assigns an id number to the connected xinput controller, often even if you disconnect the first controller, it doesn't turn the second controller into id number 1, sometimes it does, sometimes it doesn't, so you are forced to disconnect them all and reconnect them, and then start the game. If Launchbox with a plugin would detect the controller ide, that would be great, so that a person could see which player is connected. For example, if I disconnect player 1 and end up with only one xbox360 joypad connected, and windows doesn't assign the correct id1 but keeps the id2, launchbox should also see only one joypad connected but marked as player2, and at this point one can know in advance what to do before starting the game.

 

.................

Now we come to my real problem, if I click on 'Show Xinput Devices Data' it gives me this error :

image.thumb.png.421cd271479e229b7bba5de705beaf9d.png

Right now I had two controllers, 1)arcadestick 2) joypad ,,, both are seen as xinput by windows

image.png.3ac2e8ae6bb0c52c97d081f68ce0f865.png

 

Edited by Sbaby
Link to comment
Share on other sites

Posted (edited)

Hi. Thanks for submitting your issue.

For the first point, in my app i do not simply take Xinput1 = player1, i use a priority order.
If the game have wheel layout, i take wheel as priority, regardless of their xinput number.
Then, i take arcade stick as priority (if there is an arcade layout available for the game)
And only then gamepad.
And for each of them, i take the first available xinput slot.
So, if you have two gamepad, one in xinput 1, and one in xinput 2, if you disconnect the gamepad 1, it will use the xinput2 as player 1. If you plug your wheel as xinput 3 and the game have wheel support, it will just use your wheel regardless of the xinput number.
I could probably make an option to have some timer on boot to reassign player number (like 5 seconds on start when you press start on the controller you want as P1) but that's not my priority right now.

 

For the second point, that's really annoying.
XinputEx.dll is a dll i make from some C++ code to get some extra info about xinput devices, the ProductID and VendorID. It's an undocumented feature of xinput, and i was not skilled enough to implement this directly in C# (if someone read this, and have the skill to do it, i would love to have a POC)
It's based on this, i basically just turn it from a console executable to a dll : https://stackoverflow.com/questions/64251320/is-it-possible-to-get-an-xinput-devices-name-product-id-vendor-id-or-some-oth
The point of having vendor and product id is to be able to auto detect some controller as arcade stick when they falsely report themself as arcade but still send their own product id / vendor Id.
One user told me that his antivirus didn't like my dll and removed it, maybe that's what happen ? Do you still have the dll in your folder ?
Is there other people having (or not having) this issue ?

Edit :

@Sbaby

I worked on the issue to integrate the code i did previously in C++ directly inside my C# code, can you try this build, if that works fine, i will push the modification
TeknoparrotAutoXinput_alpha_v0.06b.zip

Edited by Nixx
Link to comment
Share on other sites

2 hours ago, Nixx said:

For the first point, in my app i do not simply take Xinput1 = player1, i use a priority order.
If the game have wheel layout, i take wheel as priority, regardless of their xinput number.
Then, i take arcade stick as priority (if there is an arcade layout available for the game)
And only then gamepad.
And for each of them, i take the first available xinput slot.
So, if you have two gamepad, one in xinput 1, and one in xinput 2, if you disconnect the gamepad 1, it will use the xinput2 as player 1. If you plug your wheel as xinput 3 and the game have wheel support, it will just use your wheel regardless of the xinput number.
I could probably make an option to have some timer on boot to reassign player number (like 5 seconds on start when you press start on the controller you want as P1) but that's not my priority right now.

Your work on teknoparrot is fantastic that's exactly why i was asking if you would be able, in the future, when you feel like it, to think of a launchbox plugin that could put a display with the controllers connected, the user link i showed you does this job, unfortunately though it doesn't distinguish xinputs and sees them all the same, so if i have a lightgun xinput and a joypad xinput it creates confusion.

This is an example from Batocera, you can see in the top left corner the icons of the two controllers, one is the joypad and the other is the lightgun :

image.png.d0eaf767b2cf61795606aa581fa2453e.png

Similarly, I have noticed that there are applications that correctly detect the controllers despite the fact that they are both xinput, I give you this example, one is arcadestick qanba in xinput mode, while the other is joypad360 :

image.thumb.png.8d50c561f058cd49d54c7c10ae8b8266.png

Windows instead detects both as xbox360 :

image.png.3ac2e8ae6bb0c52c97d081f68ce0f865.png

 

-----------------

 

2 hours ago, Nixx said:

For the second point, that's really annoying.
XinputEx.dll is a dll i make from some C++ code to get some extra info about xinput devices, the ProductID and VendorID. It's an undocumented feature of xinput, and i was not skilled enough to implement this directly in C# (if someone read this, and have the skill to do it, i would love to have a POC)
It's based on this, i basically just turn it from a console executable to a dll : https://stackoverflow.com/questions/64251320/is-it-possible-to-get-an-xinput-devices-name-product-id-vendor-id-or-some-oth
The point of having vendor and product id is to be able to auto detect some controller as arcade stick when they falsely report themself as arcade but still send their own product id / vendor Id.
One user told me that his antivirus didn't like my dll and removed it, maybe that's what happen ? Do you still have the dll in your folder ?
Is there other people having (or not having) this issue ?

Dll file is intact, I have tried disabling the antivirus but the problem persists.

 

-----------------

 

2 hours ago, Nixx said:

I worked on the issue to integrate the code i did previously in C++ directly inside my C# code, can you try this build, if that works fine, i will push the modification
TeknoparrotAutoXinput_alpha_v0.06b.zip

This version works 😜 i really appreciate this 👍

image.thumb.png.cb3edf5b483dd7aba7c399f2dd155d11.png

 

one is qanba arcade stick in xinput mode, while the second is Ps4 joypad in Ds4windows mode

Edited by Sbaby
Link to comment
Share on other sites

Posted (edited)

 

@Sbaby I'm curious, can you give me the output when you click on the "Show Xinput Device Data" button ?
I only have one arcade stick (a Madzcat Fightstick pro) and i lack info about how other brand report their xinput data.
(And btw, if someone have a 8bit do arcade stick, i would love to see the result too)

Edited by Nixx
Link to comment
Share on other sites

1 minute ago, Nixx said:

 

@Sbaby I'm curious, can you give me the output when you click on the "Show Xinput Device Data" button ?
I only have one arcade stick (a Madzcat Fightstick pro) and i lack info about how other brand report their xinput data.
(And btw, if someone have a 8bit do arcade stick, i would love to see the result too)

I was editing the message with new information, you can see it now, is it sufficient?

Link to comment
Share on other sites

Ah, that's annoying, your Madcatz Fightstick pro mimic exactly an xbox 360 controller, so i can't tell it apart with the xinput library.
In your case, i may have a way, to disting it from the DS4 controller (in fact the other way around, to distinct the DS4 controller from regular 360 gamepad), but i need to do some test.

Link to comment
Share on other sites

10 minutes ago, Nixx said:

Ah, that's annoying, your Madcatz Fightstick pro mimic exactly an xbox 360 controller, so i can't tell it apart with the xinput library.
In your case, i may have a way, to disting it from the DS4 controller (in fact the other way around, to distinct the DS4 controller from regular 360 gamepad), but i need to do some test.

I do not own the Madcatz Fightstick Pro, my arcade stick is Qanba

Link to comment
Share on other sites

@Sbaby
Yeah, my bad.
In case you need it, i use an home made custom version of DS4Win. Not fully tested, but that should work.
https://github.com/nixxou/DS4Windows/releases/tag/V1
One option that can be relevant if the only type of xinput controller as gamepad you use are DS4, is the 360 knockoff option. It will force controller to use a different vendorId, productId than regular 360 controller.
That way, instead of Type=ArcadeStick... you use "VendorID=0x045E<>ProductID=0x028E" and instead of Type=GamePad, you use "VendorID=0x046D<>ProductID=0xC21F"
That way, you're arcade stick will be recognized as arcade stick. The bad thing is that regular wired 360 controller will also be recognized as arcade stick.

Link to comment
Share on other sites

8 hours ago, Nixx said:

@Sbaby
Yeah, my bad.
In case you need it, i use an home made custom version of DS4Win. Not fully tested, but that should work.
https://github.com/nixxou/DS4Windows/releases/tag/V1
One option that can be relevant if the only type of xinput controller as gamepad you use are DS4, is the 360 knockoff option. It will force controller to use a different vendorId, productId than regular 360 controller.
That way, instead of Type=ArcadeStick... you use "VendorID=0x045E<>ProductID=0x028E" and instead of Type=GamePad, you use "VendorID=0x046D<>ProductID=0xC21F"
That way, you're arcade stick will be recognized as arcade stick. The bad thing is that regular wired 360 controller will also be recognized as arcade stick.

I have tried it, it works, thank you very much it will be useful to me

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...