|
MAME Config - input changes
#396120 - 05/01/23 01:56 PM
|
|
|
Hi all. I am a developer and have written some tools to auto-generate MAME xml input files. In recent months, I understand that the MAME input system has changed somewhat.
To this end, I notice that some port types have changed. e.g.
P1_JOYSTICK_UP -> JOYCODE_1_HAT1UP
JOYCODE_1_BUTTON8 -> JOYCODE_1_SELECT
... is there a definitive resource on what all these changes are, even if it is just a link to the MAME pull request(s) that saw these renames?
Really appreciate any pointers here. Thanks!
|
|
|
|
Re: MAME Config - input changes
[Re: midget35]
#396121 - 05/01/23 03:28 PM
|
|
|
|
|
Re: MAME Config - input changes
[Re: Robbbert]
#396122 - 05/01/23 03:44 PM
|
|
|
Thank you for the link. Was looking at this. But I don't believe it states which button / input names are changed.
And I'm still digging into this... but I think some button names have just been out and out swapped. So 'Button 8' may have changed from being start to right analog btn. Not sure though.
I get the impression it is only causing me headaches tho, so that's good. Doesn't seem to have confused many other devs
|
|
|
|
Re: MAME Config - input changes
[Re: midget35]
#396123 - 05/01/23 04:12 PM
|
|
|
> Thank you for the link. Was looking at this. But I don't believe it states which > button / input names are changed. > > And I'm still digging into this... but I think some button names have just been out > and out swapped. So 'Button 8' may have changed from being start to right analog btn. > Not sure though. > > I get the impression it is only causing me headaches tho, so that's good. Doesn't > seem to have confused many other devs
I don't use controllers so can't help you further. Maybe talk to cuavas since he did the changes.
|
|
|
|
Re: MAME Config - input changes
[Re: midget35]
#396124 - 05/01/23 04:20 PM
|
|
|
|
|
Re: MAME Config - input changes
[Re: Vas Crabb]
#396125 - 05/01/23 05:13 PM
|
|
|
Thanks. So... for xinput (joystickprovider = xinput)... it looks like there are some changes:
- Button 9 is now button 7. - Button 10 is now button 8.
... Right trigger behaviour seems to have been moved to right analog stick x axis.
Big changes indeed. Is there a way to map to the old system? I see your notes on sdl input reversion but can it be done for dinput and xinput (preferably with mame.ini setting)?
Thanks again.
|
|
|
|
Re: MAME Config - input changes
[Re: midget35]
#396126 - 05/01/23 05:26 PM
|
|
|
No, you can’t go back. The new defaults make more things work out-of-the-box with more controllers. The previous approach led to all sorts of stupid workarounds like the one that led to this issue which is the thing that pushed me over the edge to spend two months working on it.
|
|
|
|
Re: MAME Config - input changes
[Re: Vas Crabb]
#396127 - 05/01/23 05:37 PM
|
|
|
Thanks again, Vas.
So is the best way to find old > new mappings just to go through all axis on xinput controllers and look at the input xml changes? Is there a centralised list of what got swapped?
Figure it's worth asking. Not complaining. Just trying to update 100+ input configs expeditiously. Cheers.
|
|
|
|
Re: MAME Config - input changes
[Re: midget35]
#396128 - 05/01/23 07:48 PM
|
|
|
You should really just use the Input Devices menu to see what the tokens are for a given controller. It’s not just a matter of things being “swapped”, it recognises more kinds of controllers and gives better assignments.
|
|
|
|
Re: MAME Config - input changes
[Re: Vas Crabb]
#396129 - 05/01/23 08:04 PM
|
|
|
Oh I have a very good understanding of how the input system markup works. For anyone that wants to update their manually created input configs, the following will help.
You'll want to carefully regex the following for xinput.
JOYCODE_1_DPAD -> JOYCODE_1_HAT1 JOYCODE_1_BUTTON8 -> JOYCODE_1_SELECT JOYCODE_1_BUTTON7 -> JOYCODE_1_START JOYCODE_1_BUTTON10 -> JOYCODE_1_BUTTON8 JOYCODE_1_BUTTON9 -> JOYCODE_1_BUTTON7 JOYCODE_1_ZAXIS -> JOYCODE_1_SLIDER2 JOYCODE_1_RZAXIS -> JOYCODE_1_SLIDER1
This basically means that the buttons we had before that were assigned to Coin1 and Start1 map to L3 and R3, so be careful about the order you make those regex changes.
Also, it looks to me like we might see more renaming in the future. I don't see the naming consistency in:
- JOYCODE_1_RZAXIS = Right analog vertical, and - JOYCODE_1_ZAXIS = Right analog horizontal
Cheers.
|
|
|
|
Re: MAME Config - input changes
[Re: midget35]
#396130 - 05/01/23 08:53 PM
|
|
|
That’s only true for an Xbox style dual analog pad though. An Xinput fight pad has different tokens, as does an Xinput guitar controller, or whatever.
The de facto standard for dual analog DirectInput controllers (e.g. Logitech gamepads and PlayStation adapters) is to make the left thumb stick X/Y and the right thumb stick Z/Rz. The newer PlayStation pads with analog triggers extend that by making the left trigger Rx and the right trigger Ry. Xinput dual analog pads in MAME now follow the convention for the thumb sticks.
When Microsoft added support for Xbox pads in Windows, they went out of their way to ensure that it wouldn’t work well with existing software via DirectInput. They made the right thumb stick Rx/Ry and combined the triggers into a single Z axis, as well as making it impossible to use vibration features via the DirectInput API. For whatever reason, Nintendo Switch controllers also se Rx/Ry for the right thumb stick, but they don’t have analog triggers.
Blame Microsoft for going out of their way to make Xbox pads work poorly with DirectInput to try and push developers to use the Xinput API (and hence only support Xbox-style peripherals), and blame Brad Hughes for doing a shoddy job of Xinput support in MAME in the first place.
|
|
|
|
Re: MAME Config - input changes
[Re: Vas Crabb]
#396131 - 05/01/23 09:06 PM
|
|
|
Ah I see. Thanks for the info there, Vas. I was not aware of this: "the right thumb stick Z/Rz".
In that case I don't see that there will be future naming changes needed. Looks like you've nailed it
As to your point: "That’s only true for an Xbox style dual analog pad"...
Again - absolutely right. That is an important qualifier and I am happy to make that super clear to anyone else reading my last comment: if you use ps/xbox style gamepads with xinput, the above regex changes will help you, but more exotic controllers may not benefit.
Finally, I don't want to blame Brad or anyone else for how MAME handles input. In fact - I think the input system in MAME is excellent, and your changes in MAME 0.252 make it even more powerful.
|
|
|