Skip to navigation

Main title loop: SecretCodeError

Name: 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 loop
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * PreviewLandscape calls SecretCodeError
.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 loop