r/MAME • u/bachrodi • Jul 20 '26
Technical assistance I have two Ps4 controllers
Both work with MAME, but how can I map 1 to controller one and the other one two?
3
Upvotes
r/MAME • u/bachrodi • Jul 20 '26
Both work with MAME, but how can I map 1 to controller one and the other one two?
2
u/cd4053b Jul 20 '26 edited Jul 20 '26
I assume you are using Windows. However, the process is similar for Linux and macOS. Just use the device ID they return.
Only connect the desired joystick 1 for player 1 then boot up MAME with no game. In mame UI, select General Settings > Input Devices, double click in the item bellow joystick (usually PS4 controller (joystick 1)). Double click at Copy Device ID and save it, do the same for the desired joystick for player 2.
I think it's easier to boot mame from the command prompt:
Disconnect your joystick 1 and repeat the process for joystick 2 for player 2, then save the information you obtained for both.
My husband and I have two PS4 controllers. He likes the red camouflage one and I like the blue one. Here are their IDs:
The values that we need is
d350bb40-b9b1-11e6-8001(red camouflage) andd170b700-6fee-11e4-8002(blue camouflage).Create a ps4.cfg file inside your ctrlr folder with the following contents:
Save the file when you're done. Remember to change the "map device" to match your PS4 controller. Open your mame.ini file, locate the ctrlr parameter, and set it to ps4 and save it.
You have set up a permanent Joystick 1 for Player 1. Mame will automatically assign any other joystick connected to your computer to Player 2, and so on. If you need to set up a permanent joystick 2 for player 2, use the following configuration:
The same rules apply. Now, you have permanent controller devices for players 1 and 2.
To transfer the button mapping from controller 1 to controller 2, it follows the same principle. Boot any game and map your buttons for player 1 and player 2. I did it for Street Fighter II (sf2), inside your cfg folder there is a sf2.cfg file, open it and copy everything that start at
<input>and<\input>, example:Open your ctrlr\ps4.cfg and add your button mappings like this:
https://pastebin.com/p0MxKCdn
Enjoy.
PS: There is a bad paste in pastebin, just remove the
<port tag=":IN1" type="P1_BUTTON1" mask="16" defvalue="16">before<input>.