Add async maple device#2163
Closed
Tails86 wants to merge 15 commits intoflyinghead:devfrom
Closed
Conversation
Contributor
Author
|
Gonna close this for now and reopen later if it's needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The purpose of this PR is mainly to add
maple_async_basefor use in a future PR. This base class will allow for asynchronous maple command processing without blocking game emulation. Currently, thestd::futureis always immediately filled with data, so there is no difference in runtime operation other than the delivery delay is max of each bus delivery delay instead of the total.I tested asynchronous delays by changing
maple_base::output_to_futureto:I tested this with delays of 0 ms up to 50 ms with different timeout values in
maple_if. There is a hard block for data once that timeout is reached. If that timeout is too high, then data potentially gets lost. If that timeout is too low, then flycast may unnecessarily slow down.Games start to miss inputs if the timeout and delay are set at or above 25 ms. It generally seemed like gameplay was just fine at a 20 ms timeout with 20 ms processing delay on all commands. I pulled that timeout down to 15 ms to get some headroom because I'd rather have a bit jittery gameplay than missed inputs, and this ensures delivery of data before 1x 60 Hz frame has completed as I know the controller is polled on each 60 Hz frame.
Other notes:
maple_ifmaple_pre_serialize()to ensure data is loaded intomapleDmaOutbefore serialization. This is called frommcfg_SerializeDevices()