I'm trying to understand how the special behavior related to reading $2002 around the point where the vbl flag is set works. Here are two (semi-)related questions:
1. What's the ideal PPU/CPU alignment to assume in an emulator? One where the the CPU and PPU ticks line up like below? (Alignments where they don't line up nicely are possible since the PPU divides the master clock by 4.)
2. When the wiki says e.g. "reading one PPU clock before reads it as clear and never sets the flag or generates NMI for that frame" (on http://wiki.nesdev.com/w/index.php/PPU_frame_timing), is that referring to a situation like below?
If so, does that mean that there's no special-case behavior for e.g.
? (I.e., will that read the flag as false and later set it and generate an NMI?)
1. What's the ideal PPU/CPU alignment to assume in an emulator? One where the the CPU and PPU ticks line up like below? (Alignments where they don't line up nicely are possible since the PPU divides the master clock by 4.)
Code:
[ CPU tick ][ CPU tick ]
[PPU tick][PPU tick][PPU tick][PPU tick][PPU tick][PPU tick]
[PPU tick][PPU tick][PPU tick][PPU tick][PPU tick][PPU tick]
2. When the wiki says e.g. "reading one PPU clock before reads it as clear and never sets the flag or generates NMI for that frame" (on http://wiki.nesdev.com/w/index.php/PPU_frame_timing), is that referring to a situation like below?
Code:
CPU: [ Read $2002 ]
PPU: [............][Set VBL flag][............]
PPU: [............][Set VBL flag][............]
If so, does that mean that there's no special-case behavior for e.g.
Code:
CPU: [ Read $2002 ]
PPU: [............][............][Set VBL flag]
PPU: [............][............][Set VBL flag]
? (I.e., will that read the flag as false and later set it and generate an NMI?)