Skip to content

add rc_client_set_allow_background_memory_reads #439

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Jamiras
Copy link
Member

@Jamiras Jamiras commented Jun 2, 2025

Allows a client to specify that memory reads should only occur within the context of rc_client_do_frame or rc_client_idle. The trade-off is that the work requiring the memory reads could be delayed by as much as however infrequently rc_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 to rc_client_do_frame so it can do multiple reads without repeatedly pausing emulation, we want to offload the actual filtering logic into the do_frame loop so it can benefit from the "already paused" state while reading memory.

@Jamiras Jamiras added this to the 12.0.0 milestone Jun 2, 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.

2 participants