.WaitForNMI PHA ; Store A on the stack to preserve it LDX nmiCounter ; Set X to the NMI counter, which increments with each ; call to the NMI handler .wnmi1 SETUP_PPU_FOR_ICON_BAR ; If the PPU has started drawing the icon bar, configure ; the PPU to use nametable 0 and pattern table 0 CPX nmiCounter ; Loop back to wnmi1 until the NMI counter changes, BEQ wnmi1 ; which will happen when the NMI handler has been called ; again (i.e. at the next VBlank) PLA ; Retrieve A from the stack so that it's preserved RTS ; Return from the subroutineName: WaitForNMI [Show more] Type: Subroutine Category: Utility routines Summary: Wait until the next NMI interrupt has passed (i.e. the next VBlank)Context: See this subroutine in context in the source code References: This subroutine is called as follows: * CheckSaveSlots calls WaitForNMI * ChooseLanguage calls WaitForNMI * ChooseMusic_b6 calls WaitForNMI * DEATH2 calls WaitForNMI * DELAY calls WaitForNMI * DrawEquipment calls WaitForNMI * EQSHP calls WaitForNMI * FadeToBlack calls WaitForNMI * FadeToColour calls WaitForNMI * FastForwardJump calls WaitForNMI * LOOK1 calls WaitForNMI * PauseGame calls WaitForNMI * ResetMusicAfterNMI calls WaitForNMI * ResetStardust calls WaitForNMI * SendViewToPPU calls WaitForNMI * SetupViewInNMI calls WaitForNMI * ShowScrollText calls WaitForNMI * TT102 calls WaitForNMI * TT110 calls WaitForNMI * TT16 calls WaitForNMI * TT18 calls WaitForNMI * WaitFor2NMIs calls WaitForNMI * WARP calls WaitForNMI
Returns: A A is preserved
[X]
Macro SETUP_PPU_FOR_ICON_BAR (category: PPU)
If the PPU has started drawing the icon bar, configure the PPU to use nametable 0 and pattern table 0
[X]
Variable nmiCounter in workspace WP
A counter that increments every VBlank at the start of the NMI handler
[X]
Label wnmi1 is local to this routine