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

    lrmame 6 button mapping

    Scheduled Pinned Locked Moved Help and Support
    mame-libretro
    8 Posts 3 Posters 1.7k 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.
    • G
      grant2258 Banned
      last edited by

      Hi all having a bit of a nightmare of a time mapping a decent setup for mame. Now here is my issue. I will list my buttons as they are mapped in mame. below

      123
      456

      I remapped the buttons to match this set up the first time and street fighter two had odd problems.

      Now i looked at windows mame button numbers
      (1 = soft punch), (2 med punch), ( 3 hard punch) ----- first row on pannel
      (4= soft kick) , (5 med kick) , ( 6 hard kick) ------ second row

      at first i thought it was me setting the buttons wrong but it wasnt i went through the cps1 source code commits and someone changed the the lrmame button assignments in lrmame the source code maybe to suit a control pad? The buttons map like this now in lrmame.

      (1 = soft kick), (2 soft punch), ( 3 med punch) ----- first row on pannel
      (4= med kick) , (5 hard punch) , ( 6 hard kick) ------ second row

      so the result is when i mapped my buttons for sf2 to be right it messed all other games up because of the odd numbering it used.

      (2) (3) (5)
      (1) (4) (6)

      so 2 player buttons look like this now
      (1)
      (2)
      3 players look like this
      (1)(3)
      (2)
      neogeo
      (2)(3)
      (1)(4)

      it shoud be like this
      (1)(2)(3)
      (4) for the above

      so now I figured out where the problem came from short of my reverting the code to the way it should be is there a way to remap all lrmame cps1 systems in one place. It seems to be a strange change. I wish there was a standard arcade setup controller so this problem wouldn't effect arcade games. This change would require you remap all cps one games I have no idea why someone would do this change of buttons and make the rest of of the system unusable with an arcade panel.

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @grant2258
        last edited by

        @grant2258 Which Mame is this ? Maybe you could ask the developers to revert the change if it affects so many setups. What's the commit ?

        1 Reply Last reply Reply Quote 0
        • G
          grant2258 Banned
          last edited by

          hi thanks for the reply its lrmame 2003 the commit that changed this is https://github.com/libretro/mame2003-libretro/commit/2f8491ceed36760531b6b1640198bc196c775529 so it is undoable if i recompile it and put it back as it should be. Im lucky im in a position where i can fix this myself not everyone can though. I can imagine this fix is great for a control pad like snes or xbox360 or ps3 but ruins it for an arcade panel if you want to play other games without remapping everything . Im going to look into mame more and see if it has per system mapping overides for neogeo and cps1 if it does this wont be an issue. Im pretty sure there must be a way of doing this without messing with the real arcade layout defaults in the source

          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @grant2258
            last edited by

            @grant2258 That's like a 1.5 year ago change... Maybe the change is in Mame proper - windows - version that you tried. Mame2003 has per-game overrides and for neogeo you can use lr-fbalpha and re-map per core the bindings (so you don't need to map per-game).

            1 Reply Last reply Reply Quote 0
            • G
              grant2258 Banned
              last edited by

              no the mainline mame version has been and still is the 123 for punch 456 kick even in 193 it is a lrmame change. original mame 078 source
              mame078*******************
              PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
              PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
              PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
              ****************************** lrmame2003************************************
              PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
              PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
              PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON5 | IPF_PLAYER1 )


              you can see this is just changing the button maps on port bits on sft2 only. I suppose i can just remap these street fighter games it doesnt effect all cps1 games. I think I was just unlucky enough to pick the wrong game to set mame up with. Im more curious why this was done it will effect a lot of people its a popular game. I just finished making my own barcade and want to get all the bits setup. Maybe this issue should be covered in faq because it one of the more popular games and people with arcade pannels or controller will be scratching there heads. I just for the life of me can figure out why this was done. It will explain all the threads if found about mapping arcade games.

              its my own fault because i want a general map that covers everything i actually have 8 buttons and didnt want to complicate matters. To cover 1 2 3 4 6 buttons this universal solution works. note i have button 4 mapped in 2 placed thats to cover 4 in a row or 3x3.
              (1) (2) (3) (4)
              (4) (5) (6) (not used)

              1 Reply Last reply Reply Quote 0
              • G
                grant2258 Banned
                last edited by grant2258

                i figure i should help people that dont know how do do this instead of being lazy and remapping. this is how its done

                cd /home/pi/RetroPie-Setup/
                sudo ./retropie_packages.sh lr-mame2003 depends
                sudo ./retropie_packages.sh lr-mame2003 sources
                #edit the sources as required in tmp/build/lr-mame2003
                #see the link of the commits and change it back to what it should be
                sudo pico tmp/build/lr-mame2003/src/drivers/cps1.c
                sudo pico tmp/build/lr-mame2003/
                sudo ./retropie_packages.sh lr-mame2003 build
                sudo ./retropie_packages.sh lr-mame2003 install
                sudo ./retropie_packages.sh lr-mame2003 configure

                congrats sf2 works as it should for mame mapping. The alternative it to just use a set this machine in mame itself.

                1 Reply Last reply Reply Quote 0
                • dankcushionsD
                  dankcushions Global Moderator
                  last edited by

                  i did the change. it makes perfect sense if you consider the libretro mapping of this core, and you want it to match the standard SNES/PSX retropad layout. however that doesn't suit fightsticks, unless you map them to the equivalent layout when doing your retropad bindings (which would be contrary to their R2/R1 button placements.

                  ...however at some point i will make a core option for fightstick users so both camps will be satisfied. there is a lot of back and forth about the correct layout for arcade cores, and we have only recently reached a consensus, but it still would need a core option to switch between at least two different layouts.

                  1 Reply Last reply Reply Quote 0
                  • G
                    grant2258 Banned
                    last edited by

                    Yea i completely agree that it makes sense for a gamepad layout. I just started using retropie last week so it was a bit of a learning curve. I was amazed how many different ways you can change the inputs and you guys have done a great job so far.

                    Im lucky in a way i know linux/windows and programming so made the learning curve a lot easier. I fully understand when you say a layout for arcades is needed. I completely agree and i can see that mapping making sense for pads being the majority of users.

                    If its changed back snes/psx pads go the same way as arcade ones are now. I dont really mind now i understand how to fix it. I think another way would be to simply add

                    mame sf2 -ctrlr sf2lrarcadecontrol.cfg

                    at launch for a fix this for mame without messing anything up and snes pads will still work as they should.

                    Im assuming it just this game thats being remapped. Im not sure how to add that per game but im sure its doable. That`s from a logical point of view but real world hits you big time when you start doing these things. Thanks for the reply I really do understand where you are coming from and why it was done. I dont think there is a one way fits all in all cases. but i can add rules if i need to for the sf2 games at launch to revert back with -cltr for a none compile solution. Again for me it works for now ive recompiled.

                    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.