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-mupen64plus-next and N64 controller input issues

    Scheduled Pinned Locked Moved Help and Support
    lr-mupen64plusretrolinkautoconfigb buttonissue
    21 Posts 8 Posters 9.1k 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.
    • B
      badviper @mitu
      last edited by badviper

      @mitu here's what the RetroArch RGUI had for controller mappings. The game's B button was mapped to some "Y button (left)", and the physical A button on the controller was mapped to (C1), whatever that is; Google Drive Link.

      And the mappings you had me check in es_input.cfg are exactly as they should be:

      <?xml version="1.0"?>
      <inputList>
        <inputAction type="onfinish">
          <command>/opt/retropie/supplementary/emulationstation/scripts/inputconfiguration.sh</command>
        </inputAction>
        <inputConfig type="joystick" deviceName="Generic   USB  Joystick  " deviceGUID="03000000790000000600000010010000">
          <input name="rightanalogup" type="button" id="0" value="1"/>
          <input name="pageup" type="button" id="4" value="1"/>
          <input name="rightanalogdown" type="button" id="2" value="1"/>
          <input name="up" type="hat" id="0" value="1"/>
          <input name="left" type="hat" id="0" value="8"/>
          <input name="rightanalogleft" type="button" id="3" value="1"/>
          <input name="leftanalogdown" type="axis" id="1" value="1"/>
          <input name="leftanalogright" type="axis" id="0" value="1"/>
          <input name="right" type="hat" id="0" value="2"/>
          <input name="leftanalogleft" type="axis" id="0" value="-1"/>
          <input name="rightanalogright" type="button" id="1" value="1"/>
          <input name="pagedown" type="button" id="5" value="1"/>
          <input name="leftanalogup" type="axis" id="1" value="-1"/>
          <input name="down" type="hat" id="0" value="4"/>
          <input name="start" type="button" id="9" value="1"/>
          <input name="b" type="button" id="8" value="1"/>
          <input name="a" type="button" id="6" value="1"/>
        </inputConfig>
      </inputList>
      

      I'll try that config file from the database on both setups and see if that yields any different results.

      1 Reply Last reply Reply Quote 0
      • B
        badviper @mitu
        last edited by badviper

        @mitu reporting back after using the input file you linked, which does match the button mappings. While it's cleaner and easier to read in the RetroArch RGUI, the result is identical; Google Drive Link

        And to answer your earlier question about A and B controls with this Retrolink N64 controller on other RetroArch cores, here is the button mapping in lr-gambatte, which is indeed correct; Google Drive Link

        Again, really appreciate your help with this, I'm honestly stumped.

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

          Weird behavior, indeed. Looking at how the gamepad configuration is reported for my controller, the only difference I see is that all buttons are marked with Auto (i.e. taken from the gamepad auto-config file), while on yours some buttons are not (Y Button, Select, X button).
          ec5050cc-d2d2-428a-b131-4ed3a3aef599-image.png.

          Can you try resetting the RetroArch's main configuration file (/opt/retropie/configs/all/retroarch.cfg) to default - copy over the retroarch.cfg.rp-dist and see if it makes a difference.

          B 1 Reply Last reply Reply Quote 0
          • B
            badviper @mitu
            last edited by

            @mitu resetting RetroArch's main configuration yielded the same results. I think I figured it out though...

            Looking back at the wiki, I decided to try the mapping that was documented for Mupen64plus, where the game's A and X buttons are mapped to controller's C down and C left, respectively. After firing up the game, the controller's A and B buttons worked as expected! So it looks like the mapping of B and Y buttons in RetroPie/ES are being mapped to the game's A and B buttons in lr-mupen64plus and lr-mupen64plus-next, respectively. Given that, the documentation for lr-mupen64plus is outdated.

            So I'll go ahead and mark this as solved and thank you for your help!

            In case anyone stumbles upon this thread later having issues with your Retrolink N64 controller button mapping, here is my recommended joystick config:

            input_device = "Generic   USB  Joystick  "
            input_driver = "udev"
            input_device_display_name = "Retrolink N64 USB controller"
            
            input_vendor_id = 121
            input_product_id = 6
            
            input_up_btn = "h0up"
            input_down_btn = "h0down"
            input_left_btn = "h0left"
            input_right_btn = "h0right"
            input_l_y_minus_axis = "-1"
            input_l_x_plus_axis = "+0"
            input_l_y_plus_axis = "+1"
            input_l_x_minus_axis = "-0"
            input_r_y_minus_btn = "0"
            input_r_x_plus_btn = "1"
            input_r_y_plus_btn = "2"
            input_a_btn = "2"
            input_r_x_minus_btn = "3"
            input_x_btn = "3"
            input_l_btn = "4"
            input_r_btn = "5"
            input_b_btn = "6"
            input_l2_btn = "7"
            input_y_btn = "8"
            input_start_btn = "9"
            input_enable_hotkey_btn = "9"
            input_state_slot_decrease_btn = "h0left"
            input_state_slot_increase_btn = "h0right"
            input_menu_toggle_btn = "3"
            input_load_state_btn = "4"
            input_save_state_btn = "5"
            input_reset_btn = "8"
            input_exit_emulator_btn = "7"
            
            input_b_btn_label = "B"
            input_y_btn_label = "Y"
            input_x_btn_label = "X"
            input_start_btn_label = "Start"
            input_up_btn_label = "D-Pad Up"
            input_down_btn_label = "D-Pad Down"
            input_left_btn_label = "D-Pad Left"
            input_right_btn_label = "D-Pad Right"
            input_a_btn_label = "A"
            input_l_btn_label = "L"
            input_r_btn_label = "R"
            input_l2_btn_label = "Z"
            input_l_x_plus_axis_label = "Joystick Right"
            input_l_x_minus_axis_label = "Joystick Left"
            input_l_y_plus_axis_label = "Joystick Down"
            input_l_y_minus_axis_label = "Joystick Up"
            input_r_x_plus_btn_label = "C Right"
            input_r_x_minus_btn_label = "C Left"
            input_r_y_plus_btn_label = "C Down"
            input_r_y_minus_btn_label = "C Up"
            
            1 Reply Last reply Reply Quote 0
            • P
              ptindian95
              last edited by ptindian95

              This thread has been exactly what I'm looking for! I've been having the same problems listed here.

              @badviper I replaced my ~/.config/retroarch/autoconfig/ Generic\ \ \ USB\ \ Joystick\ \ .cfg with exactly what you listed above and playing the roms works great! The only problem is when you open the RetroArch RGUI, the controls are all wonky. I have a hunch that it's reading mappings from this file instead: opt/retropie/configs/n64/InputAutoCfg.ini, and my mappings in that file are probably still wrong.
              Do you mind posting what you have in that file?

              B 1 Reply Last reply Reply Quote 0
              • B
                badviper @ptindian95
                last edited by

                @ptindian95 glad you were able to benefit from this! I love the community and when people can find solutions to their issues.

                I also experience issues with the RetroArch RGUI (for instance the C-down button controlling "A" in the menu). I honestly doubt that it's getting the mapping from InputAutoCfg.ini as it's a mupen64plus-specific configuration. Regardless, here is my config file (excluding other controllers):

                ; InputAutoCfg.ini for Mupen64Plus SDL Input plugin
                
                ; Generic   USB  Joystick  _START 
                [Generic   USB  Joystick  ]
                plugged = True
                plugin = 2
                mouse = False
                AnalogDeadzone = 4096,4096
                AnalogPeak = 32768,32768
                Mempak switch = 
                Rumblepak switch = 
                L Trig = button(4) 
                Start = button(9) 
                C Button U = button(0) 
                C Button L = button(3) 
                DPad D = hat(0 Down) 
                X Axis = axis(0-,0+)
                R Trig = button(5) 
                DPad R = hat(0 Right) 
                DPad L = hat(0 Left) 
                Z Trig = button(7) 
                Y Axis = axis(1-,1+)
                DPad U = hat(0 Up) 
                C Button D = button(2) 
                A Button = button(6) 
                B Button = button(8) 
                C Button R = button(1) 
                ; Generic   USB  Joystick  _END 
                
                P 1 Reply Last reply Reply Quote 1
                • P
                  ptindian95 @badviper
                  last edited by

                  @badviper Yeah you're right, messing with my InputAutoCfg.ini just messed everything up. I think I've just decided to accept that the RetroArch RGUI has different controls (exactly like you explained with C-Down controlling A in the menu). Small price to pay for the mappings working in the actual game. Thanks again!

                  1 Reply Last reply Reply Quote 0
                  • neekN
                    neek
                    last edited by

                    I also just wanted to chime in and say I bumped into this exact issue, and after hunting around for a few days, I found this thread and had it fixed in a few seconds. I appreciate you posting a follow-up for the community.. it helped me a lot!

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      Alien @neek
                      last edited by

                      @neek said in lr-mupen64plus-next and N64 controller input issues:

                      I also just wanted to chime in and say I bumped into this exact issue, and after hunting around for a few days, I found this thread and had it fixed in a few seconds. I appreciate you posting a follow-up for the community.. it helped me a lot!

                      +1 here, this solution made my day. Thanks a lot!

                      1 Reply Last reply Reply Quote 0
                      • B
                        bmay
                        last edited by

                        @badviper's configuration also fixed a similar problem that I had with the n64 retrolink z button not being mapped on my second player controller. Thanks!

                        1 Reply Last reply Reply Quote 0
                        • F
                          floppes
                          last edited by

                          I had a very similar issue with my "HuiJia USB GamePad" adapter. That's a USB adapter for two original N64 controllers:

                          pa.157164.3.jpg

                          I had no issues so far with Mupen64Plus on a Rasperry Pi 3. After switching to a Raspberry Pi 4 and the latest RetroPie 4.7.1, I started using lr-mupen64plus-next. The B button acted like it was the A button and no button would act like the B button.

                          @badviper s findings helped me solve it: I had to remap the B button and add a fake Y button. Additionally, I increased the analog sensitivity because the raw analog values would max out at about -22000/+22000 and in most games navigating the menus wasn't possible.

                          I have the impression that the two controls graphics in the docs should be switched.

                          Here are my config files for anyone facing the same issues with the HuiJia adapter and mupen64plus-next:

                          configs/all/retroarch/autoconfig/HuiJia USB GamePad.cfg: (note that there are two spaces between 'HuiJia' and 'USB', but the forum shows only one)

                          input_device = "HuiJia  USB GamePad"
                          input_driver = "udev"
                          input_a_btn = "1"
                          input_b_btn = "2"
                          input_l_btn = "6"
                          input_r_btn = "7"
                          input_l2_btn = "8"
                          input_start_btn = "9"
                          input_up_btn = "h0up"
                          input_down_btn = "h0down"
                          input_left_btn = "h0left"
                          input_right_btn = "h0right"
                          input_r_y_plus_axis = "+2"
                          input_r_y_minus_axis = "-2"
                          input_r_x_plus_axis = "-3"
                          input_r_x_minus_axis = "+3"
                          input_l_y_plus_axis = "+1"
                          input_l_y_minus_axis = "-1"
                          input_l_x_plus_axis = "+0"
                          input_l_x_minus_axis = "-0"
                          
                          input_enable_hotkey_btn = "8"
                          input_exit_emulator_btn = "9"
                          
                          input_a_btn_label = "A"
                          input_b_btn_label = "B"
                          input_x_btn_label = "X"
                          input_y_btn_label = "Y"
                          input_l_btn_label = "L"
                          input_r_btn_label = "R"
                          input_l2_btn_label = "Z"
                          input_start_btn_label = "Start"
                          input_up_btn_label = "D-Pad Up"
                          input_down_btn_label = "D-Pad Down"
                          input_left_btn_label = "D-Pad Left"
                          input_right_btn_label = "D-Pad Right"
                          input_l_x_plus_axis_label = "Joystick Right"
                          input_l_x_minus_axis_label = "Joystick Left"
                          input_l_y_plus_axis_label = "Joystick Down"
                          input_l_y_minus_axis_label = "Joystick Up"
                          input_r_x_plus_btn_label = "C Right"
                          input_r_x_minus_btn_label = "C Left"
                          input_r_y_plus_btn_label = "C Down"
                          input_r_y_minus_btn_label = "C Up"
                          
                          

                          configs/n64/retroarch.cfg:

                          # Settings made here will only override settings in the global retroarch.cfg if placed above the #include line
                          
                          input_remapping_directory = "/opt/retropie/configs/n64/"
                          
                          input_player1_b_btn = "1"
                          input_player1_y_btn = "2"
                          
                          input_player2_b_btn = "1"
                          input_player2_y_btn = "2"
                          
                          input_analog_sensitivity = "1.400000"
                          
                          #include "/opt/retropie/configs/all/retroarch.cfg"
                          

                          configs/n64/InputAutoCfg.ini (just for reference as this is not used by lr-mupen64plus-next, only by Mupen64Plus):

                          ; InputAutoCfg.ini for Mupen64Plus SDL Input plugin
                          
                          ; HuiJia  USB GamePad_START 
                          [HuiJia  USB GamePad]
                          plugged = True
                          plugin = 2
                          mouse = False
                          AnalogDeadzone = 1024,1024
                          AnalogPeak = 19000,19000
                          Mempak switch = 
                          Rumblepak switch = 
                          DPad L = hat(0 Left) 
                          DPad R = hat(0 Right) 
                          DPad U = hat(0 Up) 
                          DPad D = hat(0 Down) 
                          C Button U = axis(2-) 
                          C Button D = axis(2+) 
                          C Button L = axis(3+) 
                          C Button R = axis(3-) 
                          L Trig = button(6) 
                          Z Trig = button(8) 
                          R Trig = button(7) 
                          Start = button(9) 
                          A Button = button(1) 
                          B Button = button(2) 
                          X Axis = axis(0-,0+) 
                          Y Axis = axis(1-,1+) 
                          ; HuiJia  USB GamePad_END 
                          
                          1 Reply Last reply Reply Quote 0
                          • N
                            nissim @badviper
                            last edited by

                            @badviper Would you please advise what steps I need to take to make my retrolink usb controller work with n64?

                            Do I need to use lr-mupen64plus-next? I selected lr-mupen64*-something*

                            Do I need to modify /opt/retropie/configs/n64/InputAutoCfg.ini?

                            Do I need to reboot or only restart emulation station?

                            I don't understand the GUI option for selecting a Select button since my controller doesn't have one but games need that, right?

                            Any other steps?

                            Thank you!

                            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.