PPSSPP Controller Setup Guide for when nothing else works
-
This is a Guide to setup your gamepad controller to work in the PPSSPP emulator if it doesn't work correctly automatically, and the normal PPSSPP controller settings (run a ROM, press ESC, go to Settings > Controls > Control mapping) also doesn't work as it should.
The list of compatible controllers for the PPSSPP emulator is defined in the file
gamecontrollerdb.txt
, that is located in the folder/opt/retropie/emulators/ppsspp/assets/
.This file originates from the tool
controllermap
, which is part of SDL2, a programming development library that provides low level access to audio, keyboard, mouse, joystick and graphics hardware via OpenGL.Therefore this guide aims to give a step by step tutorial of how to first get the
controllermap
tool, second use it to create the specific configuration text line for your gamepad, and third add this line to thegamecontrollerdb.txt
file.Note that this guide uses SDL version 2.0.7, which currently is its most up to date release, but a newer version of SDL2 may have been released by the time you are reading this, in that case you can get the updated download link for the Source Code in the official webpage libsdl.org (download page: http://libsdl.org/download-2.0.php ). OBS: Get the link for the Source Code file with .tar.gz as extension to use in step 1.2 of this guide, and remember to use the new correct version number in the following steps of the guide, instead of 2.0.7.
Tutorial
All the steps use the linux terminal to run commands, and you can access it by pressing F4 to quit Emulation Station, or use the terminal in a desktop environment you have installed.
-
Get SDL2 and compile
controllermap
1.1.cd /home/pi/RetroPie-Setup/tmp/build/
1.2.wget http://libsdl.org/release/SDL2-2.0.7.tar.gz
1.3.tar -zxvf SDL2-2.0.7.tar.gz
1.4.cd SDL2-2.0.7/test
1.5../configure
1.5.make controllermap
-
Copy
controllermap
to its own folder (Optinal: Only if you want to keepcontrollermap
for possible future uses)
2.1.cd /home/pi/RetroPie-Setup/tmp/build/
2.2.mkdir controllermap
2.3.cp ./SDL2-2.0.7/test/controllermap ./controllermap/
2.4.cp ./SDL2-2.0.7/test/*.bmp ./controllermap/
2.5.cd ./controllermap/
-
Connect the gamepad to your Raspberry Pi
-
Run
controllermap
4.1. type./controllermap
to run it- Assuming you are in the correct folder that has the
controllermap
compiled executable (which you should whether you chose to follow Step 2 or not) this should work and show info about the connected gamepad, including the info showing the Joystick (= your gamepad) number.
4.2.
./controllermap 0 > out.txt
- Where 0 is the Joystick number, so change it as necessary to fit your situation.
- You should see an illustration of a gamepad on the screen now. IF YOU DON'T, JUST PRESS ESC TO EXIT. Check the error log, you must be missing some image files (bmp files).
4.3. Press your controller's equivalent of the highlighted buttons on the screen.
- If you want to skip a button, press the spacebar.
- If you make a mistake press backspace to go back, or Esc to exit and just run Step 4.2 again as many times as necessary to get it right.
- The results will be saved to a text file
out.txt
in the current folder. Typecat out.txt
to check it, the result should be something like this:
- Assuming you are in the correct folder that has the
030000006d040000d1ca000011010000,PS3/USB Corded Gamepad,platform:Linux,a:b1,b:b2,x:b0,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,
-
Add your gamepad config to the
gamecontrollerdb.txt
file
5.1.sudo bash -c 'cat ./out.txt >> /opt/retropie/emulators/ppsspp/assets/gamecontrollerdb.txt'
- PAY ATTENTION TO USE THE CORRECT APPEND SYMBOL
>>
(double "bigger than" characters), OR YOU MAY MESS UP THEgamecontrollerdb.txt
FILE. If that is a big concern for you, you may want to make a copy of thegamecontrollerdb.txt
file as backup before this Step. - This will append the text content of
out.txt
to the end of the filegamecontrollerdb.txt
. - Alternatively, you can also do it manually by opening each file in the text editor of your choice (nano, vi, leafpad, etc), and using copy and paste to add the line from the
out.txt
file to thegamecontrollerdb.txt
file. - At any time you can use the command
sudo nano /opt/retropie/emulators/ppsspp/assets/gamecontrollerdb.txt
to see or edit its contents, and check if everything is ok.
- PAY ATTENTION TO USE THE CORRECT APPEND SYMBOL
-
You may now remove the SDL2 source code and object files:
6.1.cd /home/pi/RetroPie-Setup/tmp/build/
6.2.rm -r SDL2-2.0.7
6.3.rm SDL2-2.0.7.tar.gz
-
You should be ready to go. Go back to Emulation Station and have fun with PPSSPP!
- Just type
emulationstation
to get back if you exited it with F4 to get to the terminal. - If somehow you still run into problems try going to the internal PPSSPP controller settings (run a ROM, press ESC, go to Settings > Controls > Control mapping) and Reset the settings to the original configuration, or even use it to configure the buttons again one by one, now it should work as expected.
- Just type
All credits for this solution goes to @Larkas, who posted his solution to this issue here:
https://retropie.org.uk/forum/post/116309 -
-
@isrnick As I mentioned on reddit, I got "-Bash: permission denied" on the sudo cat step. I c+p the out.txt file from within nano editor as you suggested and it worked just fine. Thoughts on why it denied permission to cat?
-
@atg77 I didn't take into account that the redirection
>>
is processed beforesudo
, so it wouldn't have permission to access the file. I changed that Step now, to take that into account, and tested it to make sure that it works, so now it will work correctly simply following that Step. Thank you for reporting this error. -
Is it even possible to use touchscreen buttons in Raspberry Pi and Retropie?
-
Ive been trying to get this to work using SDL2-2.0.8, but get the following error when trying make controllermap
make: *** No rule to make target 'controllermap'. Stop.
Any ideas?
-
Hi,
I am having issues with the controller mapping in PPSSPP in my Piboy DMG, and trying the steps described in this post I got stuck at 1.5. "make controllermap"It seems there is an issue with the left D-pad command in my controllerdb file. Is anyone having the same issue by any chance?
Here is the message displayed:
-
You're using a much newer libSDL2 than what RetroPie includes and it's not compatible with the newer controllermap. Use libSDL 2.0.10 and compile the
controllermap
from thetest
folder. -
Hi I'm hoping you can help me.
I get as far as the
/controllermap 0 > out.txt
then get a white screen. I pressed escape and chekced the errors as suggested. It appears I am missing 3.bmp
images (axis, button and controllermap).This guide and the one linked just says to fetch the images from
SDL2-2.0.6/test/
folder. How exactly do I do this? I have little to no experience with Linux and have been racking my brain trying to get my controller to work with PPSSPP. Do I use some sort ofcp./
command?I'm using a rpi 4 2GB RAM with v4.7.1 image and a Gioteck VX3 Wireless PS3 Controller
Any help would be greatly appreciated. I know I'm getting babied through this but I have tried googling linux functions and I am struggling. Thanks
-
@retrobadger Did you try to configure your controller in PPSSPP, from its menu ? You didn't add any info about what kind of controller you have, RetroPie version,etc.
-
@mitu
Hi there,Yes I tried to configure my controller in PPSSPP menu, it does not work properly and won't recognize certain buttons (most notably the directional buttons)
I did include info about the controller I have it's a Gioteck VX3 Wireless PS3 Controller
I did include info about retropie version. It's v4.7.1
I'm using a 128 gb SD card with Retropie v 4.7.1 flashed using the retropie imager from here https://www.raspberrypi.org/software/
I am using an official 5.1V at 3A power supply
Would you be able to point me in the right direction in terms of copying over those .bmp files to the right place using linux commands.
Thanks,
-
@retrobadger You can download them directly from the project's page. Make sure you're in the same folder where the executable is placed and run:
wget https://github.com/libsdl-org/SDL/raw/main/test/controllermap_back.bmp wget https://github.com/libsdl-org/SDL/raw/main/test/controllermap.bmp wget https://github.com/libsdl-org/SDL/raw/main/test/axis.bmp wget https://github.com/libsdl-org/SDL/raw/main/test/button.bmp
-
@mitu
Thanks this worked!Finally got my controller to work with PPSSPP
-
@retrobadger Glad it worked.
-
@mitu
Thanks, i ran it again with version 2.0.10 and it worked. However it did not solve my issue: the analog stick of the PiBoy is still not recognized although I mapped it, and the D-pad does not recognize "up"and "down"presses (but somehow pressing left makes the pad go up, and pressing right makes it go down. -
@silas11m
Hi, update on this: it actually did work, I just had to go back to ppsspp settings and re-map the buttons, the Dpad works now :) thanks vm -
@silas11m Hi! I've got exactly the same problem with PiBoy DMG, and I'm pretty new to all the Linux stuff. I'll try to follow the guide and configure the keys myself, but - maybe you could help me and copy here the line you got in the out.txt? Thank you!
-
Sorry to bump an old thread, but does this still work? I'm getting stuck on running the ./controllermap executable from the test folder (i.e no images come up). I've tried downloading the BMP files and putting them in the test folder. I'm SSHing in from my PC at the moment and dont have a way of pressing ESC key on a keyboard.
Any help would be appreciated as I would like to use the standalone version of PPSSPP.
EDIT: Nvm, it works. Just cant SSH in from your computer for the ./controllermap 0 >> txt command.
Thanks.
-
-
Greaty guide and thank you so much for this. I followed all the steps successfully but now when I open up a game, nothing works, not even the keyboard anymore.
Has anyone experienced this?
-
This whole process worked out smoothly but to no result. I am still unable to move any controls in PSP games. Furthermore, using ESC with the keyboard to try to setup things there also does not work for me. Would anyone here mind to share there gamecontrollerdb.txt file with me?
I have tried installing ppsspp from source or binary from scratch and still can't make it work.
-
@scorponok87
That works. You are missing something. When your controller is mapped in gamecontrollerdb.txt, you have to map your buttons in ppsspp UI.
Do you see your controller in gamecontrollerdb.txt ? If yes, the rest should be a piece of cake. Press esc like you did and set your buttons. If not, retry the process. It worked for me.IMPORTANT: You have to redo the process when you update PPSSPP. So if you reinstall the emulator, you lost what you did. I made a copy of gamecontrollerdb.txt for that reason.
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.