NMI and the VBLANK status flag become active/inactive at the same time.NMI can only happen at the beginning of an instruction, but LDA instructions don't perform the read until the end of the instruction.Thus, in a "label: LDA $2002 ; BPL label" loop, there are 3 possible outcomes:

1. NMI happens during the LDA instruction, causing the accumulator to have bit 7 set; the next read from $2002 will have bit 7 clear.2. NMI happens during the BPL instruction, causing the accumulator to have bit 7 clear; the next read from $2002 will have bit 7 set (unless you wait past the end of VBLANK).3. NMI happens exactly at the end of the LDA instruction, causing the accumulator to have bit 7 clear and the next read from $2002 to also have bit 7 clear.

_________________Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum