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

Add option to reduce flickering #278

Open
stevesims opened this issue Jan 20, 2025 · 1 comment
Open

Add option to reduce flickering #278

stevesims opened this issue Jan 20, 2025 · 1 comment

Comments

@stevesims
Copy link
Contributor

Display controllers process drawing primitives with a separate process. The amount of time made available to the drawing process is limited to try to ensure that drawing does not conflict with scan-out, and to minimise flicker.

The amount of time made available to the drawing process is calculated inside vdp-gl - as part of that it checks to see whether a "process primitives on blank" flag has been set (where "blank" is the vertical sync time between frame scan-outs). Our current setup does not change this flag, so it remains false, which means that the drawing process gets slightly more time to operate, but with the risk that it will overlap scan-out and cause flicker.

Calling setProcessPrimitivesOnBlank(true) before the screen resolution it set would ensure that the available processing time is more tightly restricted, and thus less flicker.

We could add a feature flag to ensure that setProcessPrimitivesOnBlank(true) is called on mode change, thus providing an option to reduce drawing flicker.

@stevesims
Copy link
Contributor Author

NB this option only currently exists in vdp-gl for paletted controllers. the calculation for the available time is made inside a calculateAvailableCyclesForDrawings function which is called by setResolution

for the plain VGAController an equivalent calculation for calculating the available time is calculated in setResolution as m_maxVSyncISRTime. the calculation performed is very similar to the false variant in paletted controllers, but with a few subtle differences - this may indicate a slight mistake in one of these calculations

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

No branches or pull requests

1 participant