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

Fix evdev axis reversal #3303

Merged
merged 3 commits into from
Sep 27, 2017
Merged

Fix evdev axis reversal #3303

merged 3 commits into from
Sep 27, 2017

Conversation

refi64
Copy link
Contributor

@refi64 refi64 commented Aug 23, 2017

@toccata10 See if this works now.

@mention-bot
Copy link

@kirbyfan64, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hcorion to be a potential reviewer.

@hcorion
Copy link
Member

hcorion commented Aug 23, 2017

Please merge after #3283

@hcorion
Copy link
Member

hcorion commented Aug 23, 2017

From what I can tell, this won't work if joystick squircling is on (and it's on by default).

@toccata10
Copy link
Contributor

It's working with
Squircle Joysticks: false
in the config file

@toccata10
Copy link
Contributor

toccata10 commented Aug 23, 2017

Strangely, on Tekken 6, when I press down, it registers up (and up registers up). Seems to be the only game with this pb (with keyboard, it is ok).
RPCS3-Tekken6.zip
Edit: with
Reverse left stick X axis: false
the behaviour is correct: I can go up and down (although my stick is reversed).
Always wondered why
value = 256 - value;
and not:
value = 255 - value;
(no time now to test it, but I will)

@toccata10
Copy link
Contributor

A new test with (line 474):
value = 255 - value;
It fixes tekken 6 and it's ok with the other games I tested.

Copy link
Contributor

@toccata10 toccata10 left a comment

Choose a reason for hiding this comment

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

Fixes Tekken 6 input


if (revaxis[axis])
{
value = 256 - value;
Copy link
Contributor

Choose a reason for hiding this comment

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

value = 255 - value; //fixes Tekken 6 input

@toccata10
Copy link
Contributor

For Squircle:
With Reverse left stick X axis: true, line 451 should be
pad.m_sticks[Xaxis].m_value = scale_axis(ABS_X, 255-joy_axis[i][Xaxis]);

@toccata10
Copy link
Contributor

toccata10 commented Sep 9, 2017

Now that #3283 is merged, this fixes the missing reversal (without squircle), Line 103:

                     {
                        int value = scale_axis(evt.code, evt.value);

                        if (revaxis[axis])
                        {
                            value = 255 - value;
                        }

                        pad->m_sticks[axis].m_value = value;
                    }

@toccata10
Copy link
Contributor

@kirbyfan64 any chance to see this corrected so that it can be merged ? Thks

@toccata10
Copy link
Contributor

For the squircle pb with axis reversal, this is working:

                if (g_evdev_joystick_config.squirclejoysticks)
                {
                        if (revaxis[axis])
						{
							joy_axis[i][axis] = 255-evt.value;
                        }
						else
						{
							joy_axis[i][axis] = evt.value;
						}

@kirbyfan64: do you want me to create a pull request ? I don't know if you're still interested (or simply have time) in this. That's my corrected file:
evdev_joystick_handler-correct.zip

@refi64
Copy link
Contributor Author

refi64 commented Sep 23, 2017

@toccata10 Sorry! I totally forgot about this. I pushed a new version that should work with both squircle and normal modes.

@toccata10
Copy link
Contributor

Works fine now on my system. Thanks.

@Nekotekina Nekotekina merged commit 85b9809 into RPCS3:master Sep 27, 2017
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.

5 participants