Guide: Advanced Controller Mappings
-
@spud11 you still have uae4arm in your onstart file. If you're using amiberry now you need to replace it with amiberry.
Edit: I just looked at my script and i'm suprised that it worked with uae4arm. In my script it says that you need to call the system not the software.
Thats why i didn't had that problem when i made the official change to amiberry because i had setamiga
instead ofuae4arm
oramiberry
.### Execute the driver with the configuration you need # $1 is the name of the emulation, not the name of the software used # it is intellivision not jzintv case $1 in amiga) $xboxkill joycommand="$LogiF710 $amiga &" eval $joycommand ;; esac
-
@EctoOne and @mediamogul Oh cripes. That was silly of me. Thank you both. I'm at work at the moment, but once home will replace uae4arm with amiberry in the runcommand-onstart and then see what happens.
Also, I haven't had any problems with the line break issue for some time now, because I've got the editor now set to show 'LF' after each return so I don't think it will be that but will look at it again if the above doesn't work.
-
-
@mediamogul and @EctoOne
Brilliant! All good now. The change from uae4arm to amiberry-a1200 in the runcommand-onstart fixed the problem. Also, I realised I'd already added
button_for_quit=8
in the .uae so pressing my back button automatically led to it exiting. I've replaced that withbutton_for_quit=-1
and I've got thekey_for_quit=27
in there too so all is working as it should with back+start now exiting the game.Thank you!
-
@mediamogul Hi. With 2 player alternate games (ie games where 1 player takes a turn and then the next player takes their turn), Advance Mame (or actually the game itself) defaults to Player 1's joystick. Advance Mame works fine for 2 Player simultaneous games - in that case Player 1's joystick controls Player 1; Player 2's joystick controls Player 2.
But as I have an arcade table with 4 joysticks, I was hoping to use xboxdrv to get Advance Mame to recognise Player 2's joystick for 2 player alternate games by having Player 2's joystick mirror Player 1's keys so that there is no need to change seats each time. I have set up Advance Mame using TAB to give Player 1 and Player 2 different keys.
As I don't want Player 2 to mimic Player 1's keys when I'm playing 2 player simultaneous/co-operative games, I'm trying to "carve out" the 2 Player simultaneous games eg Mario Bros. Then with the
*
class, every other game including 1 player and 2 player alternate games will have Player 2's joystick mapped to Player 1's keys.With Mario Bros, I've tested my code in commandline and it does work 100% (Player 1's joystick is mapped to Player 1's keys and Player 2's joystick is mapped to Player 2's keys), but I can't get it to work properly in runcommand-onstart. What happens is that Mario Bros, instead of being treated as a "carved out" 2 player simultaneous game, it is treated among the
*
class ie like every non-simultaneous game - that is, both Player 1's joystick and Player 2's joystick controls Player 1.An extract of the code from runcommand-onstart is here:
### Code begins ### Game/ROM full path rom="${3##*/}" Player1_AdvMame_Sim="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \ --device-name "Player_1" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \ --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \ --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC" Player2_AdvMame_Sim="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \ --device-name "Player_2" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \ --ui-axismap X1=KEY_D:KEY_G,Y1=KEY_R:KEY_F \ --ui-buttonmap a=KEY_A,b=KEY_S,x=KEY_Q,y=KEY_W,back=KEY_6+KEY_2,start=KEY_UNKNOWN,back+start=KEY_SPACE+KEY_ESC" Player1_AdvMame_Alt="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \ --device-name "Player_1" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \ --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \ --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC" Player2_AdvMame_Alt="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \ --device-name "Player_2" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \ --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \ --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC" ### 2 Player Co-operative or 2 Player Simultaneous Arcade games - for Advance Mame. These are games where 2 players are playing at the same time with different joysticks. With 2 Player Co-operative games, Player 1 uses Player 1's joystick and Player 2 uses Player 2's joystick. For 2 player alternate games using Advance Mame (ie games where one person takes their turn and then the next player takes their turn), Player 1 and Player 2 use Player 1's joystick. Player 2 can't use a separate joystick. To avoid this "hot seating", these xboxdrv configurations allow 2 Player Co-operative games to continue to use 2 joysticks while for 2 Player alternate games which use hotseating normally, Player 1's and 2's joystick controls now mirror each other by using the same keys, so there is no need for "hotseating". TwoPlayerSim=""aerofgt.zip"|"aerofgtb.zip"|"aerofgtc.zip"|"sonicwi2.zip"|"sonicwi3.zip"|"alien3.zip"|"avspu.zip"|"aliens.zip"|"alpham2.zip"|"altbeast.zip"|"altbeas2.zip"|"altbeas4.zip"|"altbeas5.zip"|"altbeaj1.zip"|"altbeaj.zip"|"altbeaj3.zip"|"androdun.zip"|"armwar.zip"|"baddudes.zip"|"batcir.zip"|"btoads.zip"|"bnzabros.zip"|"bublbobl.zip"|"bublbobr.zip"|"bublbob1.zip"|"bublbob2.zip"|"bubblebobbleultra.zip"|"bubblem.zip"|"bubsympe.zip"|"bubsymph.zip"|"bubsympu.zip"|"burnforc.zip"|"burnfrco.zip"|"burningf.zip"|"burningh.zip"|"dino.zip"|"dinoj.zip"|"dinou.zip"|"captaven.zip"|"captavna.zip"|"captavne.zip"|"captavnj.zip"|"captavnu.zip"|"captavuu.zip"|"captcomm.zip"|"captcomu.zip"|"captcomj.zip"|"cawing.zip"|"cawingj.zip"|"cawingr1.zip"|"cawingu.zip"|"edrandy.zip"|"edrandy1.zip"|"edrandyj.zip"|"ctribe.zip"|"ctribeb.zip"|"contra.zip"|"contrab.zip"|"contraj.zip"|"contrajb.zip"|"crimfght.zip"|"crimfgt2.zip"|"crimfgtj.zip"|"crsword.zip"|"darius.zip"|"darius2.zip"|"darius2d.zip"|"dariuse.zip"|"dariusg.zip"|"dariusgj.zip"|"dariusgu.zip"|"dariusgx.zip"|"dariusj.zip"|"dariuso.zip"|"diehard.zip"|"ddrgn2u.zip"|"ddrgnw1.zip"|"ddrago3b.zip"|"ddragon.zip"|"ddragon2.zip"|"ddragon3.zip"|"ddragonb.zip"|"ddragonu.zip"|"ddragonw.zip"|"ddsom.zip"|"ddsoma.zip"|"ddsomj.zip"|"ddsomjr1.zip"|"ddsomr1.zip"|"ddsomr2.zip"|"ddsomu.zip"|"ddsomur1.zip"|"ddtod.zip"|"ddtoda.zip"|"ddtodh.zip"|"ddtodj.zip"|"ddtodjr1.zip"|"ddtodr1.zip"|"ddtodu.zip"|"ddtodur1.zip"|"dynamcop.zip"|"dynwar.zip"|"dynwarj.zip"|"exedexes.zip"|"ffight.zip"|"ffightj.zip"|"ffightj1.zip"|"ffightu.zip"|"ffightua.zip"|"gdarius.zip"|"gdarius2.zip"|"gdariusb.zip"|"gground.zip"|"gaun2pg1.zip"|"gaun2pg2.zip"|"gaun2pr3.zip"|"gaun22p1.zip"|"gaun22pg.zip"|"gaunt2.zip"|"gaunt2g.zip"|"gaunt2p.zip"|"gaunt2pg.zip"|"gaunt2pj.zip"|"gaunt22p.zip"|"gauntdl.zip"|"gauntg.zip"|"gauntgr3.zip"|"gauntgr6.zip"|"gauntgr8.zip"|"gauntj.zip"|"gauntj12.zip"|"gauntr1.zip"|"gauntr2.zip"|"gauntr4.zip"|"gauntr5.zip"|"gauntr7.zip"|"gauntr9.zip"|"gpilots.zip"|"gokuparo.zip"|"goldnax1.zip"|"goldnax2.zip"|"goldnax3.zip"|"goldnaxe.zip"|"goldnaxj.zip"|"goldnaxu.zip"|"ga2.zip"|"ga2j.zip"|"ga2u.zip"|"mt_gaxe.zip"|"mt_gaxe2.zip"|"gwar.zip"|"gwara.zip"|"gwarb.zip"|"gwarj.zip"|"hbarrel.zip"|"hbarrelw.zip"|"iceclimb.zip"|"iceclmbj.zip"|"iceclmrj.zip"|"joust.zip"|"joustr.zip"|"joustwr.zip"|"knights.zip"|"knightsj.zip"|"knightsu.zip"|"lresort.zip"|"lwings.zip"|"lwings2.zip"|"lwingsjp.zip"|"lifefrce.zip"|"lifefrcj.zip"|"mario.zip"|"mariojp.zip"|"mslug.zip"|"mslug2.zip"|"mslug3.zip"|"mslug3b6.zip"|"mslug3n.zip"|"mslug4.zip"|"mslug5.zip"|"mslugx.zip"|"mwalk.zip"|"mwalkbl.zip"|"mwalkj.zip"|"mwalku.zip"|"nbbatman.zip"|"gaiden.zip"|"progear.zip"|"progeara.zip"|"progearj.zip"|"punisher.zip"|"punishrj.zip"|"punishru.zip"|"rampage.zip"|"rampage2.zip"|"rmpgwt.zip"|"rmpgwt11.zip"|"robocop2.zip"|"robocp2j.zip"|"robocp2u.zip"|"rtypeleo.zip"|"rtypelej.zip"|"salamand.zip"|"salamanj.zip"|"salamndr2.zip"|"sengokh.zip"|"sengokmj.zip"|"sengoku.zip"|"sengoku2.zip"|"sengoku3.zip"|"sexyparo.zip"|"shocktro.zip"|"shocktr2.zip"|"sscope2.zip"|"simpsn2p.zip"|"skullfng.zip"|"skykid.zip"|"skykidd.zip"|"skykiddo.zip"|"skykiddx.zip"|"smashtv.zip"|"smashtv4.zip"|"smashtv5.zip"|"smashtv6.zip"|"spclorda.zip"|"spclordb.zip"|"spclordg.zip"|"spclords.zip"|"spidman.zip"|"spidmanu.zip"|"streetsm.zip"|"streets1.zip"|"streetsj.zip"|"streetsw.zip"|"ssriders.zip"|"scobra.zip"|"scobrab.zip"|"scobras.zip"|"scobrase.zip"|"tmnt.zip"|"tmnt2.zip"|"tmnt2a.zip"|"tmnt2pj.zip"|"tmnt2po.zip"|"tmnt22p.zip"|"tmntj.zip"|"tmntu.zip"|"tmntua.zip"|"timecrs2.zip"|"twinbee.zip"|"unsquad.zip"|"vendet2p.zip"|"viostorm.zip"|"viostrma.zip"|"viostrmj.zip"|"viostrmu.zip"|"vcop.zip"|"vcop2.zip"|"wof.zip"|"wofa.zip"|"wofj.zip"|"wofu.zip"|"wow.zip"|"xmen.zip"|"xenophob.zip"" case $2 in advmame) case $rom in $TwoPlayerSim) # Configuration used only for these 2 Player Co-Operative / Simultaneous ROMs $xboxkill joycommand="$Player1_AdvMame_Sim & $Player2_AdvMame_Sim &" eval $joycommand ;; *) # Configuration for every other ROM in respect of this emulator including 2 Player "hotseating" ROMS $xboxkill joycommand="$Player1_AdvMame_Alt & $Player2_AdvMame_Alt &" eval $joycommand ;; esac ;;
I wondered whether it might have something to do with having .zip in the game name, but I have removed that, tested it and there is no change. I've also checked the code by replacing in the
*
class $Player1_AdvMame_Alt and $Player2_AdvMame_Alt with $Player1_AdvMame_Sim and $Player2_AdvMame_Sim and in that case it does work - both players can play simultaneously using separate joysticks mapped to the respective keys. That means that for some reason Mario Bros is defaulting to the*
class no matter what I do.There are no errors in the log either.
Could you please help me? Thank you.
-
@mediamogul Hi.
While testing I have narrowed down the problem to my definition of
TwoPlayerSim
by changing the code to the following:### Mario Bros Mario=""mario.zip"" advmame) case $rom in $Mario) # Configuration used only for these 2 Player Co-Operative / Simultaneous ROMs $xboxkill joycommand="$Player1_AdvMame_Sim & $Player2_AdvMame_Sim &" eval $joycommand ;; *) # Configuration for every other ROM in respect of this emulator including 2 Player "hotseating" ROMS $xboxkill joycommand="$Player1_AdvMame_Alt & $Player2_AdvMame_Alt &" eval $joycommand ;; esac ;;
The above code definitely works.
I'm just not sure what the problem is with
TwoPlayerSim
. -
I'm afraid I'm not going to be much help tonight. It was one dollar shots night down at the Regal Beagle. Plus, I overheard half of a conversation that makes me think my two roommates might have kidnapped our landlord, so I have to deal with that now. I'll take a closer look at this in the morning, but is 'Mario Bros.' the only game not working here, or are all the
TwoPlayerSim
titles not triggering? -
@mediamogul That's no problem at all - your roommates will probably need some assistance anyway burying your landlord's body. I'll play around with the code a bit later and see what eventuates.
-
@mediamogul Hi. I've now tested the code. It's definitely a problem with
TwoPlayerSim
. I've tested with The Punisher, Bubble Bobble and a couple of other games. The same thing happens - both Player 2's and Player 1's joysticks control Player 1, so all games are treated as though they fall into*
. For the sake of completeness, the runcommand.info for The Punisher is:mame-advmame advmame /home/pi/RetroPie/roms/mame-advmame/punisher.zip /opt/retropie/emulators/advmame/bin/advmame "punisher"
And the runcommand.log is:
Parameters: Executing: /opt/retropie/emulators/advmame/bin/advmame "punisher"
Nothing to report there. I'm hoping not to have to rewrite
TwoPlayerSim
from scratch as it took a couple of hours, but I can't see any obvious error in it.I've now figured out a bit more. If I add another game to my
Mario
definition as so, it no longer works:Mario=""mario.zip"|"bublbobl.zip""
So it appears to have something to do with the
"
or the|
.What's strange is that the same construction works perfectly for my 4-way setup
RestrictedArcadeGames
, as you know, and I basically copied and pasted from that to produceTwoPlayerSim
andMario
. I've gone back and checked that theRestrictedArcadeGames
still works and it does - Ms Pacman works perfectly - it's 4-way restricted.There's also definitely no problem with the carriage returns either.
-
So it appears to have something to do with the
"
or the|
.To further test your theory try:
Mario=""mario.zip"|"mario.zip""
-
@mediamogul Hi. Thanks. I copied your code and pasted it into my runcommand-onstart in case there was a problem at my end. Tried below and it does not work. It's a bit weird that this does not work.
Mario=""mario.zip"|"mario.zip""
I also tested 3 variations without success:
Mario='"mario.zip"|"mario.zip"'
Mario="'mario.zip'|'mario.zip'"
Mario=''mario.zip''|''mario.zip''
I thought it might have something to do with how advmame parses the rom name, but if it it works with
Mario=mario.zip
as it does, then that seems fairly unlikely. -
@spud11 said in Guide: Advanced Controller Mappings:
I also tested 3 variations without success:
Yeah, I threw together a similar setup to yours and tested test those as well. Perhaps it's something outside that particular case that is somehow interfering.
-
@mediamogul Yes, I was wondering that too. I'm not sure how to string together cases eg
case $2 in
andcase $1 in
in the one statement or even if it is possible.case $2 in
has worked very well for me so far.To test, I switched to
case $1 in
using themame-advmame
parameter and xboxdrv starts so that's working, but it makes no difference. Same result as before. -
Hey All, Have been following @spud11 adventure and would like to get advice on my runcommand-onstart to get it working with Amiberry. My wireless xpad360 works in game as normal but i cant get any special mapping to work. The file i'm using is below but I'm wondering if you can see any obvious errors please? This thread has already helped me to remove carriage returns from winscp so thumbs up to all.
#!/bin/sh ## Uncomment one or all of the following if you need to find some information about the emulator or roms ## Name of the emulator #echo $1 >> /dev/shm/runcommand.log ## Name of the software used for running the emulation #echo $2 >> /dev/shm/runcommand.log ## Name of the rom #echo $3 >> /dev/shm/runcommand.log ##Executed command line #echo $4 >> /dev/shm/runcommand.log ### The FUN begins #Get ROM name striping full path rom="${3##*/}" ### Set variables for your joypad and emulator ### Basic Configuraions - Standard controller mappings basicPS3="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >/dev/null \ --evdev /dev/input/by-id/usb-CMicrosoft_Xbox_360_Wireless_Receiver_for_Windows_E0E3B7A0-event-joystick \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --trigger-as-button \ --mimic-xpad-wireless \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_TL2=lt,BTN_TR2=rt,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_SELECT=back,BTN_START=start \ --calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767" ### Extended Configurations ### Specific emulator configuration or any other parameters you will need only for some emulators amiga="--axismap -Y1=Y1,-Y2=Y2 \ --buttonmap tl^toggle=tl \ --buttonmap tr^toggle=tr \ --ui-axismap tl+x1=REL_X:10,tl+y1=REL_Y:10 \ --ui-buttonmap tl+a=BTN_LEFT,tl+b=BTN_RIGHT \ --ui-buttonmap rt+a=KEY_ENTER,rt+b=KEY_ESC,rt+x=KEY_SPACE,rt+y=KEY_P,rt+du=KEY_UP,rt+dd=KEY_DOWN,rt+dl=KEY_LEFT,rt+dr=KEY_RIGHT \ --ui-buttonmap back+x=KEY_F12,back+start=KEY_Q \ --ui-buttonmap guide=void \ --ui-axismap x2=void" fourway="--four-way-restrictor" invert="--ui-buttonmap du=KEY_DOWN,dd=KEY_UP" ### Kill Command xboxkill="sudo killall >/dev/null xboxdrv" ### Execute the driver with the configuration you need # $1 is the name of the emulation, not the name of the software used # it is intellivision not jzintv case $1 in amiga) $xboxkill joycommand="$basicPS3 $amiga &" eval $joycommand ;; esac
My last log said:
>/dev/null: No such file or directory Parameters: Executing: /opt/retropie/emulators/amiberry/amiberry.sh auto "/home/pi/RetroPie/roms/amiga/Fantasy World Dizzy.uae" Amiberry v2.1.1, by Dimitris (MiDWaN) Panokostas and Olly Aigner Based on previous work by Chips and TomB (Pandora) Joystick 0 : Xbox 360 Wireless Receiver Buttons: 17 Axis: 4 Hats: 1 starting sound thread.. stopping sound thread.. ~ xboxdrv: no process found
-
Hey All, I have found out that i needed to add a copyright symbol in front of the word microsoft to get it working! Any tips on improvements welcome though.
--evdev /dev/input/by-id/usb-©Microsoft_Xbox_360_Wireless_Receiver_for_Windows_E0E3B7A0-event-joystick \
-
@GreenRebel Hi. I can't say I have any expertise in these things as that is why I spend so much time trying to sort things out with mediamogul!
But I'd suggest removing:
sudo killall >/dev/null xboxdrv
and replace it with:
sudo killall xboxdrv
Do the same for the
basicPS3
code too:basicPS3="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
At this stage, while testing, it's best not to suppress messages from xboxdrv. Also, I think when you are ready to put the code back in, it should be as follows:
sudo killall > /dev/null 2>&1 xboxdrv
And:
basicPS3="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
Also, I always give the joystick an easy to identify name eg "Player_1" (I've got 4 controllers):
--device-name "Player_1" \
One of the reasons for doing this is that, if you are configuring your controller so that it mimics a keyboard, then you need the following:
SUBSYSTEM=="input", ATTRS{name}=="Player_1", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
This line goes in a file called
99-xboxdrv
in folder/etc/udev/rules.d/
You will see that the
Player_1
is the same as the name of my controller. -
@mediamogul Hi. Finally, after tinkering for the past 3 days, I've got the code to work. I haven't completely tested it yet, but Mario Bros (a 2 player simultaneous/co-op game) is mapped correctly so that Player 1 and Player 2 are using separate joysticks and Black Tiger (a 2 player alternate game) maps Player 2's joystick to Player 1's keys. No more changing seats!
The extracted code (with the formatting gone a bit awry) is as follows:
#!/bin/sh rom="${3##*/}" Player1_AdvMame_Sim="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \ --device-name "Player_1" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \ --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \ --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC" Player2_AdvMame_Sim="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \ --device-name "Player_2" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \ --ui-axismap X1=KEY_D:KEY_G,Y1=KEY_R:KEY_F \ --ui-buttonmap a=KEY_A,b=KEY_S,x=KEY_Q,y=KEY_W,back=KEY_6+KEY_2,start=KEY_UNKNOWN,back+start=KEY_SPACE+KEY_ESC" Player1_AdvMame_Alt="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \ --device-name "Player_1" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=x,BTN_THUMB=y,BTN_THUMB2=a,BTN_PINKIE=b,BTN_BASE3=back,BTN_BASE6=start \ --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \ --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC" Player2_AdvMame_Alt="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --silent \ --detach-kernel-driver \ --deadzone=4000 \ --deadzone-trigger 15% \ --force-feedback \ --mimic-xpad \ --trigger-as-button \ --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.1:1.0-event-joystick \ --device-name "Player_2" \ --evdev-absmap ABS_X=y1,ABS_Y=x1 \ --evdev-keymap BTN_TRIGGER=y,BTN_THUMB=a,BTN_THUMB2=back,BTN_PINKIE=x,BTN_TOP=b,BTN_TOP2=start \ --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \ --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,back=KEY_5+KEY_1,start=KEY_6+KEY_2,back+start=KEY_SPACE+KEY_ESC" xboxkill="sudo killall xboxdrv" case $2 in advmame) case $rom in "aerofgt.zip"|"aerofgtb.zip"|"aerofgtc.zip"|"sonicwi2.zip"|"sonicwi3.zip"|"alien3.zip"|"avspu.zip"|"aliens.zip"|"alpham2.zip"|"altbeast.zip"|"altbeas2.zip"|"altbeas4.zip"|"altbeas5.zip"|"altbeaj1.zip"|"altbeaj.zip"|"altbeaj3.zip"|"androdun.zip"|"armwar.zip"|"baddudes.zip"|"batcir.zip"|"btoads.zip"|"bnzabros.zip"|"bublbobl.zip"|"bublbobr.zip"|"bublbob1.zip"|"bublbob2.zip"|"bubblebobbleultra.zip"|"bubblem.zip"|"bubsympe.zip"|"bubsymph.zip"|"bubsympu.zip"|"burnforc.zip"|"burnfrco.zip"|"burningf.zip"|"burningh.zip"|"dino.zip"|"dinoj.zip"|"dinou.zip"|"captaven.zip"|"captavna.zip"|"captavne.zip"|"captavnj.zip"|"captavnu.zip"|"captavuu.zip"|"captcomm.zip"|"captcomu.zip"|"captcomj.zip"|"cawing.zip"|"cawingj.zip"|"cawingr1.zip"|"cawingu.zip"|"edrandy.zip"|"edrandy1.zip"|"edrandyj.zip"|"ctribe.zip"|"ctribeb.zip"|"contra.zip"|"contrab.zip"|"contraj.zip"|"contrajb.zip"|"crimfght.zip"|"crimfgt2.zip"|"crimfgtj.zip"|"crsword.zip"|"darius.zip"|"darius2.zip"|"darius2d.zip"|"dariuse.zip"|"dariusg.zip"|"dariusgj.zip"|"dariusgu.zip"|"dariusgx.zip"|"dariusj.zip"|"dariuso.zip"|"diehard.zip"|"ddrgn2u.zip"|"ddrgnw1.zip"|"ddrago3b.zip"|"ddragon.zip"|"ddragon2.zip"|"ddragon3.zip"|"ddragonb.zip"|"ddragonu.zip"|"ddragonw.zip"|"ddsom.zip"|"ddsoma.zip"|"ddsomj.zip"|"ddsomjr1.zip"|"ddsomr1.zip"|"ddsomr2.zip"|"ddsomu.zip"|"ddsomur1.zip"|"ddtod.zip"|"ddtoda.zip"|"ddtodh.zip"|"ddtodj.zip"|"ddtodjr1.zip"|"ddtodr1.zip"|"ddtodu.zip"|"ddtodur1.zip"|"dynamcop.zip"|"dynwar.zip"|"dynwarj.zip"|"exedexes.zip"|"ffight.zip"|"ffightj.zip"|"ffightj1.zip"|"ffightu.zip"|"ffightua.zip"|"gdarius.zip"|"gdarius2.zip"|"gdariusb.zip"|"gground.zip"|"gaun2pg1.zip"|"gaun2pg2.zip"|"gaun2pr3.zip"|"gaun22p1.zip"|"gaun22pg.zip"|"gaunt2.zip"|"gaunt2g.zip"|"gaunt2p.zip"|"gaunt2pg.zip"|"gaunt2pj.zip"|"gaunt22p.zip"|"gauntdl.zip"|"gauntg.zip"|"gauntgr3.zip"|"gauntgr6.zip"|"gauntgr8.zip"|"gauntj.zip"|"gauntj12.zip"|"gauntr1.zip"|"gauntr2.zip"|"gauntr4.zip"|"gauntr5.zip"|"gauntr7.zip"|"gauntr9.zip"|"gpilots.zip"|"gokuparo.zip"|"goldnax1.zip"|"goldnax2.zip"|"goldnax3.zip"|"goldnaxe.zip"|"goldnaxj.zip"|"goldnaxu.zip"|"ga2.zip"|"ga2j.zip"|"ga2u.zip"|"mt_gaxe.zip"|"mt_gaxe2.zip"|"gwar.zip"|"gwara.zip"|"gwarb.zip"|"gwarj.zip"|"hbarrel.zip"|"hbarrelw.zip"|"iceclimb.zip"|"iceclmbj.zip"|"iceclmrj.zip"|"joust.zip"|"joustr.zip"|"joustwr.zip"|"knights.zip"|"knightsj.zip"|"knightsu.zip"|"lresort.zip"|"lwings.zip"|"lwings2.zip"|"lwingsjp.zip"|"lifefrce.zip"|"lifefrcj.zip"|"mario.zip"|"mariojp.zip"|"mslug.zip"|"mslug2.zip"|"mslug3.zip"|"mslug3b6.zip"|"mslug3n.zip"|"mslug4.zip"|"mslug5.zip"|"mslugx.zip"|"mwalk.zip"|"mwalkbl.zip"|"mwalkj.zip"|"mwalku.zip"|"nbbatman.zip"|"gaiden.zip"|"progear.zip"|"progeara.zip"|"progearj.zip"|"punisher.zip"|"punishrj.zip"|"punishru.zip"|"rampage.zip"|"rampage2.zip"|"rmpgwt.zip"|"rmpgwt11.zip"|"robocop2.zip"|"robocp2j.zip"|"robocp2u.zip"|"rtypeleo.zip"|"rtypelej.zip"|"salamand.zip"|"salamanj.zip"|"salamndr2.zip"|"sengokh.zip"|"sengokmj.zip"|"sengoku.zip"|"sengoku2.zip"|"sengoku3.zip"|"sexyparo.zip"|"shocktro.zip"|"shocktr2.zip"|"sscope2.zip"|"simpsn2p.zip"|"skullfng.zip"|"skykid.zip"|"skykidd.zip"|"skykiddo.zip"|"skykiddx.zip"|"smashtv.zip"|"smashtv4.zip"|"smashtv5.zip"|"smashtv6.zip"|"spclorda.zip"|"spclordb.zip"|"spclordg.zip"|"spclords.zip"|"spidman.zip"|"spidmanu.zip"|"streetsm.zip"|"streets1.zip"|"streetsj.zip"|"streetsw.zip"|"ssriders.zip"|"scobra.zip"|"scobrab.zip"|"scobras.zip"|"scobrase.zip"|"tmnt.zip"|"tmnt2.zip"|"tmnt2a.zip"|"tmnt2pj.zip"|"tmnt2po.zip"|"tmnt22p.zip"|"tmntj.zip"|"tmntu.zip"|"tmntua.zip"|"timecrs2.zip"|"twinbee.zip"|"unsquad.zip"|"vendet2p.zip"|"viostorm.zip"|"viostrma.zip"|"viostrmj.zip"|"viostrmu.zip"|"vcop.zip"|"vcop2.zip"|"wof.zip"|"wofa.zip"|"wofj.zip"|"wofu.zip"|"wow.zip"|"xmen.zip"|"xenophob.zip") # Configuration used only for these 2 Player Co-Operative / Simultaneous ROMs $xboxkill joycommand="$Player1_AdvMame_Sim & $Player2_AdvMame_Sim &" eval $joycommand ;; *) # Configuration for every other ROM in respect of this emulator including 2 Player "hotseating" ROMS $xboxkill joycommand="$Player1_AdvMame_Alt & $Player2_AdvMame_Alt &" eval $joycommand ;; esac ;;
-
Nice! What was the problem?
-
@mediamogul It appears that advmame didn't like me defining the roms eg
$TwoPlayerSim
. It would only work if the roms were actually listed in the code itself as I've now done. The additional"
in conjunction with the|
seemed to mess things up. -
Glad to see you got it working.
I can't say I have any expertise in these things
Sure you can. Your setup is now quite a bit more complex than mine and you're keeping the wheels on the tracks nicely.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.