Guide: Advanced Controller Mappings
-
@mediamogul Thanks. Once I get home from work in a few hours, I'll do the commandline thing and let you know. Thanks, again.
-
As you have a dragonrise encoder you could be the very person to help me with my issues (and lack of knowledge)
Does yours now work ok with Daphne (My main, and currently, only issue)?
-
@Chillimonster Hi. I did have it working at one point, but on one of my other Raspberry Pi's. Sorry, but I haven't got it installed on the current Pi. I'll have a look - either install it on the current Pi and try it out with both xpad and xboxdrv or dig out the old Pi and see what settings I've got on it. (My recollection with the "old" Pi is that I had installed xboxdrv to work exclusively across all emulators).
-
@mediamogul I copied and pasted the text and it worked as intended:
xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/ Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmail.com> Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details. Your Xbox/Xbox360 controller should now be available as: /dev/input/js4 /dev/input/event10 Press Ctrl-C to quit
-
@Chillimonster Hi. I just fired up the old Pi that has another DragonRise attached to it with xboxdrv installed, and have discovered that in fact this joystick is not working with Daphne. I do have Dragon's Lair installed, but I've tested it a minute ago and there's no joystick input at all. It just runs through the attract mode.
I went back to my notes (I keep copious notes of how I got things working) and it turns out in my "to do" list I had Daphne/DragonRise/xboxdrv on my list of things to get working, but it appears I didn't get round to it.
I have in the meantime built another RetroPie system, but haven't yet installed Daphne on this new one. I'm currently working on the Amiga and a couple of other systems, but will get to Daphne at some point, especially as I have clearly not got it working before. Sorry about that. I'm assuming that you've exhausted efforts with the xpad driver too.
-
Wow.
Only now am I starting to look into xboxdrv , in particular because I've always used the standard PS3 controllers and haven't felt the need for this until I am now trying to set up the GameMaker ports for SuperCrateBox, They Need to be Fed, Maldita Castilla.
I will certainly go through the extremely detailed tutorial and all the threads where @mediamogul and the rest of the community are sharing their guidance and make things happen on my own, but I was wondering if anyone would already have such mappings of PS3-controller-to-keyboard for these games, and the runcommand-xxx changes for these particular ports. :)
Doesn't hurt to ask. I will certainly take a look at it on my own afterwards and share any results I come up with. It's just I haven't had a lot of free time at home so any head start would be helpful.
Thanks!
-
@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.
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.