Homepage › Forums › RetroPie Project › Everything else related to the RetroPie Project › Configuring 2-player controls from a single custom USB controller
- This topic has 10 replies, 6 voices, and was last updated 9 years, 11 months ago by caldiniho.
-
AuthorPosts
-
07/19/2014 at 20:41 #17354Tom RolfeGuest
Hey everybody!
I’m new around here. Just recently decided to set up some emulation stuff with custom controls with a view to building an arcade machine.
I built a two player controller using parts from Ultracabs. The buttons for both players go to a single USB interface which plugs straight into the Pi. It shows up as ‘Xin-Mo Dual Arcade’.
The whole thing works great so far. I’ve managed to set up the one-player experience by mapping the emulation keys using the ‘register retroarch controller’ option found within retropie_setup.sh – but I can’t for the life of me figure out how to also assign the controller to work as a player two input.
I’ve noticed on a few (outdated?) tutorials that you can manually edit a .cfg file to tweak or add controls. Problem is I can’t find such a file. I’ve looked for one called retroarch.cfg (mentioned on various sites) and also Xin-MoXin-MoDualArcade.cfg (mentioned by RetroPie after configuring controller).
Can someone help me? I just need to find the config file where my controller is set up. This would also help with my second problem which is how to set up this sort of thing:
input_enable_hotkey_btn = “18”
input_exit_emulator_btn = “19”One other thing of note: a lot of tutorials mention looking inside a RetroPie/emulators folder. This doesn’t exist (or is hidden?). All I see inside RetroPie are folders called BIOS and roms. Has the folder structure changed in a recent update?
Am I doing something wrong or missing something very simple? Please help!
Much thanks
Tom
07/19/2014 at 22:06 #17371trimmtrabbParticipantIf you’re using the latest image/most recent setup script the new location is /opt/retropie/configs/all/retroarch.cfg
07/20/2014 at 17:08 #17554Tom RolfeGuestThanks trimmtrabb. I’ve done some more tweaking and still can’t get player 2 controls to work. The file you mentioned (/opt/retropie/configs/all/retroarch.cfg) seems to only specify the keyboard controls. Then it has these two lines to fetch the configs for my Xin-Mo controller:
input_autodetect_enable = “true”
joypad_autoconfig_dir = “/opt/retropie/emulators/RetroArch/configs/”I’ve looked in that folder and specifically found the Xin-Mo config which I can edit to my heart’s content. What I’m finding confusing is there seems to be three separate places where I could potentially put the code for player 2. Also I’m not sure whether I need to specify the input_player2_joypad_index, the input_device or the input_driver. I’ve tried putting my player 2 code in all these places to no avail:
/opt/retropie/configs/all/retroarch.cfg
/opt/retropie/emulators/RetroArch/retroarch.cfg
/opt/retropie/emulators/RetroArch/configs/Xin-MoXin-MoDualArcade.cfgIn the interest of completeness here’s the code I’ve been trying:
input_player2_b_axis = “-2”
input_player2_y_btn = “18”
input_player2_select_btn = “19”
input_player2_start_axis = “+3”
input_player2_up_btn = “12”
input_player2_down_btn = “13”
input_player2_left_btn = “11”
input_player2_right_btn = “14”
input_player2_a_axis = “+2”
input_player2_x_axis = “-3”These inputs are definitely correct as I’ve successfully used them to control player one as a test that everything was working. No dice for player two though.
What am I doing wrong??
07/21/2014 at 08:13 #17706huettmasterParticipanti have the same problem…when i change the Xin-MoXin-MoDualArcade.cfg (input_enable_hotkey_btn = “16” input_exit_emulator_btn = “10”) he leave the emulators with that buttons.But how i have to change the cfg to play with two players?
this is my Xin-MoXin-MoDualArcade.cfg:
input_device = “Xin-Mo Xin-Mo Dual Arcade”
input_driver = “udev”
input_b_btn = “10”
input_y_btn = “12”
input_select_btn = “6”
input_start_btn = “16”
input_up_axis = “-3”
input_down_axis = “+3”
input_left_axis = “-2”
input_right_axis = “+2”
input_a_btn = “11”
input_x_btn = “13”
input_l_btn = “14”
input_r_btn = “15”input_enable_hotkey_btn = “16”
input_exit_emulator_btn = “10”07/21/2014 at 22:33 #17930trimmtrabbParticipant[quote=17554]Thanks trimmtrabb. I’ve done some more tweaking and still can’t get player 2 controls to work. The file you mentioned (/opt/retropie/configs/all/retroarch.cfg) seems to only specify the keyboard controls. Then it has these two lines to fetch the configs for my Xin-Mo controller:
input_autodetect_enable = “true”
joypad_autoconfig_dir = “/opt/retropie/emulators/RetroArch/configs/”I’ve looked in that folder and specifically found the Xin-Mo config which I can edit to my heart’s content. What I’m finding confusing is there seems to be three separate places where I could potentially put the code for player 2. Also I’m not sure whether I need to specify the input_player2_joypad_index, the input_device or the input_driver. I’ve tried putting my player 2 code in all these places to no avail:
/opt/retropie/configs/all/retroarch.cfg
/opt/retropie/emulators/RetroArch/retroarch.cfg
/opt/retropie/emulators/RetroArch/configs/Xin-MoXin-MoDualArcade.cfgIn the interest of completeness here’s the code I’ve been trying:
input_player2_b_axis = “-2″
input_player2_y_btn = “18″
input_player2_select_btn = “19″
input_player2_start_axis = “+3″
input_player2_up_btn = “12″
input_player2_down_btn = “13″
input_player2_left_btn = “11″
input_player2_right_btn = “14″
input_player2_a_axis = “+2″
input_player2_x_axis = “-3″These inputs are definitely correct as I’ve successfully used them to control player one as a test that everything was working. No dice for player two though.
What am I doing wrong??
[/quote]Run the joypad config:
sudo chown pi /opt/retropie/configs/all/retroarch.cfg cd /opt/retropie/emulators/RetroArch/installdir/bin sudo ./retroarch-joyconfig -j 0 >> /opt/retropie/configs/all/retroarch.cfg
(should be -j 0, try -j 1 if it doesn’t work)
Then edit retroarch.cfg in configs/all/ and copy player 1 controls but change 1 to 2. Then you need to specify which device player 2 uses, add this above p2 controls:
input_player2_joypad_index =
(should be 1)
To list the registered joystick devices with: ls /dev/input
07/21/2014 at 22:56 #17939Tom RolfeGuestThanks again. I have now got this working! huettmaster, you shouldn’t need to change the specific Xin-Mo cfg file at all. That’s the mistake I was making.
The thing I was missing is that the cfg file that needs editing (/opt/retropie/configs/all/retroarch.cfg) has dummy configurations setup for up to 8 players, but they are much further down the file. I had just seen the keyboard config stuff at the top and assumed that was it. After checking a lot of other stuff I eventually scrolled all the way through the cfg and found what I was looking for. Feel a bit silly now. I ended up directly entering the key values for players one and two after jotting down the inputs. The joypad index for both was 0.
Appreciate the help trimmtrabb. I at least feel like I understand the pi and retropie a little better now!
09/17/2014 at 02:42 #67492droopieParticipant[quote=17939]Thanks again. I have now got this working! huettmaster, you shouldn’t need to change the specific Xin-Mo cfg file at all. That’s the mistake I was making.
The thing I was missing is that the cfg file that needs editing (/opt/retropie/configs/all/retroarch.cfg) has dummy configurations setup for up to 8 players, but they are much further down the file. I had just seen the keyboard config stuff at the top and assumed that was it. After checking a lot of other stuff I eventually scrolled all the way through the cfg and found what I was looking for. Feel a bit silly now. I ended up directly entering the key values for players one and two after jotting down the inputs. The joypad index for both was 0.
Appreciate the help trimmtrabb. I at least feel like I understand the pi and retropie a little better now!
[/quote]
you rock! i signed up to the forums just to say that! question tho, say i have 4 players with a mix n match set of controllers. how the heck would i set that up? like if i have an xbox controller, a ps3 controller, and a n64 controller. all usb. i bet each control would have a different value so if player 1 has A button value 3, and player 2 has A value of 2, and so on… do i have to mark each control physically to know which is mapped to what? or how do i use the device name to assign to look up its map universally in a cfg file?11/21/2014 at 23:50 #82959samanelloParticipantI already posted my solution to this here so I will put a link. Basically, the controller will work with nes etc, but the compilation MAME itself in retropie can’t handle the full amount of buttons (only up to 16).
11/22/2014 at 15:37 #82981spannerParticipantHi..
I thought I ask here so not to open another post..Can you use one joypad for two players,with games that the first player plays then hands over the pad so the next player can..?
11/22/2014 at 16:20 #82982samanelloParticipantSure. With the controller we are talking about here, just map the buttons identically for player 1 and 2.
12/13/2014 at 00:18 #83547caldinihoParticipantSo as a noob, how would i go about making esconfig recognise that my i-pac 2 has 2 joysticks and sets of buttons instead of just one?
apologies for being stupid.
thanks in advance.
-
AuthorPosts
- The forum ‘Everything else related to the RetroPie Project’ is closed to new topics and replies.