Prev: 6825 Up: Map Next: 6854
683E: Play Rising Tone
Used by the routine at TestFlourCollision.
Plays a tone which rises in pitch. The more actors there are in play (ActorsInPlay), the longer the tone. The audio is for 04 actors in play.
PlayRisingTone 683E LD A,($5F1B) Fetch the number of actors in play.
6841 RLCA Multiply by 08 (rotating the bits).
6842 RLCA
6843 RLCA
6844 OR %00000111 Set bits 0-2.
6846 LD C,A Set the cycle counter; the more actors in play, the longer the tone.
PlayRisingTone_Loop 6847 LD A,C Fetch the cycle counter.
6848 XOR %01000000 Flip bit 6.
684A LD D,A Use the result as the period.
684B CALL PlaySquareWave Play a cycle using PlaySquareWave.
684E DEC C Decrease the cycle counter by one.
684F RET Z Return if all of the cycles have been played.
6850 DEC C Decrease the cycle counter by one.
6851 RET Z Return if all of the cycles have been played.
6852 JR PlayRisingTone_Loop Jump back to PlayRisingTone_Loop to play the next cycle.
Prev: 6825 Up: Map Next: 6854