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

    Pi4 MAME2010 crashing on Tab menu > Inputs

    Scheduled Pinned Locked Moved Help and Support
    mame2010crashcontrols
    89 Posts 9 Posters 9.5k 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

      Im actually in the process of updating a few things for the input so all buttons are map-able and work like they should just bear with me until i finish up and ill post instructions how to compile it. The input system as is lacking in a very bad way.

      pjftP 1 Reply Last reply Reply Quote 0
      • pjftP
        pjft @Simrose
        last edited by

        @Simrose different problem specifically - to prevent that from happening, go to the RetroArch menu, Controls menu, Player 1 and change the assignment from R3 to "Enter UI Menu" or something.

        If you'd want to fix it, you'd need to compile from source, and between checking the code out and compiling it you'd need to edit the src/emu/uimenu.c so that after the includes you'd include #pragma pack(1).

        Alternatively you can overwrite your MAME binary with the one @grant2258 provided:

        wget https://github.com/grant2258/mame2010-libretro/blob/input/pi4_mame.zip?raw=true
        

        Download it and overwrite the file on /opt/retropie/libretrocores/lr-mame2010 if I recall correctly.

        1 Reply Last reply Reply Quote 0
        • pjftP
          pjft @grant2258
          last edited by

          @grant2258 One remark for a conversation we had earlier in the thread:

          @grant2258 said in Pi4 MAME2010 crashing on Tab menu > Inputs:

          In plain english you would need to set up down left right to dpad even in current mame.

          I'm not sure that is true, at least with the emulators that get installed by default (and perhaps - or in spite of - inputs being somewhat broken) the up/down/left/right are mapped to P1/P2 JOY UP/DOWN/LEFT/RIGHT, which end up being mapped by default to the RetroPie buttons as well. Once again, not sure if because - or in spite - of the inputs being broken. LR-MAME 2003, 2010, 2015, 2016 work out of the box as far as I remember.

          The fact that we now change the inputs to P1/P2 JOY HAT UP/DOWN/LEFT/RIGHT makes it so that they are not recognized by default. That's the main change that I wanted to highlight that may or may not be useful for the code you're looking at right now.

          Thanks!

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

            @pjft load mame current stand alone you can see you have to map the digital hat as per default. I can look into adding it to input defautls like i did with mame2003-plus at some point. The truth is the core lacked any analog controls at all for mame so only digital was used.

            pjftP 1 Reply Last reply Reply Quote 0
            • pjftP
              pjft @grant2258
              last edited by

              @grant2258 true for standalone, correct. I was referring to the libretro cores, that was my remark. And you're right, there was no analog support.

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

                ill try come up with something suitable my good man as i use a barcade myself so i will get round to it just want to hook everything up first. Most libretro cores dont support analog at all.

                pjftP 1 Reply Last reply Reply Quote 0
                • pjftP
                  pjft @grant2258
                  last edited by

                  @grant2258 no issues whatsoever - just sharing that note as it could be helpful:)

                  Best of luck with the barcade setup!

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

                    I wont be using this on a pi 3 to be honest just want to get it usable fror a pi4 if people want to use it.

                    Ok the updating is done there is one fix in here for the pi 4. Its a one line paragma and the rest of the updates are for the input that never worked right so it applies to all platforms. I only updated this because there might be a need for it to be usable.

                    There is a core option to enable auto mapping this will set selected games to automap its off by default you need to restart the core when you enable/disable this setting.

                    how to compile for pi4

                    git clone https://github.com/grant2258/mame2010-libretro.git
                    git checkout input
                    make platform=rpi4 -j8
                    sudo cp mame2010_libretro.so /opt/retropie/libretrocores/lr-mame2010/
                    

                    you can also patch the official repo with this

                    wget https://github.com/grant2258/mame2010-libretro/commit/eb1d80d0625c5ecd493c9e001a5e9f3a1fd8ec18.diff
                    git apply eb1d80d0625c5ecd493c9e001a5e9f3a1fd8ec18.diff
                    

                    @pjft let me know if you find any issues i will look out for sensible way to add the digital hats at some point!

                    pjftP 1 Reply Last reply Reply Quote 1
                    • pjftP
                      pjft @grant2258
                      last edited by

                      @grant2258 Oh my, I did not get notified of these changes/edits to your post, so only now did I come back to update this.

                      I ended up digging into the actual issue there - thank to yours and @mitu's guidance - and came up with a smaller fix for the crash on the Pi4, on the actual struct that was causing the problems. There might be more memory leaks or wrong accesses, but at least from what I tested nothing is crashing for the moment.

                      https://github.com/pjft/mame2010-libretro/commit/5b689b6351b602102967dd953237fb85fbb59244

                      I am just running a final test on compiling from scratch and then if it works well I'll submit it upstream.

                      I'll test out your patch tomorrow or weekend the latest, for sure.

                      For the actual compilation scripts, I'd love to get other (definitely more knowledgeable) people's inputs on those -- @mitu being clearly one of them. :)

                      Thanks for these - they'll make the lr-mame2010 experience a lot better for 2 player games and for customizing the inputs!

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

                        the only fix needed for the pi4 crash is #pragma i sent you. The rest of the updates is fixing the input thats badly broke and not finished

                        pjftP 1 Reply Last reply Reply Quote 0
                        • pjftP
                          pjft @grant2258
                          last edited by

                          @grant2258 Correct - I ended up just narrowing it down to what was the exact struct that was being accessed incorrectly, and apply the __packed qualifier to it only, in case the repository maintainers would object to applying it to the entire file for some reason.

                          Thanks for putting these together!

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

                            I have one more check on the code and noticed a little boo boo the latest updates will be in the input branch if you want them it works like it should now. If you find any issues let me know. Ill check the code over in the next few days and play some games. I dont think there is any maintainers. The defaults are stored in src/emu/inpttype.h if you want to have a look at changing them. In my experience this is the hardest part to deal with there is always going to be someone that doesnt like your changes.

                            Ive looked at this there is two ways to do the dpad you can set it up as a button and map it in the .h file you would for digital you would need to map the dpad to all alalog controls dial,xaxis,yaxis,paddle ect. This basically means you would loose the extra buttons on the dpad because they are already mapped and you really need it for games like hard driving ect.

                            I think a better way of doing this would be use of a controller file if the code for that hasnt been ripped out it wil basically do the same as above but you could have a core option to enable it or not of course a restart would be required.

                            1 Reply Last reply Reply Quote 1
                            • S
                              Simrose
                              last edited by

                              I'm having problems compiling or patching.
                              Can you help me with what i might be doing wrong.

                              error: Makefile: No such file or directory
                              error: src/emu/uimenu.c: No such file or directory
                              error: src/osd/retro/retromain.c: No such file or directory
                              error: src/osd/retro/retromain.h: No such file or directory
                              i get the above message.
                              Thanks
                              Sim

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

                                just do this

                                git clone https://github.com/grant2258/mame2010-libretro.git
                                cd mame2010-libretro
                                git checkout input
                                make platform=rpi4 -j8
                                sudo cp mame2010_libretro.so /opt/retropie/libretrocores/lr-mame2010/
                                
                                S 1 Reply Last reply Reply Quote 0
                                • S
                                  Simrose @grant2258
                                  last edited by Simrose

                                  @grant2258 said in Pi4 MAME2010 crashing on Tab menu > Inputs:

                                  git clone https://github.com/grant2258/mame2010-libretro.git

                                  git clone https://github.com/grant2258/mame2010-libretro.git
                                  fatal: destination path 'mame2010-libretro' already exists and is not an empty directory.

                                  im not sure what im doing wrong still, I tried uninstalling lr-mame2010 and still had same issue. No folder in libretrocores for lr-mame2010.
                                  Hope you can help.
                                  Thanks Sim

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

                                    rm -rf mame2010-libretro
                                    

                                    then do the above

                                    S 1 Reply Last reply Reply Quote 0
                                    • S
                                      Simrose @grant2258
                                      last edited by

                                      @grant2258 said in Pi4 MAME2010 crashing on Tab menu > Inputs:

                                      rm -f mame2010-libretro
                                      rm: cannot remove 'mame2010-libretro': Is a directory

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

                                        its rm -rf you posted that as i was editing it. I think ill compile a binary for people probably easier that way

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          Simrose
                                          last edited by Simrose

                                          @grant2258 said in Pi4 MAME2010 crashing on Tab menu > Inputs:

                                          git clone https://github.com/grant2258/mame2010-libretro.git
                                          cd mame2010-libretro
                                          git checkout input
                                          make platform=rpi4 -j8
                                          sudo cp mame2010_libretro.so /opt/retropie/libretrocores/lr-mame2010/

                                          Thanks its installing now.

                                          The remove command worked and used this post you made
                                          git clone https://github.com/grant2258/mame2010-libretro.git
                                          cd mame2010-libretro
                                          git checkout input
                                          make platform=rpi4 -j8
                                          sudo cp mame2010_libretro.so /opt/retropie/libretrocores/lr-mame2010/

                                          Im hopeing this will help with player 2 controls for some reason mortal kombat 2 etc the circle button does not do anything. Cant low kick on player 2. It will be great if it works afterwards.

                                          Thanks
                                          Sim

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

                                            should be good for 4 players :)

                                            S 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.