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

More consistent polling of snes ram #8

Closed
freddyJarva opened this issue Dec 13, 2021 · 1 comment · Fixed by #17
Closed

More consistent polling of snes ram #8

freddyJarva opened this issue Dec 13, 2021 · 1 comment · Fixed by #17
Assignees

Comments

@freddyJarva
Copy link
Owner

Right now, polling will occur after all logic checks have been done, + a sleep time of 16 milliseconds (or whatever the update frequency is set to). This makes the polling rate dependent on how fast the code can work through the previous ram dump, which in turn makes the rate inconsistent and will also vary depending on the power of the hardware it's running on.

One solution is to make the ram fetching run in a separate thread that pushes responses to a queue that the 'parser' thread will consume. Separating the fetching from the parsing will probably make the code a bit cleaner as well.

Also, the time the thread sleeps should not be a set value, but rather something along the lines of update_frequency - time_elapsed_since_previous_poll

@freddyJarva
Copy link
Owner Author

Would probably be a good idea to let the fetch thread supply timestamps to the parser as well, so that timestamp reflects 'time of snes read' instead of 'time when parser thread evaluated an event/check/transition to have triggered'.

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 a pull request may close this issue.

1 participant