LDY #2 \ Set Y to 2 vertical syncs EQUB &2C \ Skip the next instruction by turning it into \ &2C &A0 &08, or BIT &08A0, which does nothing apart \ from affect the flags .DEL8 LDY #8 \ Set Y to 8 vertical syncs and fall through into DELAY \ to wait for this long .DELAY JSR WSCAN \ Call WSCAN to wait for the vertical sync, so the whole \ screen gets drawn DEY \ Decrement the counter in Y BNE DELAY \ If Y isn't yet at zero, jump back to DELAY to wait \ for another vertical sync \ --- Mod: Code added for Demonstration Disc: ---------> PHA \ Store A and X on the stack TXA PHA JSR ProcessDemoKeys \ Process the key presses that are supported in the demo \ (COPY to pause, DELETE to unpause, ESCAPE to quit, "Q" \ and "S" for sound disable/enable) PLA \ Retrieve A and X from the stack TAX PLA LDY #0 \ Set Y = 0 to return from the subroutine \ --- End of added code -------------------------------> RTS \ Return from the subroutineName: DELAY [Show more] Type: Subroutine Category: Utility routines Summary: Wait for a specified time, in 1/50s of a secondContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DelayFiveSeconds calls DELAY * dn2 calls DELAY * gnum calls DELAY * TITLE calls DELAY * TT17 calls DELAY * TT219 calls DELAY * Main game loop (Part 5 of 6) calls via DELAY-5
Wait for the number of vertical syncs given in Y, so this effectively waits for Y/50 of a second (as the vertical sync occurs 50 times a second).
Arguments: Y The number of vertical sync events to wait for
Other entry points: DEL8 Wait for 8/50 of a second (0.16 seconds) DELAY-5 Wait for 2/50 of a second (0.04 seconds)
[X]
Subroutine DELAY (category: Utility routines)
Wait for a specified time, in 1/50s of a second
[X]
Subroutine ProcessDemoKeys (category: Demo)
Process the key presses that are supported in the demo (COPY to pause, DELETE to unpause, ESCAPE to quit, "Q" and "S" for sound)
[X]
Subroutine WSCAN (category: Drawing the screen)
Wait for the vertical sync