.SecretCodeError JSR ResetVariables \ Reset all the game's main variables LDA #0 \ Call DrawTitleScreen with A = 0 to draw the title JSR DrawTitleScreen \ screen LDA #&87 \ Set the palette to the second set of colours from the JSR SetColourPalette \ colourPalettes table, which contains the fixed palette \ for the title screens (blue, black, red, yellow) LDX #3 \ Print text token 3: Background colour blue, print JSR PrintTextToken \ "WRONG SECRET CODE" at (64, 768), print "PRESS ANY \ KEY" at (64, 100), set text background to black JSR ReadKeyboard \ Enable the keyboard, flush the keyboard buffer and \ read a character from it (so this waits for a key \ press) JMP main1 \ Loop back to main1 to restart the main title loopName: SecretCodeError [Show more] Type: Subroutine Category: Main title loop Summary: Display the "WRONG SECRET CODE" error, wait for a key press and rejoin the main title loop Deep dive: Program flow of the main title loopContext: See this subroutine in context in the source code References: This subroutine is called as follows: * PreviewLandscape calls SecretCodeError
[X]
Subroutine DrawTitleScreen (category: Title screen)
Draw the title screen or the screen showing the secret code
[X]
Subroutine PrintTextToken (category: Text)
Print a recursive text token
[X]
Subroutine ReadKeyboard (category: Keyboard)
Enable the keyboard and read a character from it
[X]
Subroutine ResetVariables (category: Main title Loop)
Reset all the game's main variables
[X]
Subroutine SetColourPalette (category: Graphics)
Set the logical colours for each of the four physical colours in screen mode 5
[X]
Entry point main1 in subroutine MainTitleLoop (category: Main title loop)
The entry point for rejoining the main title loop after the player enters an incorrect secret code