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

Added waitVSYNCStart and getVSYNCActive functions #131

Merged
merged 4 commits into from
Aug 25, 2021

Conversation

nestornillo
Copy link
Collaborator

This PR implements Kevin Thacker's contributed routines for VSYNC test from Issue #50

@nestornillo
Copy link
Collaborator Author

cpct_waitVSYNCStart
I've named the function cpct_waitVSYNCStart instead of cpct_syncVSYNCStart: The purpose of the code is to 'sync', but the function just 'waits'. It is ok?

Kevin's code in issue #50 had 3 wait loops, I don't think the first one is needed. Or am I missing something?

Not sure about worst case time measurement: worst case is when vsync is activated just before 'wait_for_vs_inactive' loop starts. Next vsync (19968 us later, I think) will start during 'wait_for_vs_active' loop, but I don't know exactly in which points can happen (also, what happens if vsync raises in the middle of a 'in a,(c)'?).
I've supposed for worst case that vsync raises again just before rra in 'wait_for_vs_active' loop, so I've used this:
2 (ld) + 19968 + 4 (rra + jr_no_cc) + 7 (in + rra + jr_cc) + 3 (ret) = 19984

cpct_getVSYNCActive
Kevin's routine uses HL to return the result, but I've chopped the code to use only L, as it only returns 1 or 0.

@lronaldo
Copy link
Owner

I think your reviews and comments are very valuable. Thank you again for taking the time to analyze things deep and make the best proposals possible. Users will certainly be very grateful for your efforts 👍 😄

I have made a review of your proposal with detailed comments for you to check and comment back. If you don't mind, I will accept your PR and proceed to add proposed changes. Then, if you have more interesting comments on them, we can continue reviewing and updating files later on :)

@lronaldo lronaldo merged commit 65a749c into lronaldo:development Aug 25, 2021
@nestornillo nestornillo deleted the patch-VSYNC branch August 25, 2021 17:38
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.

None yet

2 participants