Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.