Skip to navigation

Graphics: DecayScreenToBlack

Name: DecayScreenToBlack [Show more] Type: Subroutine Category: Graphics Summary: Smother the screen with randomly placed black dots to decay the screen to black
Context: 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
.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 subroutine