The $2002.7 VBlank flag clears itself aftter reading. I just wanna to know if :
bit $2002
would be consider like reading it or if it's just a method to avoid clearing this flag.
Also, while writing a value to $2000 with the MSB set will enable NMI at VBlanks. If I want to enable NMIs, but avoiding to trigger one just after this writing if a VBlank as already begun, would a $2002 reading be the thing ?
bit $2002
would be consider like reading it or if it's just a method to avoid clearing this flag.
Also, while writing a value to $2000 with the MSB set will enable NMI at VBlanks. If I want to enable NMIs, but avoiding to trigger one just after this writing if a VBlank as already begun, would a $2002 reading be the thing ?
Code:
lda $2002 ;Clear NMI flag
lda #$88 ;Turn on NMI for next frame
sta $2000 ;A NMI can't be trigger right now because the VBlank flag is clear
lda #$88 ;Turn on NMI for next frame
sta $2000 ;A NMI can't be trigger right now because the VBlank flag is clear