Jump to content
LaunchBox Community Forums

MAME device remap question


stevenmh

Recommended Posts

Just got into MAME last month and have it running with LB/BB.  I have several USB controllers hooked up to my MAME PC:  Wireless KB w/ trackpad, trackball w/ scroll dial, 4-way fight stick, HOTAS flight stick, and pair of XB1 controllers on Win10 wireless adapter.  I spent the time mapping controls for each game and locked down the cfg directory.  Then I read that people were having trouble with devices swapping around as things are plugged/unplugged or after a reboot due to how Windows assigns USB IDs, so I decided to take it a step further and remap my controllers using a devicemap.cfg file that mame.ini calls under the ctrlr setting.

That all seems to be working fine, but there's one thing I struggled to work through that's not making any sense to me.  When I looked at the verbose log to get IDs, the keyboard and mice showed the same unique hardware IDs that appear in the Windows Device Manager.  However, what I got for the XInput controllers is XInput Player 1, XInput Player 2, etc.  This is not a unique ID, it's an arbitrary assignment.  As I toyed with it this afternoon, it generally appeared to be a first come first serve basis, with XInputs being called out in numerical sequence.  Although there was one instance where I had two of them plugged in and they were called XInput 1 and XInput 3.  Exited out of MAME and went back in, now they're 1 and 2 again.  I'm failing to understand how this is a solution to USB IDs being reassigned.

I fixed the first come first serve problem by changing my fight stick from XInput to DInput so that I could get a unique name for it.  If my XB1 controllers swap back and forth between 1 and 2 it doesn't matter that much, we can figure out which one is which once we start playing.  But if it decides to randomly call the second one XInput 3 at launch, it will be a problem because it won't be mapped right.  Am I missing something obvious here, or is there no good reason why MAME shouldn't be looking at the device manager hardware IDs for remapping XInput controllers the same as it does for everything else?  Or better yet, why don't they skip the remap feature and just identify every controller with its unique device manager ID right off the bat?

Edited by stevenmh
Link to comment
Share on other sites

8 minutes ago, stevenmh said:

Just got into MAME last month and have it running with LB/BB.  I have several USB controllers hooked up to my MAME PC:  Wireless KB w/ trackpad, trackball w/ scroll dial, 4-way fight stick, HOTAS flight stick, and pair of XB1 controllers on Win10 wireless adapter.  I spent the time mapping controls for each game and locked down the cfg directory.  Then I read that people were having trouble with devices swapping around as things are plugged/unplugged or after a reboot due to how Windows assigns USB IDs, so I decided to take it a step further and remap my controllers using a devicemap.cfg file that mame.ini calls under the ctrlr setting.

That all seems to be working fine, but there's one thing I struggled to work through that's not making any sense to me.  When I looked at the verbose log to get IDs, the keyboard and mice showed the same unique hardware IDs that appear in the Windows Device Manager.  However, what I got for the XInput controllers is XInput Player 1, XInput Player 2, etc.  This is not a unique ID, it's an arbitrary assignment.  As I toyed with it this afternoon, it generally appeared to be a first come first serve basis, with XInputs being called out in numerical sequence.  Although there was one instance where I had two of them plugged in and they were called XInput 1 and XInput 3.  Exited out of MAME and went back in, now they're 1 and 2 again.  I'm failing to understand how this is a solution to USB IDs being reassigned.

I fixed the first come first serve problem by changing my fight stick from XInput to DInput so that I could get a unique name for it.  If my XB1 controllers swap back and forth between 1 and 2 it doesn't matter that much, we can figure out which one is which once we start playing.  But if it decides to randomly call the second one XInput 3 at launch, it will be a problem because it won't be mapped right.  Am I missing something obvious here, or is there no good reason why MAME shouldn't be looking at the device manager hardware IDs for remapping XInput controllers the same as it does for everything else?  Or better yet, why don't they skip the remap feature and just identify every controller with its unique device manager ID right off the bat?

This is the exact reason i have my mayflash arcade stick set to dinput rather than xinput, MAME would always confuse it with my xbox controllers, and i map the stick differently than i would the controller (i have the top row as the first 3 buttons for example). I never found a way around it so i permantly leave my stick as dinput as its the only dinput device i have so it doesnt confuse MAME.

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...