Welcome Page Forums RetroPie Project Everything else related to the RetroPie Project MAME CONTROLS (PS3 WIRELESS GAMEPAD)

This topic contains 28 replies, has 3 voices, and was last updated by  Haris 3 years, 6 months ago.

Viewing 29 posts - 1 through 29 (of 29 total)
  • Author
  • #15209


    I (finally) managed to play some mame roms (the problem was the wrong mame.cgf path..). But i came accross an other problem. I cannot use my ps3 wireless joystick. I hit TAB on my keyboard, the config screen appears (input controls) but whatever button i press in my joystick doesn’t work. It seems that the joystick input configuration doesnt work. Only keyboard does. I know it is smth stupid but what do i have to change?

    This is my mame.cfg file

    PS. I found this post :

    Mame4all-pi with PS3 Controller

    But when i enter minimal.cpp i cant see lines and i cannot Comment out lines 168 to 174!! Maybe someone who has changed minimal.cpp to eork with controllers can help?




    The file structure of Retropie 2.2 has changed so the command you need to use to access the minimal.ccp file is now

    sudo nano /opt/RetroPie/emulators/mame4all-pi/src/rpi/minimal.cpp



    Thanks man. I know that this was the path (i assumed it). I opened minimal.ccp with note++ (windows) and changed 168-174 lines (i only had some characters like this==> [ ]). All other strings were ok. I then tranfered it back to were it was (fillezila).

    I am now recompile it (takes time). Is that the right procedure?



    Recompile takes ages !!!!!!!!!!!!!

    One thing i forgot to mention though: i want to exit mame by pressing start+select at the same time (like in other emus). Is that possible?how do i do it?



    Updated. Doesnt work:(

    I dont if this because i opened minimal.ccp with note++ (windows). I recompiled but when i ssh with

    sudo nano /opt/RetroPie/emulators/mame4all-pi/src/rpi/minimal.cpp

    there are no lines in the file!! So smth must have been wrong. Can you upload the minimal.cpp file?



    You can get a copy of the minimal.cpp file from source.

    I would check that you have the /src/rpi folder on your Pi first. If not, you may have to install mame4all from source using the Retropie setup script which can take 16 to 22 hours.

    In reply to your earlier post, you can assign a key to exit mame by using TAB. In the Input:General menu, there should be an option to configure how to exit UI.



    So..if i install mame4all from source using the Retropie setup script, would my controller work out of the box? Or should i change the minimal.cpp again?



    You would need to change the minimal.cpp file and recompile but at least the file will be there.



    Can i just copy the cpp file to my directory?



    Ok here is a strange think. When i use ssh and this command:

    sudo nano /opt/RetroPie/emulators/mame4all-pi/src/rpi/minimal.cpp

    i can see no lines in the cpp. But when i use filezila to transfer it to my desktop, i open it with notepad++ and i can see lines !! What is going on here?



    Dudleydes..from your sayings you recompiled the whole mame4all-pi folder. So -as you are my last resort- would you be kind to upload the whole folder in order to tranfer it through fillizila to my pi??




    In my previous post, the path to the minimal.cpp file is incorrect so that may explain why you couldn’t see any code when using ssh.

    As file names and directories are case sensitive in Linux, the command should be

    sudo nano /opt/retropie/emulators/mame4all-pi/src/rpi/minimal.cpp

    What I did was write the Retropie 2.2 image to SD card, comment out the lines in the minimal.cpp file and then recompile using the following commands.

    cd /opt/retropie/emulators/mame4all-pi/


    My 168-174 lines are exactly as you described but still no luck. I am uploading the ssh image (captured on my pc)

    what am i doing wrong?



    You need to comment out lines 168-174. I did this by adding double forward slashes (//) at the beginning of each line of code which should turn blue as you edit. My code looks as below

    //	if (SDL_JoystickNumAxes(myjoy) > 6)
    //	{
    //		SDL_JoystickClose(myjoy);
    //		myjoy=0;
    //		logerror("Error detected invalid joystick/keyboard\n");
    //		break;
    //	}

    I have attached my copy of minimal.cpp which you can use to overwrite your copy once you have changed the extension from .txt to .cpp (I couldn’t upload the cpp file).

    Either way, you will need to recompile which took 3 hours for me.

    1. minimal.txt


    i have the same probleme i must edit minimal.cpp fot play with my ps3 ?



    aornn, yes, you need to edit the minimal.cpp file. At the moment, the mame4all-pi code rejects any controller with more than 6 axes such as the PS3 controller.

    If it’s easier, you can download my copy attached in my previous post, change the file extension from .txt to .cpp, overwrite the copy on your Pi and then recompile.



    thanks for answer quickly 🙂

    and after recompile my controller work ?



    Yes, your PS3 controller will now work. You may need to configure certain actions for your controller, such as exiting Mame. You can do this by pressing TAB on a keyboard to bring up the Mame menu.



    so if i have understand clearly i must do :
    1- replace my .CPP by your
    2- cd RetroPie-Setup after sudo ./
    3- option 1
    4- wait…
    5- my controller work !!

    that’s right ?



    Here are the steps to get your PS3 controller working with mame4all.

    1. Replace your copy of minimal.cpp with my copy.
    2. Recompile by running the commands below from the terminal on the Pi or via ssh on a desktop.

    cd /opt/retropie/emulators/mame4all-pi/

    This step took me about 3 hours.

    3. Your PS3 controller will work but you may need to configure certain actions by using TAB.

    4. Enjoy.



    thx !!! 😀
    i did not know this command ! 😀



    Thanks my friend. I will try it:)



    While recompiling i get some warnings, is that right?


    Haris works !!!

    But every time i start a new game i have to map my controls again!!

    Can i save these settings somehow in order not to remap all the time??



    Pleased to hear it worked.

    You can use the TAB key to bring up the MAME menu. You can then map your controller for all games (Input:General) or for specific games (Input:This Game).



    I have already done it. But when i exit the game and restart it (through emulation station menu) i must redo the same procedure:( (i guess controls have not benn saved) .What can i do?



    Here are some things you can try.

    1. Check that you have a folder cfg in the mame4all-pi directory. If not, then you will need to create one.

    2. Check who owns the cfg folder, if it exists, by running the command

    ls -ld /opt/retropie/emulators/mame4all-pi/cfg
    For changes to be saved, the user should be pi, not root. The output when I run this command is

    drwxr-xr-x 2 pi pi 4096 Jul 8 14:21 /opt/retropie/emulators/mame4all-pi/cfg
    If you get root as the owner, then you can change the user to pi with the following command.

    sudo chown -R pi:pi /opt/retropie/emulators/mame4all-pi/cfg
    (I gave pi permission to /opt/retropie to avoid any future problems)



    You Sir, are a genius. I couldn’t thank you enough



    Dudleydes i dont have words to thank you..You are God:) Thanks

    I will try to upload a txt file with RetroPie hints and tips in order to sum up many questions and answers about set up

    Thnks again 🙂

Viewing 29 posts - 1 through 29 (of 29 total)

Forums are currently read only - please visit the new RetroPie forums at

PLEASE NOTE: All orders that are placed between January 14th and January 28th will be shipped on January 29th. Dismiss