add rc_client_set_allow_background_memory_reads #439
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.
Allows a client to specify that memory reads should only occur within the context of
rc_client_do_frame
orrc_client_idle
. The trade-off is that the work requiring the memory reads could be delayed by as much as however infrequentlyrc_client_idle
is called.To be expanded to much of RAIntegration after this is merged. This provides the single setting to enable the functionality (by disabling background reads), and addresses the single known situation where rc_client is doing memory reads from a background thread (validating memory addresses before finishing the load game sequence). The flag will automatically be passed to RAIntegration via the
rc_client_external
interface and we can do similar dispatching there for responding to UI events.For more context, see also https://discord.com/channels/310192285306454017/1149693430306447380/1374558874606243962. A recent Dolphin change supports reading memory outside of the
do_frame
loop by pausing emulation while doing the read. When clicking the "Apply Filter" button, this can cause tens of thousands of pause/unpause calls and the process appears to be very unresponsive. Since emulation is already paused for the call torc_client_do_frame
so it can do multiple reads without repeatedly pausing emulation, we want to offload the actual filtering logic into thedo_frame
loop so it can benefit from the "already paused" state while reading memory.