Skip to content

Poor frame syncronisation causes screen flickering #4

@TakuikaNinja

Description

@TakuikaNinja

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions