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

    Xboxdrv mapping (Nes30Pro), UAE4arm, mouse and joystick

    Scheduled Pinned Locked Moved Help and Support
    xboxdrvuae4armnes30proamigamouse
    16 Posts 2 Posters 5.3k 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.
    • I
      i8allUrPi
      last edited by

      Mouse on analog stick?

      I've started playing around trying to make amiga less reliant on keyboard and mouse.

      I found the "Universal Controller Calibration and Mapping Using xboxdrv" guide on the RetroPie Wiki and used the scummvm (mouse on left analog stick) method to do the same with UAE4arm.

      I've successfully done this for scummvm.

      I'm using a Nes30 Pro.

      In theory, it works for amiga too - and I can launch ADF games from the GUI (+Start UAE4arm) with just the joypad.

      And, in mouse only games, it works like a charm.

      However, I'm experimenting on going a step further with the following:
      DPAD & 2 (of the 4 joypad main buttons) for joystick

      • Left analog stick & 2 (of the 4 joypad main buttons) for mouse & LMB, RMB
      • Select to exit (a feature of the amiga retro pie WHDLoad project)
      • Start to open the GUI (equivalent of F12)
      • Couple of common keyboard keys to LT, RT, L1, R1

      The problem is, once the mouse is mapped to the analog stick, UAE4arm doesn't 'see' any of the mapped joystick controls.

      I'm testing using a cracked game so I am forced to use mouse (to click past the cracktro) and then, in game to use the joystick.

      Here's the guide I'm following:

      https://github.com/retropie/retropie-setup/wiki/Universal-Controller-Calibration-&-Mapping-Using-xboxdrv

      If anyone already has this working as I describe, or knows how - I'd love to hear the method.

      Many thanks in advance.

      mediamogulM 1 Reply Last reply Reply Quote 0
      • mediamogulM
        mediamogul Global Moderator @i8allUrPi
        last edited by mediamogul

        @i8allUrPi said in Xboxdrv mapping (Nes30Pro), UAE4arm, mouse and joystick:

        The problem is, once the mouse is mapped to the analog stick, UAE4arm doesn't 'see' any of the mapped joystick controls.

        My solution to this was creating a mapped toggle that would switch functions between a standard joystick mapping and a mouse mapping when activated. For that toggle, I chose to use a controller button that doesn't normally get much use. For me, that was the L3/TL button. From there, I mapped the left stick to have mouse movement be active only when L3/TL was active. Since the toggle function leaves the chosen button in a state of constant activity until pressed again, this works very well. You can also assign the mouse left/right clicks to something like the A and B buttons when the toggle is active too. Below is the mapping I use for Amiga. You may notice that my personal preference is to activate the mouse buttons separately on their own R3/TR toggle, but this isn't required.

        sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
        	--evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.2:1.0-event-joystick \
        	--detach-kernel-driver \
        	--force-feedback \
        	--trigger-as-button \
        	--deadzone-trigger 15% \
        	--deadzone 4000 \
        	--device-name "Logitech Rumblepad 2 (xboxdrv)" \
        	--silent \
        	--axismap -Y1=Y1,-Y2=Y2 \
        	--buttonmap tl^toggle=tl \
        	--buttonmap tr^toggle=tr \
        	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
        	--evdev-keymap BTN_THUMB2=a,BTN_THUMB=b,BTN_TOP=x,BTN_TRIGGER=y,BTN_BASE3=back,BTN_BASE4=start,BTN_TOP2=lb,BTN_PINKIE=rb,BTN_BASE5=tl,BTN_BASE6=tr,BTN_BASE=lt,BTN_BASE2=rt \
        	--ui-axismap tl+x1=REL_X:20,tl+y1=REL_Y:20 \
        	--ui-buttonmap tr+b=BTN_LEFT,tr+a=BTN_RIGHT,a=JS_2,b=JS_1,x=JS_3,y=JS_0,lb=JS_4,rb=JS_5,lt=JS_6,rt=JS_7,tl=KEY_UNKNOWN,tr=KEY_UNKNOWN,start=JS_9,back=JS_8 \
        	--ui-buttonmap rt+a=KEY_ENTER,rt+b=KEY_ESC,rt+du=KEY_UP,rt+dd=KEY_DOWN,rt+dl=KEY_LEFT,rt+dr=KEY_RIGHT \
        	--ui-buttonmap back+x=KEY_F12,back+start=KEY_Q \
        	--ui-buttonmap guide=void
        

        RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

        1 Reply Last reply Reply Quote 0
        • I
          i8allUrPi
          last edited by i8allUrPi

          Thank you for your help - I'm glad you popped in, your wiki entry and some other forum replies where you've helped with xboxdrv have opened my eyes to 'keyboard/mouse free gaming' even with troublesome systems.

          I tried your solution, (replacing your key maps and abs maps with my own).

          The toggling is a nice touch.

          I added the code above into +Start UAE4Arm.

          Launched successfully (after realising I didn't have a trailing backslash on one line), toggled to activate mouse. Loaded up magic pockets through the GUI. Left clicked to bypass the cracktro, then toggled back to hit fire and begin playing.

          Mouse works, keyboard works.

          It seems that 'fire button' isn't working at all (so I imagine it's the same for the other joystick controls) - it's as if UAE4Arm (I've also tried this with UAE4All with the same symptoms) is either looking for the original instance of the NES30 Pro controller (event 2) as opposed to xboxdrv (event 3) - or, there's a breakdown somewhere.

          I was so glad when I got ScummVM working with your solution, and hoped UAE would be easy - seems this one might require some lateral thinking to solve.

          BTW, I notice you're using:
          /dev/input/by-path/platform-3f980000.usb-usb-0:1.2:1.0-event-joystick

          NES30 Pro doesn't seem to create an id for input/by-id so I'm using event2 in place of it.

          How do you find the 'by path' reading, as I imagine that's more reliable than events?

          mediamogulM 1 Reply Last reply Reply Quote 0
          • mediamogulM
            mediamogul Global Moderator @i8allUrPi
            last edited by mediamogul

            @i8allUrPi said in Xboxdrv mapping (Nes30Pro), UAE4arm, mouse and joystick:

            it's as if UAE4Arm is looking for the original instance of the NES30 Pro controller

            Setting the xboxdrv virtual controller as the default in the "Input" GUI settings for UAE4Arm should force the software to recognize your mapping.

            How do you find the 'by path' reading, as I imagine that's more reliable than events?

            It is more reliable, but it's not always an option made available by the manufacturer. You can view those particular entries with ls /dev/input/by-path/ to see if your controller has a listing there.

            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

            1 Reply Last reply Reply Quote 0
            • I
              i8allUrPi
              last edited by

              Thanks again for the reply.

              I don't see a dropdown or setting for choosing a controller in the GUI under input.

              I'm using a slightly outdated version of UAE4arm, released by the WHDload group on Facebook as the newer version broke some things they relied on (bluetooth controllers I believe)

              I presume that setting was added in a more recent version, as such I might be stuck unless I can find the setting in the config file somewhere.

              Going to have a quick google and report back.

              mediamogulM 1 Reply Last reply Reply Quote 0
              • mediamogulM
                mediamogul Global Moderator @i8allUrPi
                last edited by

                @i8allUrPi said in Xboxdrv mapping (Nes30Pro), UAE4arm, mouse and joystick:

                I'm using a slightly outdated version of UAE4arm... I presume that setting was added in a more recent version

                It must have been. I assume this could still be set manually in /opt/retropie/configs/amiga/uae4all/conf/uaeconfig.uae. In mine, there's a setting that reads:

                joyportfriendlyname1=Logitech Rumblepad 2 (xboxdrv)
                

                This corresponds to my xboxdrv mapping for --device-name. However, I'm not sure if that's all that is needed to set the default controller.

                RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                1 Reply Last reply Reply Quote 0
                • I
                  i8allUrPi
                  last edited by

                  Strange, I don't have that line, or any line relating to a specific controller. I wonder if it's hard coded to just choose the first joystick available.

                  Presumably as it's a configuration setting created in the newer version it makes sense that it won't be in the configuration file.

                  More hunting.

                  Life would be easy if that were the case, if it were possible to swap the event numbers (maintaining the mapping). I doubt it's that easy though.

                  1 Reply Last reply Reply Quote 0
                  • I
                    i8allUrPi
                    last edited by i8allUrPi

                    I may have found it...

                    /opt/retropie/emulators/uar4arm/conf/uaeconfig.uae contains lines relating to joysticks.

                    Just going to back up and experiment.

                    1 Reply Last reply Reply Quote 0
                    • I
                      i8allUrPi
                      last edited by

                      No dice...

                      These lines gave me hope:
                      joyport0=mouse
                      joyport0autofire=none
                      joyport1=joy1
                      joyport1autofire=none
                      joyport1mode=djoy

                      Scrolled to find:
                      input.1.joystick.0.friendlyname=dPad as joystick
                      input.1.joystick.0.name=JOY0
                      input.1.joystick.0.empty=true
                      input.1.joystick.0.disabled=false
                      input.1.joystick.1.friendlyname=8Bitdo NES30 Pro
                      input.1.joystick.1.name=JOY1
                      input.1.joystick.1.empty=true
                      input.1.joystick.1.disabled=false

                      Which led me to believe it was definitely looking for the other instance.

                      Changed that line to my new friendly name:
                      NES30 Pro (xboxdrv)

                      And.... same as before.

                      Mouse and keyboard mapping works. No fire button to begin game.

                      Going to carry on looking through the config to see if there are additional settings.

                      (btw, what do I wrap the code above in so it's not inline? - sorry for poor formatting)

                      mediamogulM 1 Reply Last reply Reply Quote 0
                      • I
                        i8allUrPi
                        last edited by

                        Ok, reached the bottom of the file - there were 2 more instances input.2., input.3. so changed them and tested...

                        No joy (no pun either)

                        Now, I don't know if it's related, but...

                        When I edited "+Start ScummVM" as per the method closer to the top of the wiki, it seemed that it was ignoring the configuration that was already there.

                        All my previously added games were not in the list, the graphic mode had reset to default and any games I did add, did not appear as .svm files in the scummvm directory, nor were they added to the emulation station menu under ScummVM (the old ones I'd previously added were there and still launched).

                        I worked around this by commenting out everything I'd added... mass adding all my ScummVM games, then uncommenting, relaunching, then finally mass adding again so they all appeared in the GUI too.

                        Could it be that somehow xboxdrv is losing the config file somewhere? Or maybe there's a config file lurking somewhere else in the filesystem that it has created?

                        1 Reply Last reply Reply Quote 0
                        • I
                          i8allUrPi
                          last edited by

                          In fact, I'm pretty sure this is the case, as I'd saved over the default config with speedball 2 in the drive (that's still present in /opt/retropie/emulators/uae4arm/conf/uaeconfig.uae) but it's not in the drive when launched from +Start Uae4arm

                          1 Reply Last reply Reply Quote 0
                          • I
                            i8allUrPi
                            last edited by

                            Going to back up my changes, revert back then try the onstart method further down the wiki and see if that makes a difference.

                            1 Reply Last reply Reply Quote 0
                            • mediamogulM
                              mediamogul Global Moderator @i8allUrPi
                              last edited by mediamogul

                              @i8allUrPi said in Xboxdrv mapping (Nes30Pro), UAE4arm, mouse and joystick:

                              btw, what do I wrap the code above in so it's not inline? - sorry for poor formatting

                              Three backticks ``` on either side.

                              Going to back up my changes, revert back then try the onstart method further down the wiki

                              You might also try using the simplified method for launching xboxdrv that is detailed here.

                              Edit: You would of course change "sorr" to "amiga" and add your own xboxdrv configuration.

                              RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                              1 Reply Last reply Reply Quote 0
                              • I
                                i8allUrPi
                                last edited by

                                Thank you - going to take a break for a couple of hours then get back to it.

                                1 Reply Last reply Reply Quote 0
                                • I
                                  i8allUrPi
                                  last edited by

                                  Ok, decided to bite the bullet and update UAE4arm, it works exactly as it should with your mappings and now I can launch ADFs, exit, use mouse, some keyboard keys and joystick all from the controller.

                                  Thank you.

                                  This did of course break the WHDLoad (loading games straight from the emulation station menu) functionality - but, I'll retrace my steps and see if I can fix that myself.

                                  I really appreciate your time and effort.

                                  I used the onstart method with 'case's - very neat solution.

                                  mediamogulM 1 Reply Last reply Reply Quote 1
                                  • mediamogulM
                                    mediamogul Global Moderator @i8allUrPi
                                    last edited by mediamogul

                                    @i8allUrPi

                                    I really appreciate your time and effort.

                                    Not a problem. I'm glad it all worked out.

                                    RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                    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.