.DecayScreenToBlack STA blackDotCounter \ Set blackDotCounter to the number of 2400-dot \ plotting cycles we need to perform .deca1 LDA #30 \ Set loopCounter = 30 for the inner loop, so each STA loopCounter \ iteration of the inner loop draws 30 * 80 = 2400 dots .deca2 JSR DrawBlackDots \ Draw 80 randomly positioned dots on the screen in \ colour 1 (black) to fade the screen to black in a \ slowly decaying manner JSR ProcessSound \ Process any sounds or music that are being made in the \ background DEC loopCounter \ Loop back to plot another 80 dots until we have done BNE deca2 \ this 30 times (to give a total of 2400 dots) DEC blackDotCounter \ Loop back to plot 80 * 30 dots until we have done this BNE deca1 \ blackDotCounter times (to give a total of \ 2400 * blackDotCounter dots) RTS \ Return from the subroutineName: DecayScreenToBlack [Show more] Type: Subroutine Category: Graphics Summary: Smother the screen with randomly placed black dots to decay the screen to blackContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ShowGameOverScreen calls DecayScreenToBlack
Arguments: A The number of 2400-dot plotting cycles to perform when decaying the screen
[X]
Subroutine DrawBlackDots (category: Graphics)
Draw 80 randomly positioned dots on the screen in colour 1 (black)
[X]
Subroutine ProcessSound (category: Sound)
Process any sound effects that have been configured so they play in the background (this is called regularly throughout gameplay)
[X]
Variable blackDotCounter in workspace Zero page
A counter for black dots that are drawn in the screen decaying routine
[X]
Label deca1 is local to this routine
[X]
Label deca2 is local to this routine
[X]
Variable loopCounter in workspace Zero page
A general-purpose loop counter