Skip to navigation

Elite on the BBC Micro and NES

Utility routines: WaitForNextNMI

[NES version, Bank 7]

Name: WaitForNextNMI [Show more] Type: Subroutine Category: Utility routines Summary: An unused routine that waits until the NMI counter increments (i.e. the next VBlank)
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
.WaitForNextNMI LDA nmiCounter ; Set A to the NMI counter, which increments with each ; call to the NMI handler .wfrm1 CMP nmiCounter ; Loop back to wfrm1 until the NMI counter changes, BEQ wfrm1 ; which will happen when the NMI handler has been called ; again (i.e. at the next VBlank) RTS ; Return from the subroutine