Guide: Advanced Controller Mappings
-
@spud11 said in Guide: Advanced Controller Mappings:
I copied and pasted the text and it worked as intended
That's one less potential cause. Now, make a backup of
runcommand-onstart.sh
if you need to and then clear the original completely except for:#!/bin/sh if [ "$1" = "amiga" ] then sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.2.3:1.0-event-joystick \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --trigger-as-button \ --mimic-xpad \ --device-name "Amiga Joystick Player 1 (xboxdrv)" \ --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-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ & fi
-
@pjft said in Guide: Advanced Controller Mappings:
I was wondering if anyone would already have such mappings of PS3-controller-to-keyboard for these games
I've never seen anyone discussing those particular games, but somewhere in this thread, there's a guy who mapped his PS3 controller and detailed it. You could knock off a few steps by cannibalizing his command and just add in the keys you want. It's probably best to start from scratch so that all the steps are accountable, but even then, it could still be used as a good reference.
-
@mediamogul thanks. I'll probably do it from scratch then, just need to find the time :)
I'll post any updates and likely all the questions when I run into difficulties.
-
@pjft You can find an xboxdrv config here that I use to map my PS3 controller in ROTT, a source port of Rise of the Triad.
It differs slightly from the PS3 controller example given in the xboxdrv repo. In my case, the PS button, or
guide
in xboxdrv, is mapped toKEY_#704
whereas in the xboxdrv example, it's mapped toKEY_#720
. My controller is model number CECHZC1E, one of the original SIXAXIS controllers. If you have a newer model, thenKEY_#720
may be the correct mapping. -
@mediamogul Thanks. I've added the code to the runcommand-onstart.sh but it had no effect. A copy of the runcommand.log appears below:
/opt/retropie/configs/all/runcommand-onstart.sh: line 2: $'\r': command not found /opt/retropie/configs/all/runcommand-onstart.sh: line 18: syntax error near unexpected token `&' /opt/retropie/configs/all/runcommand-onstart.sh: line 18: `& ' Parameters: Executing: pushd /opt/retropie/emulators/uae4arm/; ./uae4arm -config="/home/pi/RetroPie/roms/amiga/Alien Breed Special Edition '92.uae" /opt/retropie/emulators/uae4arm /opt/retropie/supplementary/runcommand Amiberry build 2017-01-08, by Dimitris (MiDWaN) Panokostas and Olly Aigner Based on previous work by Chips and TomB (Pandora) Joystick 0 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 Joystick 1 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 Joystick 2 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 Joystick 3 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 starting sound thread.. stopping sound thread.. xboxdrv: no process found
-
Line 2 & 18 seem to be the problem. Making sure that
runcommand-onstart.sh
is still identical to that last time you launched it, post it's contents and let's have a look. -
@mediamogul Thanks for your quick reply. Here it is:
#!/bin/sh if [ "$1" = "amiga" ] then sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.2.3:1.0-event-joystick \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --trigger-as-button \ --mimic-xpad \ --device-name "Amiga Joystick Player 1 (xboxdrv)" \ --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-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ & fi
Line 2 is the blank line and line 18 is the &. I'm using Notepad ++ which gives line numbers so it is clear.
-
Line 2 is the blank
In a shell script, the first line is reserved for
#!/bin/sh
, making the second line count as the first and so on. That said, the errors you're getting still aren't jibing with the command given. The only thing I can think of is that Notepad++ may be formatting things unexpectedly. In the command line try:nano /opt/retropie/configs/all/runcommand-onstart.sh
From there, look to see if anything is out of place in line 2 & 18 by comparison. If it is, you'll either want to use another text editing program or see if notepad++ can support 'UNICODE UTF-8' through a setting.
-
Thanks for checking, i really appreciate it.
I need to dedicate some time to looking at emulating keyboard input for daphne, as i think that is going to be the answer.
Chris
-
@Chillimonster That's no problem at all. I think you're right - it's likely to be the keys that wind up making the difference. I reckon it'll be more than a week before I start testing Daphne (you've sparked my interest again in getting it working), so if you do get it working, could you please post your config here?
-
@mediamogul said in Guide: Advanced Controller Mappings:
nano /opt/retropie/configs/all/runcommand-onstart.sh
Hi mediamogul.
I've now checked Notepad++ and it is using Unicode UTF-8. I've looked at the code using nano too and removed line 27 which was blank. There doesn't appear to be anything else that stands out. The code appears to be correct and I've tested again and it doesn't work.
Given that line 2 is actually line 1, the error
$'\r'
looks like it relates to"$1"
- that is, it can't find or identify the"amiga"
system for whatever reason.I can't help but feel it's got something to do with my amiga setup which has individual .uae configs for each game (as per the Amiga wiki but using hard drives for each game, not floppy disks), but could be wrong.
I've previously tried some of the other
$
commands. Maybe that is the way to go?Or I wonder if there might be some other file that I've changed that is affecting things. I recall somewhere reading that there was another file that might require changing and I made that change. Can't find what it was now.
Or maybe one way to test things is just to replace
"amiga"
with another random system and see if it works for other systems. That would at least rule out that there is an inherent problem with the code. -
I can't help but feel it's got something to do with my amiga setup which has individual .uae configs for each game
That very well could be. Launch another game the way you have been, then post the contents of
/dev/shmruncommand.info
. -
Okay, thanks. I tried another Amiga game with the same outcome, and once again it doesn't like the
&
(or&
andfi
) at the end:/opt/retropie/configs/all/runcommand-onstart.sh: line 2: $'\r': command not found /opt/retropie/configs/all/runcommand-onstart.sh: line 18: syntax error near unexpected token `&' /opt/retropie/configs/all/runcommand-onstart.sh: line 18: `& ' Parameters: Executing: pushd /opt/retropie/emulators/uae4arm/; ./uae4arm -config="/home/pi/RetroPie/roms/amiga/Alien Drug Lords.uae" /opt/retropie/emulators/uae4arm /opt/retropie/supplementary/runcommand Amiberry build 2017-01-08, by Dimitris (MiDWaN) Panokostas and Olly Aigner Based on previous work by Chips and TomB (Pandora) Joystick 0 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 Joystick 1 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 Joystick 2 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 Joystick 3 : DragonRise Inc. Generic USB Joystick Buttons: 12 Axis: 4 Hats: 1 starting sound thread.. stopping sound thread.. xboxdrv: no process found
Also, I found the other change to which I have referred in my previous comment which I made after following the guide:
sudo nano /etc/udev/rules.d/99-xboxdrv.rules
SUBSYSTEM=="input", ATTRS{name}=="Microsoft X-Box 360 pad - Keyboard Emulation", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"
-
I actually need to see the contents of
/dev/shm/runcommand.info
. Make sure of course that you have just previously launched a game. -
@mediamogul Oh, sorry. I missed that it was the info file, not the log file, you wanted to see. Will send after I get home from work. Thanks.
-
Not a problem.
-
Of course i will.
I'll try and get some time on it over weekend and update the thread accordingly
-
@mediamogul Sorry about the delay. Wound up not getting home to very late. Here is the runcommand.info file:
amiga uae4arm /home/pi/RetroPie/roms/amiga/Alien Breed Special Edition '92.uae pushd /opt/retropie/emulators/uae4arm/; ./uae4arm -config="/home/pi/RetroPie/roms/amiga/Alien Breed Special Edition '92.uae"
Does this correspond to the "$" inputs 1, 2, 3, 4?
-
@Chillimonster Thanks!
-
@spud11 said in Guide: Advanced Controller Mappings:
Does this correspond to the "$" inputs 1, 2, 3, 4?
It does and I was hoping to see something wrong here that would explain your issues, but everything seems to be in order. I won't lie, I'm starting to run out of ideas here myself. One thing you can try is to add:
#!/bin/bash sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.2.3:1.0-event-joystick \ --silent \ --detach-kernel-driver \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --trigger-as-button \ --mimic-xpad \ --device-name "Amiga Joystick Player 1 (xboxdrv)" \ --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-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \ &
to it's own separate script and in turn launch it from
runcommand-onstart.sh
with:if [ "$1" = "amiga" ] then sh /path/to/new/script.sh fi
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.