Skip to navigation

Main loop: Delay

Name: Delay [Show more] Type: Subroutine Category: Main loop Summary: Delay for a specified number of loops
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MoveAndDrawCars calls Delay

This routine performs T + (5 * 256) loop iterations, to create a delay. The value of T doesn't have much effect on the amount of delay, so it looks like this variable was chosen simply because it doesn't contain anything useful at this point.
.Delay LDX #6 \ Set X as the counter for the outer loop .dely1 DEC T \ Loop around for T iterations in the inner loop BNE dely1 DEX \ Loop around for X iterations in the outer loop BNE dely1 RTS \ Return from the subroutine