Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Analog to Digital Type' usability improvements #12562

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

jdgleaver
Copy link
Contributor

Description

RetroArch is able to map the left or right analog stick of a gamepad to D-Pad input via the per-port Analog to Digital Type menu setting. Unfortunately, this is a 'trap' for new users: mapping a stick in this fashion disables its analog input, which creates confusion when using cores that have native analog support. Many users enable Analog to Digital Type by default, then complain on reddit/discord that analog controls do not work for PSX/N64/etc. games.

This PR modifies the Analog to Digital Type functionality such that it can be disabled automatically for cores that have native analog support. The setting now has the following values:

  • None: No mapping
  • Left Analog: Map left stick to D-Pad, but disable mapping if core attempts to read analog input
  • Right Analog: Map right stick to D-Pad, but disable mapping if core attempts to read analog input
  • Left Analog (Forced): Always map left stick to D-Pad, disabling left stick analog input
  • Right Analog (Forced): Always map right stick to D-Pad, disabling right stick analog input

In addition, a sublabel has been added to the Analog to Digital Type menu entries, which should help to explain what they actually do.

Finally, this PR required some modification of input overlay-related code, during which the following bugs were fixed:

  • There is no longer contention between analog stick inputs when an input overlay and physical controller are attached to the same port
  • Input overlays no longer generate analog stick input in addition to D-Pad input when Analog to Digital Type is set to the left or right stick

@metchebe
Copy link

Hi, I have a question. For a while I have noticed that device type and analog to digital type set in remaps 'stick' after content is closed, which then affects content loaded afterwards (unless they also have a remap). Indeed this caused the problem you mention with N64/psx, even if globally I had set no analog to digital.

Is this also fixed with this? Thanks.

@jdgleaver
Copy link
Contributor Author

@metchebe That particular issue was in fact fixed by #12534 :)

@metchebe
Copy link

Great! Thanks, looking forward to the next release!

@markwkidd
Copy link
Contributor

Nice!

@jdgleaver jdgleaver deleted the input-adc-type-improvements branch June 24, 2021 09:12
@dankcushions
Copy link
Contributor

dankcushions commented Aug 21, 2021

for arcade cores this is a bit tricky as only a tiny percentage of their games actually support analog, but this PR will disable a2d for the whole core because they will probably poll RETRO_DEVICE_INDEX_ANALOG_LEFT / RIGHT triggering https://github.com/libretro/RetroArch/pull/12562/files#diff-4dd6e477da06a009ecb1c94f3eb145e8655b78879bc1a47d349183ca02092a2cR23586

so maybe arcade cores could get around this by only polling RETRO_DEVICE_INDEX_ANALOG_* for games that actually use analog controls (probably could derive this from the driver or something). just a thought, @markwkidd / @barbudreadmon :)

@barbudreadmon
Copy link
Contributor

I recommend never using that feature at all with FBNeo, i already map analog-left-to-dpad and dpad-to-analog-left natively, on the condition the other one is not already in use (which actually happens on a few games iirc).

Tbh, having a mean to force-disable that setting at the core level would be great, since it can only cause issues in the case of FBNeo

@jdgleaver
Copy link
Contributor Author

barbudreadmon is absolutely right that enabling Analog to Digital in the fontend makes a mess of FBNeo - so with this PR the general setup is much 'safer', since a user must explicitly select one of the 'forced' mapping options in order for there to be any contention/disabled input.

For other cores, it is indeed recommended that RETRO_DEVICE_INDEX_ANALOG_LEFT / RIGHT only be polled when they are actually being used.

Tbh, having a mean to force-disable that setting at the core level would be great, since it can only cause issues in the case of FBNeo

If someone creates an issue for this, we can add it to the new 'milestones' list :)

@dankcushions
Copy link
Contributor

cheers @barbudreadmon - good that fbneo deals with it internally already. my point was probably more appropriate for mame2003/plus as I've seen a couple of users getting caught by this change with existing configs. eg: https://retropie.org.uk/forum/topic/31120/analog-stick-bind-recently-stopped-working-in-mame

hlad added a commit to hlad/RetroPie-Setup that referenced this pull request Sep 29, 2021
Since v1.9.6 RetroArch changes the way the "analog to digital" works and since then the "forced mode" is need for some cores (eg. lr-vice, lr-puae).

libretro/RetroArch#12562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants