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

    lr-mame2003 button weirdness

    Scheduled Pinned Locked Moved Help and Support
    lr-mame2003control mapping
    11 Posts 3 Posters 3.6k 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.
    • GtBFilmsG
      GtBFilms
      last edited by GtBFilms

      Hi, hopefully someone will know the answer to this straight away and I'm just being dumb, but for some reason the buttons on my Picade cabinet aren't mapped properly in lr-mame2003.

      To start with it all worked fine. Then a few weeks ago I noticed that the second button was no longer doing anything - in Golden Axe, for example, button one was attack, button 3 was magic but I couldn't jump with button 2, or any other button.

      I tried remapping all the controls in Emulation Station, but the problem remained.

      I checked the guide at:
      https://github.com/RetroPie/RetroPie-Setup/wiki/lr-mame2003

      I'm using the arcade directory for ROMS and yes, there were loads of .cfg files in:
      /home/pi/RetroPie/roms/arcade/mame2003/cfg/

      I deleted them hoping this would set controls to defaults.

      Now button 2 works! But button 1 appear to be set to attack AND jump AND magic at the same time, while button 2 is set to attack and jump, and button 3 just to magic!

      I can get into the service menu in Golden Axe using the TAB key, and can confirm from the test screens that the buttons are somehow now mapped to multiple actions.

      This doesn't happen with any of the other retroarch emulators, they all work fine - it's just lr-mame2003 that seems to have developed this issue.

      Any suggestions, or would I be quickest to just uninstall and reinstall lr-mame2003?

      Thanks!

      Pi Model or other hardware: Pi 3 in a Pimoroni Picade
      Power Supply used: Standard Pi PSU
      RetroPie Version Used (eg 3.6, 3.8.1, 4.1 - do not write latest): 4.1
      Built From: RetroPie Image from website
      USB Devices connected: USB sound card
      Controller used: Picade
      Error messages received: None
      Log found in /dev/shm/runcommand.log (if relevant):
      Guide used: (Mention if you followed a guide):
      File: (File with issue - with FULL path)
      Emulator: lr-mame2003

      0_1504632117103_button1.jpg

      0_1504632122105_button2.jpg

      0_1504632126740_button3.jpg

      caver01C 1 Reply Last reply Reply Quote 0
      • caver01C
        caver01 @GtBFilms
        last edited by caver01

        @gtbfilms OK, we should be able to figure this out. According to what I am reading here, the Picade controller appears as a keyboard to the Pi. So, we are looking at keystrokes being sent. Here are a few things I am thinking about:

        1. If you exit to a command prompt, you should be able to send keystrokes by pressing the buttons. HOWEVER, default MAME setup has LEFT-CONTROL, LEFT-ALT, and SPACE keys for buttons 1, 2 and 3, so it is kinda hard to know just looking at the screen what keys are getting sent to the Pi.

        2. The loads of .cfg files in /home/pi/RetroPie/roms/arcade/mame2003/cfg/ are there because of in-game (MAME GUI) keymaps that have been setup. It might be interesting to check the MAME menue (TAB) and edit controls for THIS GAME menu choice when running Golden Axe as a test. The menu should display what keys it thinks it is using to perform what functions, but there is a catch: lr-mame2003 will see two devices when you configure keys using a keyboard controller. First, it sees the virtual gamepad inputs from Retroarch, and simultaneously, it sees the raw keystrokes sent from your picade controller. It might be an easy shortcut to just map your keys here and be done with it.

        3. A better approach might be, assuming the picade is using MAME defaults, to check the mapping in /opt/retropie/configs/all/retroarch.cfg which is where Retroarch has your default controls mapped. Then, since you are using the arcade folder, check the configs/arcade for a retroarch.cfg and see if there is any overriding keys mapped. Next, look for ROMNAME.ZIP.cfg files next to your roms to see if they have any overriding keys mapped.

        My 4-player cocktail style cabinet built as a custom "roadcase"

        1 Reply Last reply Reply Quote 1
        • GtBFilmsG
          GtBFilms
          last edited by GtBFilms

          @caver01 Thanks for taking the time to help.

          Interestingly I appear to have the keys configured in the all/retroarch.cfg and the arcade/retroarch.cfg differently.

          Can I get rid of the arcade one without any ill effects? (edit: no, I renamed it and none of the keys worked, not even insert coin! )

          0_1504643988234_IMG_20170905_213200.jpg

          0_1504643998681_IMG_20170905_213439.jpg

          I don't have any goldnaxe.cfg in with the rom, only a goldnaxe.fs, which I'm guessing is the high score table?

          dankcushionsD caver01C 2 Replies Last reply Reply Quote 0
          • dankcushionsD
            dankcushions Global Moderator @GtBFilms
            last edited by

            @gtbfilms we have what is know here as "screwed config". both of those files are non default. i guess you've been messing about in the retroarch menu saving things? that'll do it...

            to reset:

            /opt/retropie/configs/all/retroarch.cfg
            /opt/retropie/configs/mame-libretro/retroarch.cfg
            /opt/retropie/configs/arcade/retroarch.cfg
            DO NOT only delete these, as retroarch's defaults are not good for retropie. instead, reinstall retroarch AND lr-mame2003 via retropie-setup, and then look in those folders for retroarch.cfg.rp-dist files, and delete the above, and renameretroarch.cfg.rp-dist in EACH folder to retroarch.cfg

            now, if you've (knowingly? unknowingly?) created per-game/core overrides or anything like that... all bets are off.

            1 Reply Last reply Reply Quote 1
            • caver01C
              caver01 @GtBFilms
              last edited by caver01

              @gtbfilms It would be goldnaxe.zip.cfg if it were another retroarch config file for that rom sitting right next to it, and then and goldnaxe.cfg would be a MAME config file inside /opt/retropie/configs/arcade/mame2003/cfg

              @dankcushions has the right idea here. . . you want to get back to the distributed versions of these files. Since you are using the Arcade folder, I expect you are selecting which emulator to run each ROM using Runcommand. If so, you may have also used Retroarch GUI (in FBA for example) to configure buttons. The problem is that you can only have ONE retroarch.cfg file for the arcade folder, you probably have competing emulators that would try to use it.

              For comparison, here are the relevant parts for player 1 from my:

              /opt/retropie/configs/all/retroarch.cfg

              input_player1_a = alt
              input_player1_b = ctrl
              input_player1_y = shift
              input_player1_x = space
              input_player1_start = num1
              input_player1_select = num5
              input_player1_l = z
              input_player1_r = x
              input_player1_left = left
              input_player1_right = right
              input_player1_up = up
              input_player1_down = down
              

              and the entire contents of my
              /opt/retropie/configs/arcade/retroarch.cfg(complete file):

              # Settings made here will only override settings in the global retroarch.cfg if placed above the #include line
              video_shader = /opt/retropie/emulators/retroarch/shader/crt-pi-curvature.glslp
              video_shader_enable = true
              input_remapping_directory = "/opt/retropie/configs/mame-libretro/"
              
              #include "/opt/retropie/configs/all/retroarch.cfg"
              

              Notice that in the first file from the configs/all I have basically setup the P1 defaults for MAME, but crucially, these MUST match whatever keys your input controller is triggering. For example, using my IPAC controller, when I drop a coin using my wired coin button, I know that the IPAC is sending the number "5" and so here in my retroarch.cfg, the COIN switch (which also corresponds to SELECT) is set to "num5" accordingly. It looks like pressing COIN/select on your setup might be the letter "c" which can be easily verified by dropping to a command prompt and just pressing the button for it.

              Then, note that my arcade config file has basically NOTHING in terms of keymapping. It is just setup to do a CRT shader with curvature.

              It is very easy to get overwhelmed in a mapping and remapping situation and not know where to go. Once you have a better set of .cfg files as dank suggests, I would verify everything in this order, because it matters:

              1. What are the keys your picade is actually using for the real buttons? Verify this first. Nothing makes any sense below until you know what letters each button actually represents.
              2. Compare to your opt/retropie/configs/all/retroarch.cfg and make sure they match
              3. If good above, don't do more remapping in the opt/retropie/configs/arcade/retroarch.cfg as changing keys again here is unnecessary.
              4. Make sure there are no per-ROM retroarch.cfg files which would be named ROMNAME.ZIP.cfg and sitting right next to the ROM files. These would be a third remap!
              5. check for .cfg files in the /home/pi/RetroPie/roms/arcade/mame2003/cfg folder. These represent more remapping done within the MAME GUI.

              I guess I am not surprised that a picade would be configured to use C for COIN and S for START. That kinda makes sense, but it is not MAME default.

              My config looks pretty simple by comparison. I basically do two key maps. First, I set my desired configuration in opt/retropie/configs/all/retroarch.cfg which sets up my personal default to work for all libretro core emulators. Next, I do per-ROM setup where necessary in lr-mame2003 using the MAME GUI TAB menu (NOT the Retroarch menus) to make any adjustments in that emulator, OR I create manual per-ROM cfg files for when I need to vary from my defaults in other emulators (i.e. mslug.zip.cfg for running Metal Slug in FBA).

              My 4-player cocktail style cabinet built as a custom "roadcase"

              GtBFilmsG 1 Reply Last reply Reply Quote 1
              • GtBFilmsG
                GtBFilms @caver01
                last edited by

                @caver01 @dankcushions

                Thanks for your help, I think I probably did end up poking around in retroarch control mappings at some point, but didn't notice the effect of it until I played a game requiring more than one button.

                I uninstalled retroarch and lr-mame2003 last night, but then my Picade decided it couldn't find the binaries to reinstall - I suspect this was because it was upstairs and too far away from my wifi - usually I take it downstairs to tinker.

                So I'll take it downstairs and get them reinstalled tonight.

                Fingers crossed!

                GtBFilmsG 1 Reply Last reply Reply Quote 0
                • GtBFilmsG
                  GtBFilms @GtBFilms
                  last edited by

                  Awesome Thanks for your help!

                  Gilius Thunderhead is jumping for joy again!

                  0_1504731161494_jump.jpg

                  I reinstalled retroarch, then lr-mame2003. Then followed @dankcushions instructions on removing and renaming the cfg files.

                  The key test in Golden Axe showed my buttons were now correct again.

                  BUT, my coin and P1 start didn't work.

                  So. I used @caver01 instructions to edit the single cfg file in 'all' directory and change just the start and select mappings to 's' and 'c' as the picade is set up.

                  And it all works!

                  Actually better than before as exit is now set to the escape button the same as in advmame, whereas before it was always 's' and 'c' together - I think I prefer a standard button for exiting all emulators, particularly as it's a side button on the picade and less likely to be pressed by accident.

                  Thanks for taking the time to help me, it's much appreciated.

                  caver01C 1 Reply Last reply Reply Quote 0
                  • caver01C
                    caver01 @GtBFilms
                    last edited by

                    @gtbfilms Glad to hear it! I wonder. . . unless you disabled hotkeys in your RetroArch config, Select+Start might still trigger exit. I ended up turning off Hotkeys by editing my config in /all because I have a dedicated exit button that sends ESC which I have mapped to exit. I was having a terrible time with games accidentally exiting too. Metal Slug, for example, would have me dropping in a coin and pressing start to continue too quickly and it would sometimes trigger an exit. Same for Smash TV, and a buch of others. I am sacrificing other hotkey features by turning this off, but I don't really need them on my arcade cabinet. One day, I will probably want to turn this back on using different keys to get access to save states or something, but until then, this works for me.

                    I am curious if your changes have now created a different problem with the other emulators you already had working. . .

                    My 4-player cocktail style cabinet built as a custom "roadcase"

                    GtBFilmsG 1 Reply Last reply Reply Quote 0
                    • GtBFilmsG
                      GtBFilms @caver01
                      last edited by

                      @caver01

                      I tried a few other emulators, which all seem to be working okay, although for some reason I'm no longer getting sound on the Megadrive, SNES, PC Engine - I'm wondering if my changes have undone some settings I made when I installed a USB sound card.

                      I'm going to try reapplying those to try to get my sound back.

                      Curiously, sound is fine in lr-mame2003, and also in Drastic.

                      The only other thing I noticed is I lost my shaders in lr-mame2003, I actually quite like the crisper look, so I'm going to leave them off for a while I think.

                      GtBFilmsG 1 Reply Last reply Reply Quote 0
                      • GtBFilmsG
                        GtBFilms @GtBFilms
                        last edited by

                        Pah!

                        Famous last words! Now I'm getting the old rainbow screen on power up - tried another SD card and it all boots up fine - so it looks like my SD card was on the way out (which probably had something to do with it all getting screwed up in the first place)

                        Oh well, at least I took a backup (about 6 months ago!).

                        caver01C 1 Reply Last reply Reply Quote 0
                        • caver01C
                          caver01 @GtBFilms
                          last edited by

                          @gtbfilms Bummer. The loss of shader was definitely a result of swapping out old for new configs. You can add a shader configuration line like I did above in the all/retroarch.cfg or like I did in the arcade config folder.

                          As for sound, I would be surprised if Retroarch configs are to blame for that, especially since it still worked in lr-mame2003.

                          My 4-player cocktail style cabinet built as a custom "roadcase"

                          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.