Xboxdrv mapping (Nes30Pro), UAE4arm, mouse and joystick
-
@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
-
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-joystickNES30 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?
-
@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. -
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.
-
@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. -
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.
-
I may have found it...
/opt/retropie/emulators/uar4arm/conf/uaeconfig.uae contains lines relating to joysticks.
Just going to back up and experiment.
-
No dice...
These lines gave me hope:
joyport0=mouse
joyport0autofire=none
joyport1=joy1
joyport1autofire=none
joyport1mode=djoyScrolled 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=falseWhich 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)
-
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?
-
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
-
Going to back up my changes, revert back then try the onstart method further down the wiki and see if that makes a difference.
-
@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.
-
Thank you - going to take a break for a couple of hours then get back to it.
-
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.
-
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.