RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Player 2 controller configured in EmulationStation, detected in game, but not mappable in MAME

    Scheduled Pinned Locked Moved Help and Support
    mamep2 controlsremapconfigurecontroller
    45 Posts 2 Posters 7.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • leitmotivL
      leitmotiv
      last edited by leitmotiv

      I'm running a Raspberry Pi 3B+
      Controller: PS3 for P1, a cheap Exlene for P2
      USB devices: Flash drive, keyboard, PS3 controller, Exlene controller for P2
      Built using download from RetroPie site
      Retropie version: 4.4.12
      RetroArch 1.7.6

      I configured my PS3 controller (without the driver) and have it working for everything except AdvMAME.

      I am trying to get my second Exlene controller working for P2. It's configured with EmulationStation and detected by it. I can go into Mortal Kombat and some of the buttons work like insert quarter (select), block, low punch and high kick. Remapping in Retroarch doesn't work because the game doesn't have all 5 buttons mapped in Retroarch (it's missing 1). So I tried to remap in MAME (pressing tab on keyboard), but it wouldn't detect the controller. I use the keyboard to highlight a key I want to remap for P2, hit enter, press a button on P2, but nothing happens.

      How do I get it to recognize remapping in MAME for P2?

      EfriimE 1 Reply Last reply Reply Quote 0
      • EfriimE
        Efriim @leitmotiv
        last edited by Efriim

        @leitmotiv I've not been able to map the some of the buttons on a controller before. Are you able to map any of the other buttons on the controller?

        Have you used the emulationstation to configure input?

        You may have to do some digging around in the root if you were to get to the terminal.
        sudo apt-get install evtest

        connect the exlene and use evtest on the device, the event # will probably be one of 0-8 you'll have to guess and try them. Ctrl+C to exit
        evtest /dev/input/event5
        evtest /dev/input/event5 |grep -E "ID|Test|BTN_"

        Input device ID: bus 0x5 vendor 0x54c product 0x268 version 0x8100
            Event code 304 (BTN_SOUTH)
            Event code 305 (BTN_EAST)
            Event code 307 (BTN_NORTH)
            Event code 308 (BTN_WEST)
            Event code 310 (BTN_TL)
            Event code 311 (BTN_TR)
            Event code 312 (BTN_TL2)
            Event code 313 (BTN_TR2)
            Event code 314 (BTN_SELECT)
            Event code 315 (BTN_START)
            Event code 316 (BTN_MODE)
            Event code 317 (BTN_THUMBL)
            Event code 318 (BTN_THUMBR)
            Event code 544 (BTN_DPAD_UP)
            Event code 545 (BTN_DPAD_DOWN)
            Event code 546 (BTN_DPAD_LEFT)
            Event code 547 (BTN_DPAD_RIGHT)
        Testing ... (interrupt to exit)
        

        then try to add the input by editing the advmame.rc
        nano /opt/retropie/configs/mame-advmame/advmame.rc

        # towards the end of the file you will probably already have buttons configured for reference
        input_map[start1] keyboard[0,1] or joystick_button[054c_0268,start]
        input_map[coin1] keyboard[0,5] or joystick_button[054c_0268,select]
        input_map[ui_cancel] keyboard[0,esc] or joystick_button[054c_0268,mode]
        

        from evtest:

        Input device ID: bus 0x5 vendor 0x54c product 0x268 version 0x8100
        Event code 314 (BTN_SELECT)
        

        translatest to vendor #### and product ####, follow by the BTN_name

        joystick_button[054c_0267,select]
        
        EfriimE 1 Reply Last reply Reply Quote 0
        • EfriimE
          Efriim @Efriim
          last edited by Efriim

          Also without the sixaxis helper driver installed. I think it would be using the sixad, I don't know in your case. With the sixad driver there will be an additional event for the sixaxis gyrotational movement and this could interrupt the automatic configuration of the second device. possibly? Try the sixaxis helper driver, some configurations will be changed or need to be updated. Or there is a way to manually remove the sixaxis gyro event (search, probably on reddit). Or you could edit this one line in advmame.rc for the appropriate event #

          input_map[event2] auto
          

          It's only possible, but if the other buttons on the controller are working for you then this is probably not the problem.

          leitmotivL 1 Reply Last reply Reply Quote 0
          • leitmotivL
            leitmotiv @Efriim
            last edited by leitmotiv

            @Efriim Could this also be related to why my PS3 controller is not detected by AdvMAME? My PS3 controller works great for everything, except AdvMAME. Any time I open a game up with AdvMAME the controller is not detected. I can, however, go into Tab, edit the mapping for the controller and it will detect the controller there and assign buttons. So I've assigned controls in MAME, but as soon as I exit, it is still unresponsive.

            EfriimE 1 Reply Last reply Reply Quote 0
            • EfriimE
              Efriim @leitmotiv
              last edited by Efriim

              @leitmotiv It could be related, I think Advmame uses its own sort of automatic event detection, and while the sixaxis uses an additional event for the gyro, advmame gets assigned false event numbers.
              /opt/configs/mame-advmame
              configs\mame-advmame\advmame.rc
              has a setting to manually assign the event #

              sudo apt-get install evtest
              ls -l /dev/input
              evtest /dev/input event*

              or install the sixaxis driver,
              or search for that hacky edit to eliminate the ds3 gyro event.

              leitmotivL 1 Reply Last reply Reply Quote 0
              • leitmotivL
                leitmotiv @Efriim
                last edited by leitmotiv

                @Efriim Well, I started trying to see what would happen in AdvMame first. I installed the Sixaxis Driver first. I went into the game Exvania, went into the MAME controls, and became aware of three issues:

                1. The default may not have been assigned to insert a coin or start a game, effectively locking me out of the game. So I assigned those. Suddenly the game is detecting my controller.

                However,

                1. The Right D-pad is blank. It won't let me map it. So when I go in the game, I can use all the basic controls, except moving right.

                2. If I want to exit the game, the hot button doesn't work. Normally I have it set to the PS3 button + Triangle (X). So I can't exit a game unless I hit Tab and exit that way.

                Will look at the P2 issues next...

                Tried P2 controller in AdvMAME and it's not detected yet. Moving on to some of your earlier steps re: testing.

                I did evtests.
                Event 0 appeared to be my keyboard.
                Event 1 no response from anything, not sure what it was trying to read.
                Event 2 was definitely my PS3 controller and if I had to guess, some sort of motion detection when the controller was physically moved about (but seemingly not from button presses).
                Event 3 seemed to be as PS3 as well, but actual buttons mixed in with a constant stream of syn reports. Right D-pad was working.
                Event 4 was the Exlene. None of the codes matched to your list above. The D-pad had (Up, Down, Left, Right) were all assigned to code 0 or code 1. Everything else was code 292 through 297, or thereabouts. With the top right shoulder button called "BTN_PINKIE" code 293, as an example.

                After fixing a British keyboard problem and converting it to Enligsh US, I got the event codes:

                288 (BTN_Trigger)
                289 (BTN_Thumb)
                290 (BTN_Thumb2)
                291 (BTN_Top)
                292 (BTN_Top2)
                293 (BTN_PINKIE)
                294 (BTN_Base)
                295 (BTN_Base2)
                296 (BTN_Base3)
                297 (BTN_Base4)

                So not all D-pad is there... nor does the PS3 (P1) controller have all input maps for the D-pade in the AdvMame.rc. I noted before that Right D-pad was not detected, but in the .rc it has Down, Left, Right, but no Up. EDIT: I was in wrong .rc file. I'm actually in AdvMame .94.rc which runs the game. It shows Right is blank. Strangely, the numbers associated with the buttons are offset by 1 number between the .rc file and the number as it appears in the AdvMAME controls mapping screen. I editing in the right D-pad for P1, not sure what number, so I tried a number on either end of the others listed, think I got the right number, restarted, but now it won't detect the controller at all! But in Tab it shows the buttons have been reassigned (or set back to default?) to a generic "j:button 13" (as an example) assignment instead of the "j2:button 13" it should be.

                Haven't added the P2 controller yet.... kind got lost at the point. But I do note Event4 is already set to auto along with Event 2 and 3. Also, side note: I earlier tweaked device_joystick to sdl from raw, and raw from auto, to see if that would fix it, but no dice.

                EfriimE 1 Reply Last reply Reply Quote 0
                • EfriimE
                  Efriim @leitmotiv
                  last edited by

                  @leitmotiv
                  Sorry for the shoddy directions, I tried it and it was just as you say. I switched back to the old driver and it was the same. I wasn't able to map directional buttons at all.
                  But changing advmame.rc:
                  device_joystick raw
                  I was able to map the to map the directions and everything else on the controller using the 'Tab' Gui. The tricky part is getting rid of all the game specific mappings; I edited advmame.rc manually for that, CTRL+K cuts a line out; those will override if they are not removed.
                  I think then with raw maps on the ps3 controller you should also be able to map the exlene without any problems.

                  leitmotivL 1 Reply Last reply Reply Quote 0
                  • leitmotivL
                    leitmotiv @Efriim
                    last edited by leitmotiv

                    @Efriim Oh no worries about the directions. I was also up late and tired, so had to stop somewhere.

                    Here's where I'm at right now:

                    1. I've edited the AdvMame .94 .rc file for device_joystick to raw, but when I restart it keeps setting it back to sdl, even though I've saved. Strangely, the input for the PS3 controller for the right d-pad button is sticking in the .rc file, but in the AdvMAME config menu it still shows defaulted to "J:button13" when it should be "J2:button13" like the other remaps.

                    2. Home button on PS3 controller is not working in AdvMAME.

                    3. The Exlene controller now maps in AdvMAME in the config for P2 controls, but it assigns it to just "J:button 13" (as an example), which is the default for P1. P1 controller (PS3) maps as "J2:button 14" (as an example), but is defaulted as "J:button 14". I am guessing the home button probably doesn't work either but I haven't checked.

                    4. The above issues are with AdvMAME. The original problem of P2 controls not mapping for the Exlene in Mortal Kombat is still present. It is running on MAME2010 and for MKII on MAME2003. I used to be able to at least use P2 controller and insert a quarter, but now it doesn't even do that. I don't know what I did that could have possibly changed anything.

                    4.b I now discovered I can't use the Tab button in MAME2010 games to open up config. So I'm locked out for some reason.

                    Any ideas?

                    EfriimE 1 Reply Last reply Reply Quote 0
                    • EfriimE
                      Efriim @leitmotiv
                      last edited by Efriim

                      @leitmotiv

                      1. advmame.rc. If you were editing side by side when advmame closes it overwrites the cfg. You could compare my working config, buttons mapped as raw look like: (DS3; sixaxis driver)
                        input_map[start1] keyboard[0,1] or joystick_button[sony_playstationr3_controller,button10]
                        input_map[coin1] keyboard[0,5] or joystick_button[sony_playstationr3_controller,button9]
                        https://drive.google.com/open?id=1dIGyAfHdohlTb4VzbVXfIjO9deSmMBYn

                      2. PS3 Home. I don't think this would be specific to AdvMame .94, and right now I don't know if I was able to map home as SDL, got to get raw input somehow.

                      3. Exlene Controller. Probably either above or below. Also be aware that the general inputs I think will save as game-specific anyway.

                      4. Mame2010 I think is a libretro core, those are easier to map and automatically set-up. You could need to Configure Input in emulationstation menu. Or there is something up with the config or override located at \configs\all\retroarch.cfg and \configs\all\retroarch\config~mame2010.
                        Backing up the config, and deleting it (renaming) will enumerate a new config next time you start retroarch, you could see if the controls work then.
                        4b. To reset options within retroarch, settings/input, pressing the 'start' button on a highlighted option will reset it to default. There are also some options to reset controls to default, however this isn't always what you want, sometimes the player1 device index needs to be changed. You will be able to have both keys and joystick for player 1 though, usually by default, the configuration just needs to be worked out.

                      Is the exelene controller wired only?
                      Also if editing the config in windows, be sure to use a notepad+ or better.

                      leitmotivL 1 Reply Last reply Reply Quote 0
                      • leitmotivL
                        leitmotiv
                        last edited by leitmotiv

                        @Efriim

                        1. yeah that might have been what was going on... so far the changes are now sticking to "raw"

                        2. I was able to go into UI cancel and set it to select+start....

                        yeah the Exlene controller is wired. And I use notepad++.

                        So I copy/pasta'd your PS3 controller setup, or at least some of it. Just the P1 controls and the UI cancel. Tried to boot the game, and now the game won't boot. Realized I had two UI cancels (yours and my previous), so I deleted my previous one. Still no boot.

                        1 Reply Last reply Reply Quote 0
                        • leitmotivL
                          leitmotiv @Efriim
                          last edited by leitmotiv

                          @Efriim Now I tried just copying your whole .rc file and replaced mine. Still no boot....

                          EfriimE 1 Reply Last reply Reply Quote 0
                          • EfriimE
                            Efriim @leitmotiv
                            last edited by

                            @leitmotiv wait which PS3 driver are you using now?

                            leitmotivL 1 Reply Last reply Reply Quote 0
                            • leitmotivL
                              leitmotiv @Efriim
                              last edited by

                              @Efriim sixaxis

                              EfriimE 1 Reply Last reply Reply Quote 0
                              • EfriimE
                                Efriim @leitmotiv
                                last edited by Efriim

                                @leitmotiv
                                I'm using the sixaxis too.
                                if the controls are wrong, then it will refuse to start. I tried downloading and copying it and it worked. Are we editing and using the same advmame, I think I updated mine recently just recently for this Advmame 3.9, config file at \configs\mame-advmame\advmame.rc

                                It could and probably is anything wrong with the input
                                I notice mine is
                                sony_playstationr3 where there is an 'r' and I don't know why. There are numerous PS3 controller revisions however.

                                Could try without the keyboard mapping.

                                If you sync the controller into emulation. While the emulator is already started, it won't take the input. The controller has to be synced when emulation starts, now I don't know if this applies if it is set to SDL map, which makes me want to use the retroarch emulators more.

                                1 Reply Last reply Reply Quote 0
                                • leitmotivL
                                  leitmotiv
                                  last edited by

                                  well I'm using .94 for Exvania... so that could be the discrepancy

                                  EfriimE 1 Reply Last reply Reply Quote 0
                                  • EfriimE
                                    Efriim @leitmotiv
                                    last edited by

                                    @leitmotiv
                                    Nevermind about the R, it is there because of the Sony Registered trademark.

                                    leitmotivL 1 Reply Last reply Reply Quote 0
                                    • leitmotivL
                                      leitmotiv @Efriim
                                      last edited by

                                      @Efriim It seems that Crackdown, a game using just AdvMAME (as opposed to AdvMame .94), is running fairly smoothly. I have no problems getting the right d-pad working. Though in the past with AdvMAME it was an issue with the Up D-pad.

                                      .94 just seems problematic.

                                      EfriimE 1 Reply Last reply Reply Quote 0
                                      • EfriimE
                                        Efriim @leitmotiv
                                        last edited by

                                        @leitmotiv
                                        Yeah I know I hadthe same issue with just the dpad-up, it was either the playstation3 controller driver or the SDL mapping. I mapped cancel to both home and R3 buttons. I didn't map button 4 or the other for some reason.

                                        EfriimE 1 Reply Last reply Reply Quote 0
                                        • EfriimE
                                          Efriim @Efriim
                                          last edited by

                                          The exlene controller might use axis for the dpad, but it should still be able to be mapped. Or were you able to map everything in Advmame 3.9?

                                          leitmotivL 1 Reply Last reply Reply Quote 0
                                          • leitmotivL
                                            leitmotiv @Efriim
                                            last edited by leitmotiv

                                            @Efriim I was able to map everything, except a couple problem games that probably have nothing to do with AdvMAME. Metal Hawk's controls were messed up. There was one other, but not much of a loss.

                                            It's so hot here right now, I can't tackle any more problems at the moment! I will have to tackle the 2003 not recognizing the tab button later. Thanks for your help! Much appreciated!

                                            Oh and yeah, I think the Exlene does use -y +y, -x +x.

                                            EfriimE 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.