.Crash LDA #0 \ Turn off the engine sound JSR ToggleEngineSound LDA #5 \ Make sound #5, the sound of a crash JSR MakeSound LDX #%11111111 \ Fill the canopy with white, leaving the canopy edges JSR FillCanopy \ alone, to give a flash effect LDA #10 \ Delay for 10^3 loop iterations JSR Delay JSR ClearCanopy \ Clear the canopy to black, leaving the canopy edges \ alone JSR DrawCanopyCorners \ Redraw the diagonal canopy corners, which were cleared \ by the flashing canopy effect LDA #90 \ Delay for 90^3 loop iterations JSR Delay JSR TerminateGame \ Terminate the game TSX \ Remove six bytes from the top of the stack, which TXA \ removes the top three return addresses that were put CLC \ there by JSR instructions. This enables us to jump ADC #6 \ straight back to NewGame without leaving any remnants TAX \ of the call stack behind TXS JMP NewGame \ Jump to NewGame to start a new gameName: Crash [Show more] Type: Subroutine Category: Flight model Summary: Make a crashing sound, flash the canopy and start a new gameContext: See this subroutine in context in the source code References: This subroutine is called as follows: * CheckFlyingSkills (Part 2 of 2) calls Crash * ProcessLanding (Part 6 of 7) calls Crash
[X]
Subroutine ClearCanopy (category: Graphics)
Clear the canopy to black, leaving the canopy edges alone
[X]
Subroutine Delay (category: Utility routines)
Delay for a specified number of loops
[X]
Subroutine DrawCanopyCorners (category: Graphics)
Draw the diagonal corners at the top of the canopy
[X]
Subroutine FillCanopy (category: Graphics)
Fill the canopy with a specified colour, leaving the canopy edges alone
[X]
Subroutine MakeSound (category: Sound)
Make a sound
[X]
Subroutine NewGame (category: Setup)
Start a new game
[X]
Subroutine TerminateGame (category: Setup)
Terminate the current game
[X]
Subroutine ToggleEngineSound (category: Sound)
Turn the engine sound on or off