Prev: 25677 Up: Map Next: 25733
25715: Play Repellent Hit Sound
Used by the routine at StunBug.
Plays 15 square waves of nearly constant pitch.
PlayRepellentHitSound 25715 LD C,15 Set the wave counter in C to 15.
PlayRepellentHitSound_Loop 25717 LD A,C Fetch the wave counter.
25718 RRCA Rotate the wave counter right three times.
25719 RRCA
25720 RRCA
25721 AND %00000111 Keep only bits 0-2.
25723 CPL Invert all of the bits in A.
25724 DAA Decimal adjust A.
25725 LD D,A Use the result as the duration of the wave in D.
25726 CALL PlaySquareWave Call PlaySquareWave.
25729 DEC C Decrease the wave counter by one.
25730 JR NZ,PlayRepellentHitSound_Loop Loop back to PlayRepellentHitSound_Loop until all of the waves have been played.
25732 RET Return.
Prev: 25677 Up: Map Next: 25733