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

use getSOCDMode in DDI None to benefit from 28d47d9f #234

Merged
merged 2 commits into from
May 15, 2023

Conversation

bsstephan
Copy link
Contributor

Just a tiny code cleanup/improvement to my previous PR to account for the no SOCD mode change that also went in.

@@ -157,7 +157,7 @@ void DualDirectionalInput::process()
// this also avoids accidentally masking gamepad inputs with the lack of dual inputs
if (gamepad->options.dpadMode == options.dualDirDpadMode) {
Copy link
Contributor

@deeebug deeebug May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done some tests and this seems to be the logic that gets both regular and DDI working together when both input methods are same.

if (gamepad->options.dpadMode == options.dualDirDpadMode) {
    uint8_t gamepadDpad = gpadToBinary(gamepad->options.dpadMode, gamepad->state);
    if ( socdMode == SOCD_MODE_NEUTRAL ) {
        dualOut = SOCDCombine(socdMode, gamepadDpad);
    } else if ( socdMode != SOCD_MODE_BYPASS ) {
        dualOut = SOCDGamepadClean(dualOut | gamepadDpad, socdMode == SOCD_MODE_SECOND_INPUT_PRIORITY);
    } else {
        dualOut |= gamepadDpad;
    }
}

I think line 158 to 161 will be replaced by this change.

@deeebug
Copy link
Contributor

deeebug commented May 10, 2023

Thank you for the update, looking good to me!
I've done some tests and suggested a bit of a change, so please look into it.

@bsstephan
Copy link
Contributor Author

@deeebug I believe this also makes sense to me!

Copy link
Contributor

@arntsonl arntsonl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, SOCD with dual is so confusing but glad we're getting some solid fixes!

@arntsonl arntsonl merged commit 8f27dab into OpenStickCommunity:main May 15, 2023
30 checks passed
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.

None yet

3 participants