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

input: Don't use old input state in GameController::ReadState() #2170

Merged
merged 5 commits into from
Jan 18, 2025

Conversation

ngoquang2708
Copy link
Contributor

Fix input lag when there is multiple user inputs happen at the same time. SDL input events can only fire one at a time and game may get some input events later than other.

@ngoquang2708
Copy link
Contributor Author

Main:

main.mp4

PR:

pr.mp4

@ngoquang2708 ngoquang2708 force-pushed the fix-input-lag branch 2 times, most recently from 0e707a1 to 13f2b17 Compare January 17, 2025 07:46
@DemoJameson
Copy link
Contributor

it seems you accidentally committed the shadps4.flatpak file

@ngoquang2708
Copy link
Contributor Author

it seems you accidentally committed the shadps4.flatpak file

Nice catch. Thanks.

@roamic
Copy link
Collaborator

roamic commented Jan 17, 2025

Can someone check Gravity Rush Remastered with this PR?

@georgemoralis
Copy link
Collaborator

hmm i would prefer no SDL code in controller.cpp since it gonna be generic (as i imagine it at least) and have devices for inputs (SDL_keyboard ,SDL_Gamepad , XInput etc)

@ngoquang2708 ngoquang2708 marked this pull request as draft January 17, 2025 08:43
@GamerzHell9137
Copy link

Hoped this would fix Disgaea 5 but nope

2025-01-17.10-16-09.mp4

@ngoquang2708
Copy link
Contributor Author

Ended up refactor the whole input subsystem.

@ngoquang2708 ngoquang2708 marked this pull request as ready for review January 17, 2025 19:01
@ngoquang2708 ngoquang2708 force-pushed the fix-input-lag branch 3 times, most recently from 726f239 to de2b9bc Compare January 17, 2025 19:36
Fix input lag when there is multiple user inputs happen at the same time.
SDL input events can only fire one at a time and game may get some input events later than other.
@ngoquang2708
Copy link
Contributor Author

Can someone check Gravity Rush Remastered with this PR?

Confirmed motion controls is still working.

Copy link
Collaborator

@roamic roamic left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

src/input/controller.cpp Outdated Show resolved Hide resolved
@Randomuser8219
Copy link

This could also fix Minecraft input lag

@ngoquang2708
Copy link
Contributor Author

This could also fix Minecraft input lag

Could you test it?

@roamic roamic merged commit 90b04e8 into shadps4-emu:main Jan 18, 2025
12 checks passed
@ngoquang2708 ngoquang2708 deleted the fix-input-lag branch January 18, 2025 07:00
diegolix29 added a commit to diegolix29/shadPS4 that referenced this pull request Jan 18, 2025
diegolix29 added a commit to diegolix29/shadPS4 that referenced this pull request Jan 18, 2025
kalaposfos13 added a commit to kalaposfos13/shadPS4 that referenced this pull request Jan 18, 2025
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