tepples wrote:Usually, at least the first two frames' vblank have no /NMI because the CPU is still waiting for the PPU to stabilize before enabling NMI generation in $2000.
That solves my second question, thank you!
However, I still have no clue about the first. Let me clarify a little bit, since my explanation might be confusing:
The first NMI takes place on cycle 86972. This line
Code: Select all
C7DC 8D 00 20 STA $2000 = 10 A:90 X:00 Y:00 P:A4 SP:FF PPU:208, 47 CYC:64980
occurs in the same frame this first NMI happens. This line toggles bit 7 of $2000 and no other instruction accesses this address until some cycles after NMI has been handled. However, AFAIK, for NMI to occur PPU has to be in VBLANK (bit 7 of $2002 toggled) and bit 7 of $2000 must be toggled during VBLANK (i.e. 0->1, but being 1 before VBLANK starts shouldn't trigger NMI, should it? [edge-sensitivity?]).
So, my question is: Why is NMI, indeed, triggered, given what I exposed? Am I missing something?