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 7.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.
    • pjftP
      pjft
      last edited by

      Cool - that solves it then :)

      Thanks!

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

        i actually put a fix in for the input and closed it for personal reasons with libretro. The pull request is here test it out if you like.

        https://github.com/libretro/mame2010-libretro/pull/125/commits/dd10a977df8d6fcdcc0aba44043e583155a024bc

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

          @grant2258 Interesting - tell me more. Were you trying to - or do you know if it addresses this?

          https://github.com/libretro/mame2010-libretro/issues/119

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

            info is here https://github.com/libretro/mame2010-libretro/issues/119 youll need to expand my comments lol

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

              @grant2258 Ah - didn't see that it was you, since the comments were minimized. :)

              I'll try it out - thanks!

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

                @grant2258 So, I've been trying it out and I do confirm that the 6 buttons do work - well done!

                I have a few quirks that I'm trying to figure out, first checking if it's a config thing on my end, and if not, where on the code might it be.

                In summary: in my current setup, at least, the P1 PS3 controller left analog controls both the P1 and P2 movement. Furthermore, on the DragonRise joysticks, the actual left/right/up/down controls from RetroArch don't control the directions the in-game directions. However, if I map those joystick directions to a button (1, 2, 3), when moving the joystick in that direction it will act as if the button was pressed, so it seems that MAME is detecting those inputs, but isn't set up to translate them to the proper in-game controls.

                Specifically:

                • DPad controls, mapped to left/right/up/down on RetroArch don't do anything right now;
                • Mapping anything in RetroArch to "Joystick Up/Down/Left/Right" doesn't do anything either;
                • Any of the acceptable buttons are detected by RetroArch.

                So it seems to me that - other than the Analog Joystick for Player 1 controlling both P1 and P2's movement - the challenge with Joystick Up/Down/Left/Right on the RetroPad is the key thing.

                But I'm still trying to figure out if it's a settings thing on my end or not. This has at least pointed me in a positive direction - thank you!

                If you have any suggestions or pointers about specific parts of the code that might be causing this, feel free to bring them up. :)

                EDIT: the analog for P1 controlling all players was a simple copy and paste mistake that kept the index. I'm not commenting on the lr-mame2010 repository, but I fixed it on my end. Now I'm chasing down the up/down/left/right mappings.

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

                  well for mame there is only one control used for up down left right. Ill have a look at the code at some point in my barcade. For a start i would clear the current mame2010 cfg dir. In plain english you would need to set up down left right to dpad even in current mame.

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

                    @grant2258 Indeed. In this PR I need to go to the tab menu and manually set up U/D/L/R to

                    <mameconfig version="10">
                        <system name="sfex2">
                            <input>
                                <port tag="P1" type="P1_JOYSTICK_UP" mask="1" defvalue="1">
                                    <newseq type="standard">
                                        JOYCODE_1_HAT1UP
                                    </newseq>
                                </port>
                                <port tag="P1" type="P1_JOYSTICK_DOWN" mask="2" defvalue="2">
                                    <newseq type="standard">
                                        JOYCODE_1_HAT1DOWN
                                    </newseq>
                                </port>
                                <port tag="P1" type="P1_JOYSTICK_LEFT" mask="4" defvalue="4">
                                    <newseq type="standard">
                                        JOYCODE_1_HAT1LEFT
                                    </newseq>
                                </port>
                                <port tag="P1" type="P1_JOYSTICK_RIGHT" mask="8" defvalue="8">
                                    <newseq type="standard">
                                        JOYCODE_1_HAT1RIGHT
                                    </newseq>
                                </port>
                                <port tag="P2" type="P2_JOYSTICK_UP" mask="1" defvalue="1">
                                    <newseq type="standard">
                                        JOYCODE_2_HAT1UP
                                    </newseq>
                                </port>
                                <port tag="P2" type="P2_JOYSTICK_DOWN" mask="2" defvalue="2">
                                    <newseq type="standard">
                                        JOYCODE_2_HAT1DOWN
                                    </newseq>
                                </port>
                                <port tag="P2" type="P2_JOYSTICK_LEFT" mask="4" defvalue="4">
                                    <newseq type="standard">
                                        JOYCODE_2_HAT1LEFT
                                    </newseq>
                                </port>
                                <port tag="P2" type="P2_JOYSTICK_RIGHT" mask="8" defvalue="8">
                                    <newseq type="standard">
                                        JOYCODE_2_HAT1RIGHT
                                    </newseq>
                                </port>
                            </input>
                        </system>
                    </mameconfig>
                    

                    and then it works... better. Still digging into the niggles - the main issue is that accessing the TAB menu on the Pi4 crashes mame2010 these days :)

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

                      @pjft is it just the pi 4 doing this ? again i would repeat the advice i gave before delete all the contents of cfg dir corruption in here can cause crashes if that doesnt help ill try on a pi 3 and 4 bit linux and see if i can find any issues.

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

                        @grant2258 The Pi3B doesn't crash - that's how I got it to generate these mappings. Same code base, compiled from source on both accounts.

                        It seems to work well now - I had been messing with the indexes on the code on the Pi4 myself and that messed up the control labels and that was breaking the mappings I had gotten from the Pi3B.

                        In the end I don't know if there are any key differences from your commit, but I did make some changes on the labels and on reading the axis for P2-P4 that I imagine were copy&paste mistakes, but I can't test on my end.

                        See my commit here on my fork:
                        https://github.com/pjft/mame2010-libretro/commit/a4674570a157fc50fdd30e16e347df23a1361d2f

                        Thanks for leading me to a good solution here!

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

                          yea that was copy and paste errors i just forked off to my github and fixed the axis reads. Is teh pi 4 still crashing with the tab menu if your clear the cfg dir?

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

                            @grant2258 Yes. Removed the cfg folder.

                            /opt/retropie/supplementary/runcommand/runcommand.sh: line 1255: 2693 Bus error /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip" --appendconfig /dev/shm/retroarch.cfg

                            Pi3B works fine.

                            As Mitu mentioned, it seems others have experienced it:

                            https://github.com/libretro/mame2010-libretro/issues/121

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

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

                              /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"

                              just a quick question can you close emulationstation and run this command

                              /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"

                              do you get any output from this?

                              another big one is what flags are you compiling this with on the pi4 ?

                              ok updated the makefile for pi 4

                              wget https://github.com/grant2258/mame2010-libretro/raw/b430fd1300f8c1d38c3a3bab45ad81fa1a09b460/Makefile

                              make platform=pri4 -j4

                              be sure to copy this over the original Makefile

                              execute with

                              opt/retropie/emulators/retroarch/bin/retroarch -L ./mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"

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

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

                                /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"

                                I do - I get the following more:

                                IMG_2809.JPG

                                Unhandled fault: alignment exception (0xa21) at <memory address>

                                --- which I just noticed is exactly what the other user reported on their GitHub, but since I hadn't caught that message so far I didn't connect the dots.

                                I'm using the standard flags for the RetroPie module:

                                https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/libretrocores/lr-mame2010.sh

                                I don't know the compilation flags by heart, but from a sample compilation line in the logs, I get these:

                                -- building for platform "unix"

                                g++ -DCRLF=2 -DDISABLE_MIDI=1 -DINLINE="static inline" -DNDEBUG  -DFLAC__NO_DLL -DNATIVE_DRC=drcbe_x86_be_interface -DDISABLE_MIDI -DGIT_VERSION=\"" 1fd4de5"\" -D__LIBRETRO__ -fsigned-char -finline  -fno-common -fno-builtin -fweb -frename-registers -falign-functions=16 -fsingle-precision-constant -D__LIBRETRO__ -fstrict-aliasing -fno-merge-constants -DALIGN_INTS -DALIGN_SHORTS  -ffast-math   -fPIC -pipe -O3 -fno-strict-aliasing -march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -O2 -pipe -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -I./src/osd/retro/libretro-common/include -I./src/mame -Iobj/retro/mame/layout -I./src/emu -Iobj/retro/emu -Iobj/retro/emu/layout -I./src/lib/util -I./src/lib -I./src/osd -I./src/osd/retro -I./src/lib/expat -I./src/lib/util -I./src/lib/libjpeg -fno-delete-null-pointer-checks  -x c++ -std=gnu++98 -Woverloaded-virtual -DARM_ENABLED -c src/osd/retro/retromain.c -o obj/retro/osd/retro/retromain.o
                                

                                Anything on your mind or catching your eye?

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

                                  yea can you compile from the makefile i provided above

                                  ok updated the makefile for pi 4

                                  wget https://github.com/grant2258/mame2010-libretro/raw/b430fd1300f8c1d38c3a3bab45ad81fa1a09b460/Makefile

                                  make platform=rpi4 -j4

                                  be sure to copy this over the original Makefile

                                  execute with

                                  opt/retropie/emulators/retroarch/bin/retroarch -L ./mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"

                                     ARM_ENABLED = 1
                                     X86_SH2DRC = 0
                                     FORCE_DRC_C_BACKEND = 1
                                  

                                  -DNATIVE_DRC=drcbe_x86_be_interface is wrong for arm please compile test and let @mitu know if it fixes it these parameters can be added to the script module.

                                  ps i dont have a pi4 so cant test it :(

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

                                    @grant2258 thanks. I'll test tomorrow as it's late here and tomorrow is a work day, but I'll let you know how it goes and update the scriptmodule if/as needed. Thanks for the guidance here!

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

                                      well its just a guess at this point we defo need to force these settings for arm though worth a try. Stay safe going out there!

                                      like i said i dont have a pi 4 and have no idea what kernel its on.

                                      if the first make command didnt give you any joy try.

                                      make platform=rpi4 PTR64=1

                                      I really would need a pi4 and use asan to see whats going on beyond that

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

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

                                        make platform=rpi4 PTR64=1

                                        Morning!

                                        Thanks for the pointers - no pun intended. :)

                                        The first make command resulted in the same exceptions.

                                        The second one didn't compile with a nice error message:

                                        src/emu/validity.c:33:57: error: size of array 'your_ptr64_flag_is_wrong' is negative
                                        

                                        :D

                                        It isn't a tremendous problem right now, as most things do get edited in the RetroArch menu, but indeed can be problematic if someone wants to get into more detailed controls customization.

                                        To be clear, all the menus and sub-menus work other than any that list inputs to be redefined, so it's probably something finicky around filling out the list of available inputs and descriptors.

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

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

                                          make platform=rpi4 PTR64=1

                                          make platform=rpi4 PTR64=0 ill look at the code when i get time not really touched this core apart from the input fixes

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

                                            make platform=rpi4 should be working its identical to rp3 apart from the optimization flags. If your sure the file didnt go to Makefile.1 with the wget do a make platform=rpi4 PTR64=0 as a last try

                                            this is what im getting when compiling it on my pi with make platform=rpi4 with the makefile

                                            g++ -DCRLF=2 -DDISABLE_MIDI=1 -DINLINE="static inline" -DNDEBUG -DFLAC__NO_DLL -DDISABLE_MIDI -DGIT_VERSION="" b430fd1"" -D__LIBRETRO__ -fomit-frame-pointer -ffast-math -fsigned-char -march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -fPIC -pipe -O3 -fno-strict-aliasing -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -I./src/osd/retro/libretro-common/include -I./src/mame -Iobj/retro/mame/layout -I./src/emu -Iobj/retro/emu -Iobj/retro/emu/layout -I./src/lib/util -I./src/lib -I./src/osd -I./src/osd/retro -I./src/lib/expat -I./src/lib/util -I./src/lib/libjpeg -fno-delete-null-pointer-checks -x c++ -std=gnu++98 -Woverloaded-virtual -DARM_ENABLED -DDISABLE_SH2DRC -c src/osd/retro/retrosync.c -o obj/retro/osd/retro/retrosync.o

                                            ill just compile the bin and add it to my git for you to test if your ok with that

                                            ok here is the bin if you could test it (had to zip it github has a 50 meg limit)

                                            wget https://github.com/grant2258/mame2010-libretro/raw/input/pi4.zip

                                            code for this branch is here if it doesnt work i give up for now :)

                                            https://github.com/grant2258/mame2010-libretro/tree/input

                                            pjftP 1 Reply Last reply Reply Quote 1
                                            • 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.