Guide: Advanced Controller Mappings
-
@dudleydes said in Guide: Advanced Controller Mappings:
It may be an idea to create a repo on Github, like the one @Jon_Ge posted above, to collect configurations specific to RetroPie, maybe by controller and by emulator.
That would be most keen.
-
Hi mediamogul,
first thing, WOW, what an amazing guide, i was fine tuning my retropie to make it work the way i want, but i wasn't able to configure scummVM to use the joypad in a correct way.
With your guide i was able make it work correctly like it work with my mouse and keyboard.
But, there is always a but,
when i start scummVM the joypad is recognized correctly and it's working very well, but it seems it doesen't load the scummvm.ini, because all the configuration i have made and my game list are disappeared.
I'm using Retropie 4.0.2 with ScummVM ver 1.8.1pre
My +Start ScummVM.sh look like this:#!/bin/bash game="$1" pushd "/home/pi/RetroPie/roms/scummvm" >/dev/null sudo killall >/dev/null xboxdrv sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ >/dev/null \ --evdev /dev/input/event2 \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --dpad-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \ --evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \ --calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \ --ui-axismap x1=REL_X:10,y1=REL_Y:-10 \ --ui-buttonmap b=BTN_LEFT,a=BTN_RIGHT,start=KEY_F5 \ --ui-buttonmap guide=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \ --ui-axismap x2=void \ -- \ /opt/retropie/emulators/scummvm/bin/scummvm --fullscreen --joystick=0 --extrapath="/opt/retropie/emulators/scummvm/extra" $game while read line; do id=($line); touch "/home/pi/RetroPie/roms/scummvm/$id.svm" done < <(/opt/retropie/emulators/scummvm/bin/scummvm --list-targets | tail -n +3) popd >/dev/null
If instead of
-- \
i use-- &
, ScummVM start with the correct configuration and game list, the joypad is working correctly, but when i quit ScummVM, the Joypad isn't working anymore in Emulationstation.
I solved adding sudo killall >/dev/null xboxdrv as last line but i don't know if it's a good way.
What do you think i made it wrong in my configuration ?
Thank you for any help. -
By adding the
&
, you have separated the command in two. First it launches your xboxdrv configuration and then it launches ScummVM as a separate process. For xboxdrv to tear itself down after the emulator quits, it all has to be in the same command, meaning that your xboxdrv config launches ScummVM as a part of itself and is therefore aware when it quits.I believe I know where the problem is. I think you may have either skipped over the step that allows uninput to run at the user lever, or you still have
sudo
attached to the beginning of your xboxdrv command. Either way, it's important that the command run at the user level and not the root user, which has no config preferences for any of the emulators. -
Thank you very much, you were absolutely right, i've made the step that allows uninput to run at user level but i forgot to remove
sudo
at the beginning of the command.
Now it works perfectly.
Thank you very much. -
I'm glad it's working. Tell Threepwood he fights like a dairy farmer.
-
How appropriate! I fight like a cow! :D
Thank you again.
-
For anyone interested, I posted an example of an Atari800/5200 mapping here.
-
@mediamogul you have been making an epic tutorial here...
I d love to see a 4way restrictions tutorial for games like PacMan in FBA and ΜΑΜΕ
-
I'm glad it's been helpful. Restricting the direction to four ways can be done by just adding the variable line below to any xboxdrv command. I've been meaning to edit the first section to make mention of it, but I'll post it here also.
--four-way-restrictor
If you're formatting the command the way I've been illustrating so far, you'd of course add a space and backslash afterward to allow a carriage return to the next line:
--four-way-restrictor \
The difference this makes when playing something like 'Pac-Man' or 'Burger Time' is huge and allows for a much tighter and more authentic control scheme.
-
@mediamogul Sorry for the possible silly post that follows :)
So...lets say my rom is called pacman.zip
If I create a pacman.zip.cfg file that contains only
--four-way-restrictor
and put it where my roms are, will be enough?
-
I'm afraid not. It can be added to any xboxdrv command, but it's exclusive to xboxdrv. I was a bit unclear in my wording above. I'll change for posterity.
-
@mediamogul I think that I am on xboxdrv. How can I check that it is working? (except from playing experience)
-
You can check to see if you've installed it previously by going into RetroPie-Setup > Manage Packages > Manage Driver Packages. It will read "installed" next to the xboxdrv entry.
-
Hello again mediamogul,
i'm here again begging for your help.
I'm trying to switch the mouse control from the left stick to the right stick, so i change the configuracion from--ui-axismap x1=REL_X:10,y1=REL_Y:-10
to--ui-axismap x2=REL_X:10,y2=REL_Y:-10
but it doesen't seems to work correctly, i can use the right stick just to move left and right but not up and down, and the left stick is still active but doesen't move the pointer, just make it disappear like if it is going out of the screen.
My full configuration is the followingsudo killall >/dev/null xboxdrv /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ >/dev/null \ --evdev /dev/input/event2 \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 1000 \ --mimic-xpad \ --dpad-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \ --evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \ --calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \ --ui-axismap x2=REL_X:10,y2=REL_Y:-10 \ --ui-buttonmap b=BTN_LEFT,a=BTN_RIGHT,start=KEY_F5,back=KEY_ESC,y=KEY_SPACE \ --ui-buttonmap guide=void,x=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \ -- \
Do you think you can help me?
Please :) -
Everything looks to be correct at face value. I just tried switching one of my own mouse maps over to the right thumbstick and it worked. It could be that
ABS_RZ=y2
is incorrectly mapped on the--evdev-absmap
line. Perhaps the Y2 axis has a different ABS name other than RZ. You might try retracing your steps there. -
Doh!, me dumb, you are absolutely right,
ABS_RZ
is wrong, the correct one isABS_RX
. Now the right stick is working correctly, the strange thing is that the left stick still acting strange making the pointer disappear. Adding--ui-axismap x1=void,y1=void
at the bottom of my configuration doesen't change anything.
Any other advise ? -
That is strange. So, the left stick makes the cursor disappear when nudged? Does it disappear for good? Since, you've already tried voiding it, you could try mapping it to an unused key to see how it behaves. Something like
--ui-axismap x1=KEY_HOME:KEY_HOME,y1=KEY_HOME
would be worth trying. Also, not mapping the left stick at all under--evdev-absmap
might give you the desired effect as well. -
@mediamogul
Thank you for your fast reply, it seems to disappear when i move the left stick and reappear always at the top left when i move back to center.
Yes you are right, if i map the left stick to--ui-axismap x1=KEY_LEFT:KEY_RIGHT,y1=KEY_DOWN:KEY_UP
stop acting strange and work like the arrow keys.
You are also right, if i don't map the left stick under--evdev-absmap
it disable the left stick.
I will use one of the solution as a workaround but i will try to investigate futher on why is acting like this.
Thank you very much -
Hello again,
i have another questions about joypad configuration for individual emulators.
For emulators that start using a shell script like scummVM and amiga it's easy, but for others emulators like for example jzintv what should i do?
The emulators.cfg isjzintv="/opt/retropie/emulators/jzintv/bin/jzintv -p /home/pi/RetroPie/BIOS -q %ROM%" default="jzintv"
I should create a shell script like scummVM and change emulators.cfg to point the the script or there is an easy way ?
Thank you for any help. -
There's really no one right answer to that. Sometimes you can just add the xboxdrv command to the emulators.cfg and others by pointing to a shell script.
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.