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

Poor frame syncronisation causes screen flickering #4

Open
TakuikaNinja opened this issue Mar 15, 2024 · 0 comments
Open

Poor frame syncronisation causes screen flickering #4

TakuikaNinja opened this issue Mar 15, 2024 · 0 comments

Comments

@TakuikaNinja
Copy link

You are probably very aware of the screen flicker issue.
I had a look at this in Mesen2's event viewer and I can see why it has this problem. Your screen updates are frequently occurring outside of vertical blank. The PPU's VRAM can only be written to safely during blanking (vertical blank at the start of NMI, or forced blanking). During rendering, PPU accesses behave in an unpredictable manner as it is doing its own fetches to draw the screen.

Unfortunately, this seems to be a symptom of much bigger problem - Your program logic does not appear to be synchronised with PPU frames in any way. A more sensible approach on this system would be to implement a Main & NMI handler thread, as recommended by NESdev Wiki:

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