Skip to navigation


Main loop: MainLoop (Part 12 of 15)

Name: MainLoop (Part 12 of 15) [Show more] Type: Subroutine Category: Main loop Summary: Spend at least 9 centiseconds processing lines from the linesToHide list Deep dive: Program flow of the main game loop Scheduling tasks in the main loop
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
.main20 LDA relatedPoints \ If the relatedPoints list contains 35 or more entries, CMP #35 \ jump to main21 to skip the following three BCS main21 \ instructions JSR ProcessLinesToHide \ Process three lines from the linesToHide list, if JSR ProcessLinesToHide \ there are any unprocessed lines there JSR ProcessLinesToHide .main21 LDX #&70 \ Call OSWORD with A = 1 and (Y X) = &0070, which reads LDY #&00 \ the system clock and writes the result into the five LDA #1 \ bytes from &0070 to &0074 (P, Q, R, S and T). For the JSR OSWORD \ purposes of the call to CheckTimePassed, P is set to \ the least significant byte of the time, which \ increments 100 times a second JSR CheckTimePassed \ If fewer than 9 centiseconds have passed since the BCC main20 \ first time we were here on this iteration of the main \ loop, then we haven't yet spent enough time processing \ lines from the linesToHide list, so jump back to \ main20 to do a few more