PiSNES Unsupported DPAD Fix (for xboxdrv)

After many many many hours of messing around I have found a workaround to get a D-Pad working on PiSNES

I tried keyboard emulation and a few other things (including looking at the source code – there is no DPAD support in this compile of the SNES9X code) but I got it working with something super simple.

This fix is for joysticks that have analong sticks, it would seem that within PiSNES you can only assign two axis to the joystick config (in the config file).

These are set as 0 and 1. If the driver is setup for –dpad-only mode then the dpad gets assigned as the first joystick.
This does mean that your analog sticks will be disabled and you will be unable to use them, which I’m fine with.

The Fix

If you are using xboxdrv then you need to add this command when the program executes.


If you use retropie then you may need to edit your boot file which is located at /etc/rc.local, then look for something like this –

As a note, this is my config file so yours may be different,

#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
 printf "My IP address is %s\n" "$_IP"

# shutting down xpad
sudo rmmod xpad &
sleep 1

# - xbox driver -

sudo xboxdrv --dpad-only --daemon --id 0 --deadzone 4000 --silent --trigger-as-button --dbus disabled --detach-kernel-driver &
sleep 1

exit 0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s