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

Move and relocate 'Frame Delay' #15898

Merged
merged 1 commit into from
Nov 12, 2023
Merged

Conversation

sonninnos
Copy link
Collaborator

@sonninnos sonninnos commented Nov 12, 2023

Description

While developing the "Frame Rest" feature I accidentally noticed that it also affected input response, and not only CPU usage. And with closer inspection I noticed that the current location of "Frame Delay" is utterly useless when it is done before core_run() and not after. Sure, feels counterintuitive at first, but the test results speak for themselves, and in the grand scheme loop the sleeping still happens and works as advertised. What exactly makes this massive difference, I can not say, but I'd like to know.

The simplest test for confirming this is using a lightweight core such as Genesis Plus GX with a lightgun device and crosshair enabled, and then showing OS mouse cursor by ungrabbing mouse, aligning the cursors by pushing them to a corner, and observing the delay. It is extremely immediate and lagless this way, especially when pushed above the default half frame time, and of course with all the other video driver specific settings optimized.

If someone can demonstrate that with some platform it is actually worse now, we'll make it an option. With Windows every video driver behaves exactly the same. I moved all the code to video_driver.c while at it to keep the runloop clean.

Basically this change makes "Frame Rest" redundant, but let's let it stay for now, and decide later if "Frame Delay" should also be allowed to run when menu is open, and how they should eat each other when both are enabled.

@crashGG
Copy link

crashGG commented Nov 12, 2023

The way I check the total input/output delay is to set the keyboard Caps Lock key to fire, then use a high-speed camera (120fps) to shoot the keyboard LED indicator and the character firing in game on the screen into the same video, and then Calculate the number of frames delay in playback during playback .
Maybe this immature method can provide you with some reference.

@sonninnos
Copy link
Collaborator Author

sonninnos commented Nov 12, 2023

Sure, I've been doing that too with a 60fps camera, and it shows a difference. This mouse method is much simpler and more intuitive though.

@LibretroAdmin LibretroAdmin merged commit f091b5a into libretro:master Nov 12, 2023
22 checks passed
@sonninnos sonninnos deleted the frame-delay branch November 12, 2023 20:23
Sunderland93 pushed a commit to Sunderland93/RetroArch that referenced this pull request Dec 26, 2024
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.

3 participants