libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.38k stars 1.84k forks source link

[PSTV/Vita] Analog L2/R2 does not work using a Dualshock 3 #17162

Open techsrus opened 3 weeks ago

techsrus commented 3 weeks ago

Description

Trying to manually remap for analog L2/R2, but there are no working axis numbers that maps the Dualshock 3's analog triggers to RetroArch on PlayStation TV.

Expected behavior

Should be able to map the Dualshock's L2 and R2's axis numbers to "input_l2_axis" and "input_r2_axis" and get the pressure sensitive triggers, as it says in the libretro document.

Actual behavior

I've tried axis numbers up from -0 to -40 (+axis numbers got the buttons stuck on PC, I tried + on vita as well) and none seem to be the ones attached to L2 and R2 on the Dualshock 3 for the Playstation TV (it is supported).

Steps to reproduce the bug

  1. PlayStation TV with genuine Dualshock 3
  2. Configure the RetroPad Binds with the Dualshock 3
  3. Save the controller profile
  4. Must manually edit the config file to get around the Analog L2/R2 remapping bug
  5. You can observe that L2 and R2 analogs are working using reVita. When enabled press Start+Square to open up the menu, go down to Developer and then Show buttons.

Bisect Results

This issue exists on PC with a workaround, but I guess hasn't come up yet for the Vita version. By mapping any other analog axis like the Right Analog stick to L2 or R2, I found that I was able to get the the intended analog function to come from RetroArch. So it's just RetroArch not being able to bind to the L2 or R2 analog axis.

On PC I was easily able to fix it with the manual remap for dinput, and I think since RetroArch has to define what Vita inputs are seen through its 'vita' input driver, maybe it still needs the axes for L2 and R2 to be defined before I am able to manually remap it.

File I believe is relevant (vita input driver)

Version/Commit

Environment information

Thank you.

zoltanvb commented 2 weeks ago

The guess sounds about right, L2/R2 analog values are not mapped, they are just read from the on/off button structure: https://github.com/libretro/RetroArch/blob/bb808dfc699eac406fb98ff4d1efab5fe844e05d/input/drivers_joypad/psp_joypad.c#L341

Now, it may be possible to get the analog value, using the dedicated lt/rt part of the structSceCtrlData. I do not have PSTV, but if you are willing to install a few test builds, maybe it can be achieved.

techsrus commented 2 weeks ago

I'll be glad to test!

zoltanvb commented 1 week ago

retroarch_vita.zip Here's a test build with pcsx_rearmed. L2 is mapped to axis 4, R2 is mapped to axis 5.

zoltanvb commented 1 week ago

So, that one did not work, but maybe this one can be actually used to start some content. pcsx_test.zip

techsrus commented 1 week ago

This one got further than the previous one but this time it crashes when launching the game, like the nightlies. It seems that it was caused by the pcsx self as noted by the error message. I uploaded the crash dump file, if it helps.

psp2core-1732007466-0x0000be3397-pcsx_rearmed_libretro.self.psp2dmp.zip