.SOBLIP BIT DNOIZ ; If bit 7 of DNOIZ is non-zero, then sound is disabled, BMI SOUR ; so return from the subroutine (as SOUR contains an ; RTS) STX T3 ; Store the period in T3 .BEEPL2 LDA $C030 ; Toggle the state of the speaker (i.e. move it in or ; out) by reading the SPEAKER soft switch DEC T3 ; Decrement the period in T3 LDX T3 ; Loop around for T3 iterations, waiting for two cycles DEX ; in each iteration, so as the sound continues and T3 NOP ; decreases, the wait gets shorter and the frequency of BNE P%-2 ; the sound rises DEY ; Decrement the sound length in Y BNE BEEPL2 ; Loop back to make another click and wait for a ; decreasing amount of time between clicks, until we ; have made a sound consisting of Y clicks LDA $C030 ; Toggle the state of the speaker (i.e. move it in or ; out) by reading the SPEAKER soft switch RTS ; Return from the subroutineName: SOBLIP [Show more] Type: Subroutine Category: Sound Summary: Make the sound of the hyperspace drive being engaged, or the sound of the E.C.M.Context: See this subroutine in context in the source code References: This subroutine is called as follows: * LL164 calls SOBLIP * Main flight loop (Part 16 of 16) calls SOBLIP
Arguments: X The period of the sound (a bigger value means a lower pitch) Y The type of sound (i.e. the length of the sound): * 20 = the sound of the E.C.M going off (part 16 of the main flight loop) * 90 = the sound of the hyperspace drive being engaged (LL164)
[X]
Label BEEPL2 is local to this routine
[X]
Variable DNOIZ in workspace Option variables
Sound on/off configuration setting