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

    MAME 0.260 - Input device button mapping???

    Scheduled Pinned Locked Moved Help and Support
    ubuntu 22.04ltsmamexpad
    8 Posts 2 Posters 747 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.
    • K
      Kartman
      last edited by

      I'm getting very frustrated...

      Latest RetroPie on Ubuntu 22.04. My controllers are all working correctly in EmulationStation and RetroArch. I'm using x-arcade via xpad driver...

      I'm trying to use MAME (not lr-mame) and it launches OK, identifying 2x X360 WIRELESS CONTROLLER devices. This is correct but some of the "buttons" are not responding. Specifically, a couple of the "hat" directions are mis-assigned and, when I try to reassign them, some of the hat up and down directions are not responding during reassignment.

      Very confused. I can run MAME with the verbose option... I just get why MAME is lost while ES and RA seem to get the assignments right and the devices are responding.

      1 Reply Last reply Reply Quote 0
      • K
        Kartman
        last edited by

        retropie@retropie:~$ jstest /dev/input/js1
        Driver version is 2.1.0.
        Joystick (Xbox 360 Wireless Receiver) has 6 axes (X, Y, Rx, Ry, Hat0X, Hat0Y)
        and 17 buttons (BtnA, BtnB, BtnX, BtnY, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR, (null), (null), (null), (null)).
        

        Further to my previous... all the BTN assignments seem to be responding in MAME. My issue is that at Hat0X is being read as up/down by MAME and Hat0Y isn't being recognized.

        what is the mechanism that connects the axis and buttons to MAME?

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

          MAME may be using the SDL GamepadControllerDB, which may not be correctly mapping your (emulated) Xbox 360 controller. Post the output of the -verbose run to see how the gamepad is detected.

          K 2 Replies Last reply Reply Quote 0
          • K
            Kartman @mitu
            last edited by

            @mitu entire verbose capture is available but I don't seem to have privileges to attach a document? I've pasted what I believe to be the relevant joystick detection lines directly below. Any insight would be great. Much appreciated.

            Game Controller: Start initialization
            Game Controller: X360 Wireless Controller [GUID 030000005e040000a102000000010000] Vendor ID 045E, Product ID 02A1, Revision 0100, Serial <nullptr>
            Game Controller:   ...  mapping [030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux]
            Input: Adding joystick #1: X360 Wireless Controller (device id: 030000005e040000a102000000010000)
            Game Controller:   ...  Xbox 360 type
            Game Controller: X360 Wireless Controller [GUID 030000005e040000a102000000010000] Vendor ID 045E, Product ID 02A1, Revision 0100, Serial <nullptr>
            Game Controller:   ...  mapping [030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux]
            Input: Adding joystick #2: X360 Wireless Controller (device id: 030000005e040000a102000000010000)
            Game Controller:   ...  Xbox 360 type
            Joystick: Universal Human Interface Device Nano [GUID 0300000009d200000115000011010000] Vendor ID D209, Product ID 1501, Revision 0111, Serial <nullptr>
            Joystick:   ...  8 axes, 32 buttons 1 hats 0 balls
            Input: Adding joystick #3: Universal Human Interface Device Nano (device id: 0300000009d200000115000011010000)
            Joystick:   ...  Does not have haptic capability
            Game Controller: End initialization
            Game Controller: Got SDL joystick added event for reconnected game controller X360 Wireless Controller [ID 030000005e040000a102000000010000]
            Game Controller: Got SDL joystick added event for reconnected game controller X360 Wireless Controller [ID 030000005e040000a102000000010000]
            Game Controller: Got SDL joystick added event for reconnected game controller Universal Human Interface Device Nano [ID 0300000009d200000115000011010000]
            
            1 Reply Last reply Reply Quote 0
            • K
              Kartman
              last edited by

              maybe this will help. I included that active testing line, this time.

              Hat0X is axis 4 (working in MAME but mapped to D-PAD UP/DOWN)
              Hat0Y is axis 5 (not registering in MAME)

              retropie@retropie:~/RetroPie$ jstest /dev/input/js1
              Driver version is 2.1.0.
              Joystick (Xbox 360 Wireless Receiver) has 6 axes (X, Y, Rx, Ry, Hat0X, Hat0Y)
              and 17 buttons (BtnA, BtnB, BtnX, BtnY, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnStart, BtnMode, BtnThumbL, BtnThumbR, (null), (null), (null), (null)).
              Testing ... (interrupt to exit)
              Axes:  0:     0  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off 12:off 13:off 14:off 15:off 16:off 
              
              1 Reply Last reply Reply Quote 0
              • K
                Kartman @mitu
                last edited by

                @mitu you're onto something, for sure. I looked at the SDL2 executables TESTCONTROLLER and CONTROLLERMAP. Using the test, I confirmed that the current SDL mappings match what I'm seeing in MAME. Progress! Using the map tool, I created a new map but I've not figured out how to "load" this mapping either as an override or as a new default for this controller on this system.

                I'll keep reading and digging... any further hints would be great.

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

                  @Kartman said in MAME 0.260 - Input device button mapping???:

                  I'll keep reading and digging... any further hints would be great.

                  You can load your own SDL Gamepad mapping by setting SDL_HINT_GAMECONTROLLERCONFIG before starting mame:

                  SDL_GAMECONTROLLERCONFIG="... new mapping here .." /path/to/mame
                  

                  EDIT: to make it permanent, you can add the env var to your profile, in $HOME/.bashrc:

                  # other entries
                  export SDL_GAMECONTROLLERCONFIG="... new mapping here .." 
                  
                  1 Reply Last reply Reply Quote 0
                  • K
                    Kartman
                    last edited by

                    BINGO.... I figured this out and was just coming back to say thanks for the SDL tip again. For the record, I added the env variable to "/etc/environment" to make it a system wide change.

                    Again, big thanks.

                    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.