Skip to navigation


Utility routines: Delay

Name: Delay [Show more] Type: Subroutine Category: Utility routines 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: * AlienInAcornsville calls Delay * Crash calls Delay

This routine performs A^3 loop iterations, to create a delay. Fragments of the original source for this routine appear in the game code, as follows: .dlp2 STA&76 .dl ... ... :BNE dlp2 DEC&74:BNE dlp1 rts
.Delay STA T \ Set T as the counter for the outer loop .dely1 STA U \ Set U as the counter for the middle loop .dely2 STA V \ Set V as the counter for the inner loop .dely3 DEC V \ Loop around for A iterations in the inner loop BNE dely3 DEC U \ Loop around for A iterations in the middle loop BNE dely2 DEC T \ Loop around for A iterations in the outer loop BNE dely1 RTS \ Return from the subroutine