Jump to content
LaunchBox Community Forums

Controller Nightmares


Tantrumus

Recommended Posts

Is there any software out there that still works that over-rides Win11 changing controller assignments?   

I have emu PC hooked up with following controllers and I should note that not all of these are consistently ALWAYS connected.

Mayflash Wii Bar

(4) Wii Remotes

(4) Generic Gamepads

(2) Fight sticks (Mayflash F500, and a generic)

I saw guides that said hook EVERYTHING up at once and go through the pains of mapping everything.... which I did for HOURs on Sunday.

All was good until next reboot. 

Really a facepalm situation just have no clue what the best method is to get this consistent...

Any tips/suggestions really welcome.   I think the issue is just Windows dynamically shifting around controller IDs.

To clarify 99% of the pain is MAME mappings.

Starting to really think that the only solution is to build a cab where everything is statically wired all the time.   The dream/vision of the family emu station is dying fast from this alone :( :(

 

Edited by Tantrumus
Link to comment
Share on other sites

On 10/25/2023 at 7:20 AM, Tantrumus said:

To clarify 99% of the pain is MAME mappings.

this should help you sort it out

https://docs.mamedev.org/advanced/devicemap.html

google MAME stable controller ID's and you will find plethora of threads, docs, and youtube vids to guide you if need more details than the MAME wiki link

 

goes without saying....yea....plugging in and unplugging devices is certainly going to make your life more difficult depending on how your controllers get identified. most or best case scenario will mean each controller is a unique device ID, but if they come up as duplicates because you have multiples of the same device, then they get drilled down further with an "instance ID"

for ex, when I plug in two particular xinput controllers they have same device ID but will have different instance ID. lets say controller A is device A and instance #1. controller B is also device A but is instance #2

if I plugged in controller B ONLY (as in unplugged controller A), due to how the remap works in this case, controller B would come up as device A still but this time instance #1 and therefore player #1 rather than perhaps the intended player #2. depends on how you like to use your setup. but this is a known limitation of the whole system and feature as a whole.

Link to comment
Share on other sites

skizzosjt thank you very much!   Each time I start a new hobby or direction the first thing I battle is the terminology I try to use in my searches.

Appreciate the direction!   This has probably been the biggest frustration since building this Emu box. :) 

Edited by Tantrumus
Link to comment
Share on other sites

I have been following the guides and ran mame -v galaga > test.txt and reviewed the controller IDs there.

Then to be extra sure I added each controller one at a time and noted down the device instance path and they matchup.

F500 Mayflash  = HID\VID_2F24&PID_0087&IG_01\A&1FD1FBD7&0&0000
Generic stick     = HID\VID_045E&PID_028E&IG_00\8&2843E5B&0&0000
Gamepad_1       = HID\VID_046D&PID_C21D&IG_00\9&34C0224D&0&0000
Gamepad_2       = HID\VID_046D&PID_C21D&IG_00\8&3A0E7D2D&0&0000
Gamepad_3       = HID\VID_046D&PID_C21D&IG_00\B&10C56C37&0&0000
Gamepad_4       = HID\VID_046D&PID_C21D&IG_00\9&391491C6&0&0000
 

My main confusion lies in how the examples show in the example doc:

<system name="default">
    <input>
        <mapdevice device="VID_D209&amp;PID_1601" controller="GUNCODE_1" />
        <mapdevice device="VID_D209&amp;PID_1602" controller="GUNCODE_2" />
        <mapdevice device="XInput Player 1" controller="JOYCODE_1" />
        <mapdevice device="XInput Player 2" controller="JOYCODE_2" />
    </input>
</system>

How do the XInput Player 1 and 2 even get saved to be unique devices without any of the PID info?

Would I do something like:

<system name="default">
    <input>
        <mapdevice device="VID_2F24&PID_0087" controller="JOYCODE_1" />
        <mapdevice device="VID_045E&PID_028E&IG_00" controller="JOYCODE_2" />
        <mapdevice device="VID_046D&PID_C21D&IG_00\9&34C0224D&0&0000" controller="JOYCODE_3" />
        <mapdevice device="VID_046D&PID_C21D&IG_00\8&3A0E7D2D&0&0000" controller="JOYCODE_4" />
        <mapdevice device="VID_046D&PID_C21D&IG_00\B&10C56C37&0&0000" controller="JOYCODE_5" />
        <mapdevice device="VID_046D&PID_C21D&IG_00\B&10C56C37&0&0000" controller="JOYCODE_6" />
    </input>
</system>

As you can see the PID value is the same on all 4 gamepads the only uniqueness is the last value in the Device instance path....

I'm obviously going to try this out while waiting for replies but this struggle of mine may help someone later on.

 

 

Edited by Tantrumus
Link to comment
Share on other sites

So the gamepads are the struggle no form of formatting (on the above codes I shared for the gamepads) keep MAME from crashing on startup.  I got the fight-sticks to map properly.   

Ultimately I guess who cares how the gamepads map....

 

<?xml version="1.0"?>
<mameconfig version="10">
        <system name="default">
        <input>
                <mapdevice device="VID_2F24;PID_0087" controller="JOYCODE_1" />
                <mapdevice device="VID_045E;PID_028E;IG_00" controller="JOYCODE_2" />
            </input>
    </system>
</mameconfig>

Edited by Tantrumus
Link to comment
Share on other sites

20 minutes ago, Tantrumus said:

So the gamepads are the struggle no form of formatting (on the above codes I shared for the gamepads) keep MAME from crashing on startup.  I got the fight-sticks to map properly.   

Ultimately I guess who cares how the gamepads map....

One thing I see you did here was to replace the ampersand ( & ) with a semicolon.   I wasn't aware that'd work. So if it does, great!

What they did (and typically needs to be done because of the xml formatting language) in their 'example doc' was replaced the ampersand with 

&amp;

So for the gamepads, you might try

<mapdevice device="VID_046D&amp;PID_C21D&amp;IG_00\9&amp;34C0224D" controller="JOYCODE_3" />
<mapdevice device="VID_046D&amp;PID_C21D&amp;IG_00\8&amp;3A0E7D2D" controller="JOYCODE_4" />
<mapdevice device="VID_046D&amp;PID_C21D&amp;IG_00\B&amp;10C56C37" controller="JOYCODE_5" />
<mapdevice device="VID_046D&amp;PID_C21D&amp;IG_00\9&amp;391491C6" controller="JOYCODE_6" />

You'll notice I truncated the device ID's, essentially leaving up-to where the 4 gamepads' ID's were unique.

Link to comment
Share on other sites

TY for that reply.  I thought I had things working but alas no.   Joy1 which was the Mayflash fightstick became Joy3 after reboot.

I will try the &amp;  (was not sure what that meant in the examples and thought it was part of the lightgun in the example.   I accidentally discovered anywhere the & appeared in the device instance path string I could replace it with a semicolon and MAME wouldnt crash so I thought I nailed it LOL.   

Appreciate the suggestion and I'll report back!

Edited by Tantrumus
Link to comment
Share on other sites

Tried your suggestion:

<?xml version="1.0"?>
<mameconfig version="10">
        <system name="default">
        <input>
                <mapdevice device="VID_2F24&amp;PID_0087" controller="JOYCODE_1" />
                <mapdevice device="VID_045E&amp;PID_028E&amp;IG_00" controller="JOYCODE_2" />
            </input>
    </system>
</mameconfig>

Still came back joy3 for the first device mapping.

I saw other samples online where they took out the VID parts and I simplified to below and still first mapping shows JOY3 when trying any settings.

<?xml version="1.0"?>
<mameconfig version="10">
        <system name="default">
        <input>
                <mapdevice device="PID_0087" controller="JOYCODE_1" />
                <mapdevice device="PID_028E" controller="JOYCODE_2" />
            </input>
    </system>
</mameconfig>
 

Appreciate the help.

Link to comment
Share on other sites

Where are you saving this file?  It should be something like "myConfigs.cfg" (or any name you want) and stored in the /ctrlr/ folder.  Then in "mame.ini" add 'myConfigs' to the "ctrlr" line.

image.png.0252d271bd246cde8f0207d8003a0cce.png

This way, it's 'set in stone'.  As in MAME will load the ctrlr file (that you pointed to in mame.ini) and override any defaults.   Also, MAME will not overwrite anything in your myConfigs.cfg file.  Whereas it will overwrite default.cfg (located in the /cfg/ folder).

 

 

38 minutes ago, Tantrumus said:

first mapping shows JOY3 when trying any settings.

Seems odd if what you're saying is you set your Mayflash (PID_0087) to JOYCODE_1, yet when you go to map a button, it's coming up as JOYCODE_3_Button1.  Since you've only mapped the 2 devices in the .cfg file, one of the other 4 devices plugged in might be mapped intrinsically to JOYCODE_1 also.  Causing a conflict.  Hopefully it's something as simple as that.  Unplug the other 4 and see if it still does the same thing.

 

Another issue may be if you're using a USB hub to plug in some of the devices and the rest are being plugged into regular ports.  

Link to comment
Share on other sites

Oh yeah I minimized the testing to just the 2 fight sticks connected by themselves without the gamepads.

Yes I had mame.ini setup to use a mycontrollerconfig

One thing I noticed while all (6) controllers were connected .... I ran "MAME -v galaga > test.txt" and found that neither fight stick showed up anywhere even though device manager showed them.

This led me to start digging in the fight stick manuals....   I'll be back when I have time to mess with this more.... color me confused.   This shouldnt be rocket science "Thanks Microsoft for how you enumerate joysticks."

Link to comment
Share on other sites

26 minutes ago, Tantrumus said:

One thing I noticed while all (6) controllers were connected .... I ran "MAME -v galaga > test.txt" and found that neither fight stick showed up anywhere even though device manager showed them.

I'd be inclined to not load a ROM when getting the verbose output.  If the ROM has some sort of overrides (be it a romName.cfg, a vertical.ini not loading 'mycontrollerconfig' or something else along those lines), it may confuse matters.  But I may also be overthinking it. ;)  I'd just run from the command prompt "mame.exe -v > test,txt".  Let MAME fully load, then exit it.

  • Unusual Gem 1
Link to comment
Share on other sites

I haven't been messing with my system for a while but I saw this while looking up PlayNite info that led me to the LB forums and wanted to share a tool I have been using since the HyperSpin days. I haven't set it up on my pc since my last windows reinstall but have a boatload of wireless retro controllers (approaching 50) and this kept things in line.  @Tantrumus

Here is a guide by Planet Geekdom. It was originally released on the HyperSpin forums but their servers crashed recently and have been trying to get back up to full steam. So I am upping it here for you. Hope this helps you and whomever else may need it.

Tur-Game_Controller_Order_1.5.7z

Link to comment
Share on other sites

Hi @Tantrumus, for what it's worth, I'll post my customized remaps as a real world working example to hopefully give more guidance. I am using MAME v230 in case this matters, but from what I can tell, looks like the same layout and syntax still used per the WIKI - so you should be OK even if on the latest and greatest version

 

This one is for a couple different xinput controllers. I have two wired PowerA controllers. One is an Xbox One version, the other is an Xbox Series X version. I also have an OEM Xbox One controller, and a OEM Xbox Series X controller. If I recall right, BOTH the PowerA (so both the Xbox One AND the Xbox Series X version) and the OEM Xbox One controller ALL come up with the same "Controller (Xbox One for Windows)" device name....weird....given one is literally designed for the Xbox Series X lol. This is why I ended up learning about this feature. Note I have comments for each controller so I know what each line was for

<mameconfig version="10">
   <system name="default">
      <input>

	 <!-- Joycode 1 = PowerA Xbox Series X Spectra (XBX Spectra Enhanced Wired Controller) OR "1st Instance" of either PowerA Controller-->
	 <mapdevice device="Controller (Xbox One For Windows) product_02ff045e-0000-0000-0000-504944564944 instance_89cdbd70-5b86-11ec-8001-444553540000" controller="JOYCODE_1" /> 

	 <!-- Joycode 2 = Microsot Xbox Series X (Xbox Wireless Controller) -->
  	 <mapdevice device="Bluetooth LE XINPUT compatible input device product_0b13045e-0000-0000-0000-504944564944 instance_e2687c60-5944-11ed-8002-444553540000" controller="JOYCODE_2" /> 

 	 <!-- Joycode 3 = Microsot Xbox One (XB1 Spectra Pro) OR "2nd Instance" of either PowerA Controller-->
	 <mapdevice device="Controller (Xbox One For Windows) product_02ff045e-0000-0000-0000-504944564944 instance_90a14d40-7978-11ed-8001-444553540000" controller="JOYCODE_3" />

      </input>
   </system>
</mameconfig>

 

This one I use for two AIMTRACK style light guns

<mameconfig version="10">
   <system name="default">
      <input>	    
	 <mapdevice device="VID_D209&amp;PID_1601" controller="GUNCODE_1" />        
	 <mapdevice device="VID_D209&amp;PID_1602" controller="GUNCODE_2" /> 
	 <mapdevice device="ATRAK Device #1 product_1601" controller="JOYCODE_1" />  
	 <mapdevice device="ATRAK Device #2 product_1602" controller="JOYCODE_2" /> 
      </input>
   </system>
</mameconfig>

 

so my mame.ini always calls to the 1st ctrl config by default. when a light gun game runs, mame will use that game's custom ini file (for ex term2.ini), which will call out the light gun remap,

  • Unusual Gem 1
Link to comment
Share on other sites

I really want to thank everyone who took the time to respond and offer up some help!   What a great community.

@LegzRwheelz thx for the alternate idea with that tool may look at that if I cannot get this working, sounds promising. BTW that server crash.  I have noticed for weeks its said the same thing looking at their webpage hopefully they get their site back in order.

@skizzosjt thanks a lot for sharing that.   In several reddit threads I noticed similar mappings  with device name and that GUID at the end.   NONE of my devices look like that in the MAME text dump.   I will run it today and share how mine looks.

 I do have a question before I do another mame dump,  the fight sticks have many modes (xinput, dinput, etc) should I have them hard set to x-input or does it not matter?  The last idea I had in frustration last night was setting mame to dinput mode and the thought would be let all the sticks have the same buttons etc, but alas these are different fightsticks so the button numbers come up different.   Then I basically told my wife "I give up, lets put this other fight stick to the side and buy another Mayflash and at least the will map the buttons the same way and wont have that issue anymore."   Should also mention the logitech gamepads also have a x/d switch (had them on x-input) at the start of this use-case, currently on dinput per drift in ideas to handle the prob.   

@JoeViking245 thanks for the suggestion on dumping the data differently.  I first saw how to do this in a video by Mavericks Arcade on Youtube and his example said to load galaga or some other rom.    Maybe back then you had to do it like that.

 

EDIT:

ADHD Shift in thoughts....correct me if I'm wrong here:

If both fight sticks are exactly the same (2) Mayflash F500  then all the button#'s etc will map exactly the same in MAME and who cares which becomes player1 or 2 when we are both playing.   If we want to force which is player one just plug them in, in order...   

Next the (4) game pads are all the same so same thoughts there.

If we are going to play 2 player we just plug in fight sticks in order of player1 and 2 and dont really have to worry about different mappings and can just use dinput, same thought with gamepads.

I took leap of faith and ordered another one for my wife (and an IST Alpha N lever ;) had to make it same as mine, got white sanwa buttons and a green bat top for hers to tell them apart HAHA) she will still bitch about the $$$ but will get over it once we start having fun instead of fighting with control configs.

If this ends up fixing my issues, I apologize for wasting everyone's time.

 

PS: The other fightstick wont go to waste and I'll just keep it around my main gaming PC.

It's this one for the record and been a major pain, however built like a tank, and worst instructions ever:  https://www.amazon.com/gp/product/B08PBF8GQV/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1

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

10 hours ago, LegzRwheelz said:

@skizzosjt This comes in clutch since I am starting completely fresh with mame and learning how to do something the manual way is great(I uploaded the tool right before you). I am wondering how you got the "product_#########" info? Thanks. 

run MAME in verbose mode. as in it will output all of its "under the hood" business to the command prompt. or thanks to @JoeViking245 mentioning this, you can have it automatically dump into a text file

you need to run mame with the -v parameter for ex

mame -v

 

JoeViking mention you can output to a text file with adding just a bit more for ex

mame -v > mamedevices.txt

you can name the file whatever you want

https://docs.mamedev.org/advanced/devicemap.html

scroll down to listing available devices to see the wiki's example of the output

 

5 hours ago, Tantrumus said:

@skizzosjt thanks a lot for sharing that.   In several reddit threads I noticed similar mappings  with device name and that GUID at the end.   NONE of my devices look like that in the MAME text dump.   I will run it today and share how mine looks.

 I do have a question before I do another mame dump,  the fight sticks have many modes (xinput, dinput, etc) should I have them hard set to x-input or does it not matter?  The last idea I had in frustration last night was setting mame to dinput mode and the thought would be let all the sticks have the same buttons etc, but alas these are different fightsticks so the button numbers come up different.   Then I basically told my wife "I give up, lets put this other fight stick to the side and buy another Mayflash and at least the will map the buttons the same way and wont have that issue anymore."   Should also mention the logitech gamepads also have a x/d switch (had them on x-input) at the start of this use-case, currently on dinput per drift in ideas to handle the prob.   

Personally I've only had xinput controllers. The last console I bought was an Xbox 360 so I first was using a wired version of them. Then I got a couple Xbox One controllers, both wired and wireless, and got a Xbox Series X wireless as the newest addition. My use case just made sense to make use of xinput controllers.

It's not likely that one is right or wrong, or better or worse, more like you need to pick a lane and stick with it. If some controllers are using xinput and some are using dinput, I would bet that could be more problematic. Say someone grabs controller A which is xinput to play a game and it works fine. But later someone grabs controller B which is dinput to play the same game, this time there might be funny business going on if things don't translate well between xinput and dinput for the given game. So since it sounds like most or all of them have an available mode switch you should pick whichever mode you tend to prefer and set everything up considering that personal preference

Link to comment
Share on other sites

4 hours ago, skizzosjt said:

run MAME in verbose mode. as in it will output all of its "under the hood" business to the command prompt. or thanks to @JoeViking245 mentioning this, you can have it automatically dump into a text file

you need to run mame with the -v parameter for ex

mame -v

 

JoeViking mention you can output to a text file with adding just a bit more for ex

mame -v > mamedevices.txt

you can name the file whatever you want

https://docs.mamedev.org/advanced/devicemap.html

scroll down to listing available devices to see the wiki's example of the output

 

Personally I've only had xinput controllers. The last console I bought was an Xbox 360 so I first was using a wired version of them. Then I got a couple Xbox One controllers, both wired and wireless, and got a Xbox Series X wireless as the newest addition. My use case just made sense to make use of xinput controllers.

It's not likely that one is right or wrong, or better or worse, more like you need to pick a lane and stick with it. If some controllers are using xinput and some are using dinput, I would bet that could be more problematic. Say someone grabs controller A which is xinput to play a game and it works fine. But later someone grabs controller B which is dinput to play the same game, this time there might be funny business going on if things don't translate well between xinput and dinput for the given game. So since it sounds like most or all of them have an available mode switch you should pick whichever mode you tend to prefer and set everything up considering that personal preference

Thank you for the info. I don't know how I missed that, I even liked @JoeViking245s post. This is all great information. So thank you  @skizzosjt and...Joe thank you for the valuable information. It's in my toolbox. 

 

@Tantrumus I'm glad to help. I wanted to tell you that that tool works on a system level. Meaning it locks your devices to the ID that Windows assigns to it and keeps them locked down. I honestly cannot tell you what's going on beneath the hood but I know it stopped my emulators from getting confused with my abundance of controllers. 

  • Like 1
Link to comment
Share on other sites

I think I finally got this working!

 

Applying default configuration from controller configuration file MyControllerConfig2.cfg
Input: Remapped joystick #3: Controller (Gamepad F310) (device id: Controller (Gamepad F310) product_c21d046d-0000-0000-0000-504944564944 instance_60716af0-6906-11ee-8001-444553540000)
Input: Remapped joystick #1: Controller (MAYFLASH Arcade Fightstick F500 V2) (device id: Controller (MAYFLASH Arcade Fightstick F500 V2) product_00872f24-0000-0000-0000-504944564944 instance_18b98900-7049-11ee-8001-444553540000)

 

TY skizzosjt for your sample to reference.

 

I have more work to do but above proves out that the mapping is now working.

 

Some observations:

This may seem wrong but only way I got the Mayflash to show in the MAME dump was to force MAME in dinput mode.   Interestingly enough the Mayflash stick is in xinput mode /smh but its working now.....

 

At least now I can setup all the bindings for all the devices and not worry about the next time Windows enumerates the controllers screwing everything up later.

Added the new Mayflash and here is the config.   Cannot express the happiness I am feeling right now.  This was a PITA!  Glad this community is here!   Thank you to everyone who responded above.

<?xml version="1.0"?>
<mameconfig version="10">
        <system name="default">
        <input>
                <mapdevice device="Controller (MAYFLASH Arcade Fightstick F500 V2) product_00872f24-0000-0000-0000-504944564944 instance_18b98900-7049-11ee-8001-444553540000" controller="JOYCODE_1" />
            <mapdevice device="Controller (MAYFLASH Arcade Fightstick F500 V2) product_00872f24-0000-0000-0000-504944564944 instance_49966c70-7beb-11ee-8001-444553540000" controller="JOYCODE_2" />
            <mapdevice device="Controller (Gamepad F310) product_c21d046d-0000-0000-0000-504944564944 instance_60716af0-6906-11ee-8001-444553540000" controller="JOYCODE_3" />
            </input>
    </system>
</mameconfig>

 

image.thumb.png.8ba5fa073a7ef2572188a1a04c482a07.png

Edited by Tantrumus
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...