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

    Cant get controls to work correctly using a J-Pac with lr-mame2003

    Scheduled Pinned Locked Moved Help and Support
    j-pacretroarch ipacipac controlslr-mame2003
    13 Posts 4 Posters 3.8k 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.
    • C
      Chewable
      last edited by

      I have wired my cabinet with a Jamma Harness and I am using a J-Pac to interface with the controls. I did this so I could use Jamma carts from time to time as well.
      I am using a Raspberry Pi 3 and RetroPi 4.1.13.

      Here is a picture of exactly how my controls are set up in the J-Pac
      0_1489371876760_iPac controls.png

      I set up the controls exactly the same in Retroarch and through the sub-menu in the emulator (from inside the game).

      What happens is that all the buttons are recognized but they are not in the correct places.
      LAlt - becomes button #1 (or when I press button #2 it thinks I am pressing #1)
      Button #5 shows up as #4

      I am not sure what to do here. I know that the mapping seems to be working but why it will not map the correct buttons is beyond me at this point.

      I am not having issues in the other emulators or in other games so much it really seems to be something with the 6-button games or maybe it is just CPS2 games that are causing this.

      I have played a lot of standard arcade games and this is not an issue.

      I am using lr-mame2003. If I should be using a different emulator which one should I try first? I have had bad luck in the past getting controls to map in FBA so I have avoided using that.

      1 Reply Last reply Reply Quote 0
      • C
        Chewable
        last edited by Chewable

        Ok typing all of this out made me think about it differently.

        It does seem to be a thing with the specific emulator lr-mame2003.

        The only other emulator I can get to play the game it seems is: AdvanceMame 0.94

        Using that emulator I can get the controls to work correctly, but there are some other issues. The exiting of the game is different and the video is not as good. I have tried a bunch of different video modes and none of them really look as good as the lr-mame2003 default.

        By the way my Roms are "MAME2003_Reference_Set_MAME0.78_ROMs".

        Any help at better understanding what is going on in lr-mame2003 is really appreciated. At least for now I have a work around that I can make work ok.

        edmaul69E 1 Reply Last reply Reply Quote 0
        • edmaul69E
          edmaul69 @Chewable
          last edited by edmaul69

          @Chewable the mame emulators have always been an issu.e i play street fighter 2 to test. Since you know which buttons are a b x y l r you write down what button does which punch or kick and which button it is on. So if you set it as say:
          A B X
          Y L R
          Which in street fighter should be
          Lp mp hp
          Lk mk hk
          So if in testing it comes out like say
          Hk lp mk
          Mp hp mk
          Then you need to make a manual configuration in the mame-libretro retroarch.cfg setting it to swapping the buttons to match the correct location. So in this casenario i made you would configure the buttons to the location they need to be. In this example it would be:
          R Y L
          B X A
          So in this example whatever button you assigned to A would actually get reassigned to R what you assigned to B would get assigned to Y, etc, etc....

          1 Reply Last reply Reply Quote 0
          • C
            Chewable
            last edited by

            I have tried that.

            There is actually another issue in the software - sometimes is shows multiple button hits so when you hit button 2 it will register as button 3 & 4 not just one button.

            I tried to reset it a few different ways and it does not seem to just be a simple re-map.

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

              @Chewable you might have stumbled into an issue I discovered a while back when I was trying to setup a special mapping in MAME2003 using a <CODE_NOT> technique. Basically, I was setting up a complex control input configuration for arcade games like Vindicators that use dual sticks to steer a tank. Using Boolean AND and OR settings, it is possible to steer a tank using a single joystick and the mapping converts 8-way inputs on a single stick into the dual tankstick inputs. Got all of that?

              So, my problem described here was that because I was using a keyboard controller (early model IPAC4) and I had configured retroarch inputs already, lr-mame2003 was seeing two inputs for every one--first via retroarch virtual gamepad, and second, the actual raw keyboard key press. We confirmed this at about post 29 in that thread. I could not use MAME's <CODE_NOT> mapping technique (a double-tap) because it was always detecting two simultaneous inputs. The workaround was to map evrything for Player 1 to "nul" in the retroarch config (I actually just used a per-rom .cfg for the games in question). With player 1 inputs mapped to NUL according to retroarch, MAME only saw my raw key presses, and I was able to setup the tankstick mapping no problem.

              It also turns out that despite the double inputs when using a keyboard, MAME is not causing the game to trigger double actions. For most cases, the simultaneous inputs are just seen as an AND pair and together, they trigger single action in the game when pressed.

              Sorry if this is confusing. Most people are not doing complex Boolean input mapping, but if you do, and you use a keyboard, you run into problems and this is the reason. It also explains why you are seeing two inputs. I logged it as an issue, but I doubt it is being addressed. Besides, it is not really doing harm--just confusing some of us with keyboard controllers.

              In your case, it is important to recognize that MAME2003 is seeing the raw keys and the retroarch virtual inputs at the same time. You could block the virtual inputs like I did by setting everything to NUL. Then when you hit TAB and map buttons in the MAME GUI menu, you will only see the inputs you expect from your winipac configuration.

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

              1 Reply Last reply Reply Quote 0
              • C
                Chewable
                last edited by

                That is super interesting.

                I will now have to try that.

                For now I ended up doing what I did not want to do, which is I am using Final Burn Alpha for the 6 button games.

                My guess is that this is why few people seem to discuss this issue is that they just go over to that. I would like to get it working in lr-mame2003 and will try that "NUL" idea.

                I have now gotten everything to at least work and made an image of the drive so I can now really go about messing it up......

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

                  @Chewable You should not have to use Final Burn for 6-button games if you don't want to. Given your image from WinIPAC, I assume this is a layout for ipac switches 1,2,3 4,5,6 7,8 for players 1 and 2. I am curious what you have in your /opt/retropie/configs/all/retroarch.cfg for mapping these to ABXYLR etc. as I suspect we have similar configs. Even with the dual mapping that appears in the GUI menu in lr-mame2003, it still follows MAME defaults, and most games work. Those that are mixed up would be anyway, even without retroarch and virtual gamepad inputs. Mapping controls right there in the MAME gui works for most games.

                  Yet, to get it really clean, you could just build a per-rom cfg. file (i.e. sf2.zip.cfg) and override all of the inputs for player 1 and 2 buttons by setting them to "nul". Then, if you have to map controls in the MAME gui, you only see the raw keypresses.

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

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

                    it should be possible to disable mame2003's double keyboard stuff. i'll look into the this.

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

                      @dankcushions That would be cool!

                      One of the pieces of documentation that goes hand in hand with this is the "missing" controller diagram for arcade. We have the concept of UP DOWN LEFT RIGHT which maps easily enough, but what are the default mapping of retropad ABXYLR to the buttons 1,2,3,4,5,6 etc. in MAME? I don't know if I have seen that listed anywhere, but it must exist for every MAME libretro core, right? But what about the equivalent for pressing TAB? Is there a RetroArch "invoke core MENU" input? I am just thinking "out loud" here about how it could/should work.

                      Could you ignore retropad inputs if they come from a keyboard device? Do gamepads show up in lr-mame2003 differently than keyboard-generated retropad inputs? I only use a keyboard controller right now so I have not looked.

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

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

                        @caver01 Seems like you would either have to block the retropad virtual keyboard, or block the raw keyboard. Either, way, we will have use cases that present specific challenges to overcome. Yet, hasn't this been solved in more recent lr-mame cores?

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

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

                          the more i think about it, the less i think this is a core problem really. retroarch maps a keyboard to both a virtual keyboard, and a virtual joypad. mame2003 is capable of reading from both but it shouldn't have to make a decision as to what is 'valid' or not. if this is an issue i think it needs to be raised in retroarch, but i think they will just say to sort it out via the config.

                          The workaround was to map evrything for Player 1 to "nul" in the retroarch config

                          this makes sense to me. now your keyboard is only mapped to a virtual keyboard, rather than two things.

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

                            @dankcushions said in Cant get controls to work correctly using a J-Pac with lr-mame2003:

                            the more i think about it, the less i think this is a core problem really. retroarch maps a keyboard to both a virtual keyboard, and a virtual joypad. mame2003 is capable of reading from both but it shouldn't have to make a decision as to what is 'valid' or not. if this is an issue i think it needs to be raised in retroarch, but i think they will just say to sort it out via the config.

                            The workaround was to map evrything for Player 1 to "nul" in the retroarch config

                            this makes sense to me. now your keyboard is only mapped to a virtual keyboard, rather than two things.

                            I don't mind the workaround, as I can make sense of it and get what I need out of the controls mapping process. However, didn't we determine that newer cores behave differently? I am not able to test right now, but I thought it was maybe lr-mame2010 that did not have the double inputs with keyboard.

                            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 i'm unable to test either but if mame2010 does something different i could look into it, but i would have thought it wouldn't be respecting the api if it did anything different!

                              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.