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 speeding up with B-button press

    Scheduled Pinned Locked Moved Help and Support
    lr-mame2003speedbutton
    22 Posts 8 Posters 7.0k 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.
    • RumblinBuffaloR
      RumblinBuffalo
      last edited by

      Pi Model or other hardware: RPi 3
      Power Supply used: 2.5A
      RetroPie Version Used: 4.1
      Built From: Pre made SD Image on RetroPie website
      Controller: iBuffalo Classic USB Gamepad

      I recently began using lr-mame 2003 as my primary arcade emulator, and I've noticed in several (all?) games, the B-button (which is probably the most commonly used fire/punch button for most games), seems to create a very short "speed-up" effect in the games. I've noticed it in several games, but my best example of this would probably be playing Joust. This game needs repeated B-button presses to fly, and with each press the game speeds up for a split second and as a result, the bird flies too quickly. I tried it in Pacman as well, and even though there is no key mapped, the B-button still causes the brief turbo/frameskip effect.

      My initial thought was that my gamepad had a turbo function on but this does not seem to happen using lr-mame4all (or any other console emulators).

      My best guess is maybe because the MAME UI (tab menu) has the B button also mapped to "back-up" or "exit" the tab menu, that the double-mapping causes the effect. However, I didn't want to start editing configs without at least checking here first to see if anyone has noticed this. Possibly it's specific to my gamepad but seems unlikely. I've searched all over but haven't seen this posted anywhere. Has anyone seen this behavior?

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

        @RumblinBuffalo It sounds like you have a fast forward function enabled somewhere, either for that emulator or in a retroarch.cfg.

        I would start at the MAME GUI menu <tab> and see if you can find a mapping in that game for Fast Forward. I thought I remember this was once mapped to INS <Insert> on a keyboard by default. Perhaps you inadvertently mapped it to something you use for other controls in that game. It is possible to have the same button doing two things, FIRE for example, and FAST FORWARD with one press of the button. You could just delete the .cfg file for that game inside the mame2003 folder that gets created inside the ROMs folder. I don't remember if mame creates a config or cfg folder, but inside that, it puts .cfg files to save settings per rom. These are not retroarch configs, but MAME files that get created when you make key mapping changes. Anyway, rename or delete the one for your game and see if the problem is fixed.

        Next, I would start looking at retroarch.cfg files, starting with the /opt/retropie/configs/all/retroarch.cfg file. Look for:

        # Toggles between fast-forwarding and normal speed
        # input_toggle_fast_forward = space
        
        # Hold for fast-forward. Releasing button disables fast-forward
        # input_hold_fast_forward = l
        

        In this example, the lines are commented out with #, but yours might not be. You could set these lines = nul which would stop the effect if it is Retroarch. If you don't see the problem in that file, check in /opt/retropie/configs/arcade/retroarch.cfg or /opt/retropie/configs/mame-libretro/retroarch.cfg depending on your setup. It has to be one of these.

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

        1 Reply Last reply Reply Quote 0
        • RumblinBuffaloR
          RumblinBuffalo
          last edited by

          @caver01 I greatly appreciate the response and suggestions. The key to the whole issue was that it was only Mame 2003. lr-Mame4all did not exhibit the problem, nor did any of the consoles.

          Turns out it was the UI back/exit key in the Mame 2003 UI (tab menu). Initially, the UI back/exit key was set to "ESC or gamepad-B". I tested with Ms Pacman. Without touching the gamepad, I pressed ESC repeatedly and sure enough, the game sped-up with each press. When I re-mapped the UI exit/back function away from the B button (I chose L1), the problem followed that button.

          So the solution for me, was to re-map the "UI escape/back" function to another button in the Mame UI (tab) menu.

          I only started using Mame2003 about 2 months ago (mainly to try @dankcushions shader overrides), and I noticed the problem right away (with a clean 4.1 image install) but I initially thought it was only certain roms. I hadn't realized it was with every press of the B button. Joust was the most noticeable since you press B constantly to fly.

          Hopefully this info helps somebody out, if they ever happen to see this issue pop up.

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

            this is interesting. i can't see why this would happen, but i will test myself. "UI cancel" should have no impact on game speed, and B would be a button i press all the time, so i assume it's something specific with your setup.

            but yeah, if anyone else could test that would be helpful! i will try and do the same soon.

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

              I would test, but my image is a few revs back, kept updated. Also, as an iPAC user, I have a dedicated button <ESC> to exit the core which overrides the MAME "back/exit" so I always just navigate to the "previous menu" choice in the GUI. It seems like you would quickly get into trouble trying to map a button to a game control if that same button is already mapped to the UI "back/exit".

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

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

                @caver01 said in LR-MAME2003 speeding up with B-button press:

                It seems like you would quickly get into trouble trying to map a button to a game control if that same button is already mapped to the UI "back/exit".

                to be clear, the 'ui cancel' button is not the 'exit mame' button. in fact, it is mapped to button 1 (retropad b) by default.
                https://github.com/libretro/mame2003-libretro/blob/7b55725e744ac9702db092f996e2fca2276146b2/src/inptport.c#L213
                and
                https://github.com/libretro/mame2003-libretro/blob/master/src/libretro/joystick.c#L18

                so yeah, if this was an issue it should be affecting everyone with a default setup.

                GtBFilmsG caver01C 2 Replies Last reply Reply Quote 0
                • GtBFilmsG
                  GtBFilms @dankcushions
                  last edited by

                  @dankcushions

                  I noticed this with Pacman. Didn't think anything of it, as I don't usually press that button (as Pacman doesn't have ANY buttons mapped, apart from insert coin and P1 start I guess).

                  Just thought it was a weird one-off.

                  I'll try it again tonight.

                  1 Reply Last reply Reply Quote 0
                  • RumblinBuffaloR
                    RumblinBuffalo
                    last edited by

                    so yeah, if this was an issue it should be affecting everyone with a default setup

                    @dankcushions I would agree. I can tell you I first noticed this when I first setup my fresh 4.1 install. Testing "Mat Mania" was the first game I noticed. Every time I pressed the B (punch button) I could hear the music speed up slightly. I thought it was just the rom so I used lr-mame4all for that rom and it was fine. Then I started noticing it with others.

                    Last night, when I narrowed it down, I was able to reproduce the issue with Ms Pacman, without even playing. I just let the demo run, and started pressing the ESC key on my keyboard (mapped to the UI back button) and I could see tiny speed bursts in the game. With a game running, you can actually hear it.

                    I'll wait till you've tested, but I can't figure out what I might have set different that wouldn't be default for everyone. I had basically setup my gamepad (basic setup, no problems) and the shader override configs when I first noticed.

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

                      SOLVED:
                      https://github.com/libretro/mame2003-libretro/blob/7b55725e744ac9702db092f996e2fca2276146b2/src/drivers/pacman.c#L1016

                      there's a speedup hack in pacman + ms pacman that is bound to button1.

                      GtBFilmsG RumblinBuffaloR 2 Replies Last reply Reply Quote 2
                      • GtBFilmsG
                        GtBFilms @dankcushions
                        last edited by GtBFilms

                        @dankcushions

                        Wow, nicely discovered!

                        Thanks!

                        1 Reply Last reply Reply Quote 0
                        • W
                          windale
                          last edited by

                          There is also something similar in the game Track & Field and/or Hypersports ? One of the buttons is mapped to a 'Run Like Hell' cheat, which needs to be turned off/remaped for most of the events and entering your name

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

                            @dankcushions said in LR-MAME2003 speeding up with B-button press:

                            to be clear, the 'ui cancel' button is not the 'exit mame' button. in fact, it is mapped to button 1 (retropad b) by default.

                            That makes sense. I made it more confusing, partly because while navigating the GUI menus in AdvanceMAME, you can back out of the menus with <ESC> which is also the EXIT key. I always forget it works differently in the lr-mame2003 GUI

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

                            1 Reply Last reply Reply Quote 0
                            • RumblinBuffaloR
                              RumblinBuffalo @dankcushions
                              last edited by

                              @dankcushions said in LR-MAME2003 speeding up with B-button press:

                              SOLVED:
                              https://github.com/libretro/mame2003-libretro/blob/7b55725e744ac9702db092f996e2fca2276146b2/src/drivers/pacman.c#L1016

                              there's a speedup hack in pacman + ms pacman that is bound to button1.

                              I'm not sure this is the same issue that I am indicating. I'll try a few more roms later - and provide examples - but I have seen this issue in far more than just Pacman/MsPacman. I know that Mat Mania, Dig Dug, Joust and others all had the same issue, and as soon as I removed "B" from the mapping for "UI back" the problem went away. And tapping the ESC key (still mapped to "UI back") still showed the issue.

                              I agree that it makes no sense that "UI back" should do anything in the game, but in my experience it seems to skip a frame or create a split-second speed-up.

                              1 Reply Last reply Reply Quote 0
                              • RumblinBuffaloR
                                RumblinBuffalo
                                last edited by

                                I tested a few more roms tonight.

                                Just to be sure, in the Mame2003 UI, I have mapped "UI back" to the ESC key and to the retropad button L1.

                                "Ui back" should have no effect on games, but with all games I tested, I could see/hear the speed up effect by pressing the L1 button on my gamepad. I tested Dig Dug, Frogger, Ghouls 'n Ghosts, and Kung Fu Master. It also happened with the ESC key, which should eliminate my gamepad as a cause.

                                I really don't believe I have any setting changed from the default in Mame2003 that would cause this, but the fix was easy enough (just make sure I un-map the "UI back" command away from any gamepad buttons that are used).

                                I will mention the effect is very subtle, so it's possible with many games in Mame2003, perhaps people just don't notice. It took me 2 months to realize it was with every rom.

                                As always - appreciate all the responses and efforts.

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

                                  @RumblinBuffalo said in LR-MAME2003 speeding up with B-button press:

                                  I tested a few more roms tonight.

                                  Just to be sure, in the Mame2003 UI, I have mapped "UI back" to the ESC key and to the retropad button L1.

                                  "Ui back" should have no effect on games, but with all games I tested, I could see/hear the speed up effect by pressing the L1 button on my gamepad. I tested Dig Dug, Frogger, Ghouls 'n Ghosts, and Kung Fu Master. It also happened with the ESC key, which should eliminate my gamepad as a cause.

                                  I really don't believe I have any setting changed from the default in Mame2003 that would cause this, but the fix was easy enough (just make sure I un-map the "UI back" command away from any gamepad buttons that are used).

                                  I will mention the effect is very subtle, so it's possible with many games in Mame2003, perhaps people just don't notice. It took me 2 months to realize it was with every rom.

                                  As always - appreciate all the responses and efforts.

                                  assuming you mean "UI Cancel" rather than "UI back" (which i don't think exists?) i think i see where your issue MIGHT be: https://github.com/libretro/mame2003-libretro/blob/7b55725e744ac9702db092f996e2fca2276146b2/src/usrintrf.c#L3856

                                  i need to confirm, but i'm sure your right. it does look like it's polling UI_CANCEL every frame for whatever reason.

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

                                    @dankcushions said in LR-MAME2003 speeding up with B-button press:

                                    it does look like it's polling UI_CANCEL every frame for whatever reason.

                                    It looks like that check is there to accept UI_CANCEL for when/if the OSD MENU is open. If it is, it triggers the menu to close, screen to refresh.

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

                                    1 Reply Last reply Reply Quote 0
                                    • RumblinBuffaloR
                                      RumblinBuffalo
                                      last edited by

                                      @dankcushions You're right - I meant UI_CANCEL.

                                      So if I understand correctly, the theory is that polling allows the UI-CANCEL command to be activated/triggered by the button press (even when the UI menu isn't present), thus causing the tiny frame jump that I kept seeing?

                                      Thanks as always for your efforts.

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

                                        This is now fixed! please update mame2003 from source to get the fix straight away (takes about 40 minutes to install)

                                        Thanks very much to @RumblinBuffalo for the good spot and report!This was a bit of a clunky bug that would have gone missed without your attention :)

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

                                          @dankcushions thanks for the quick turnaround! I have updated though I haven't tried it yet. Have a great weekend :)

                                          1 Reply Last reply Reply Quote 1
                                          • RumblinBuffaloR
                                            RumblinBuffalo
                                            last edited by RumblinBuffalo

                                            @dankcushions Glad to be of assistance and thanks for the quick attention and update. I'll say it again - the efforts of the Retropie team and this community are really impressive! Many thanks!

                                            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.