Skip to navigation

Aviator on the BBC Micro

Main loop: MainLoop (Part 2 of 15)

Name: MainLoop (Part 2 of 15) [Show more] Type: Subroutine Category: Main loop Summary: Reset object statuses and related points Deep dive: Program flow of the main game loop
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
.main3 \ We now want to zero the 40 bytes in objectStatus, so \ that all objects are marked as unprocessed, ready to \ be processed again in this iteration of the main loop LDX #19 \ We do this as two blocks of 20 bytes, so set a counter \ in X to use in the loop below LDA #0 \ Set showRunwayDashes = 0 to reset the dashes down the STA showRunwayDashes \ middle of the runway to be visible STA relatedPoints \ Set relatedPoints = 0 to reset the relatedPoints list, \ so we can build a new list of related object points \ in this iteration of the main loop .main4 STA objectStatus,X \ Zero the X-th byte of objectStatus STA objectStatus+20,X \ Zero the X-th byte of objectStatus+20 DEX \ Decrement the loop counter BPL main4 \ Loop back until we have zeroed all 40 bytes