Skip to navigation


Main loop: Main game loop (Part 6 of 6)

[NES version, Bank 0]

Name: Main game loop (Part 6 of 6) [Show more] Type: Subroutine Category: Main loop Summary: Process non-flight key presses (icon bar selections) Deep dive: Program flow of the main game loop
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * BAY calls via FRCE

This is the second half of the minimal game loop, which we iterate when we are docked. This section covers the following: * Process icon bar selections It also supports joining the main loop with a key already "pressed", so we can jump into the main game loop to perform a specific action. In practice, this is used when we enter the docking bay in BAY to display the Status Mode screen.
Other entry points: FRCE The entry point for the main game loop if we want to jump straight to a specific screen, by pretending to "press" a key, in which case A contains the internal key number of the key we want to "press"
.FRCE JSR TT102 ; Call TT102 to process the key pressed in A JMP TT100 ; Jump to TT100 to restart the main loop from the start