Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
cannonball
Commits
1a7e3d49
Commit
1a7e3d49
authored
Oct 31, 2018
by
Tatsuya79
Browse files
Improve analog acceleration.
parent
b23aa5f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/libretro/input.cpp
View file @
1a7e3d49
...
...
@@ -159,10 +159,9 @@ void Input::handle_joy_axis(int wheel_axis, int accel_axis, int brake_axis)
// Accelerator [Single Axis]
// Scale input to be in the range of 0 to 0x7F
int
adjusteda
=
0x7F
-
((
-
accel_axis
+
(
1
<<
15
))
>>
9
);
int
adjusteda
=
accel_axis
/
256
;
adjusteda
+=
(
adjusteda
>>
2
);
// Accelerates slightly for an unknown reason, add a deadzone
a_accel
=
(
adjusteda
<
80
)
?
0
:
adjusteda
;
a_accel
=
adjusteda
;
// Brake [Single Axis]
// Scale input to be in the range of 0 to 0x7F
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment