Prev: 644D Up: Map Next: 6485
6473: Play Repellent Hit Sound
Used by the routine at StunBug.
Plays 0F square waves of nearly constant pitch.
PlayRepellentHitSound 6473 LD C,$0F Set the wave counter in C to 0F.
PlayRepellentHitSound_Loop 6475 LD A,C Fetch the wave counter.
6476 RRCA Rotate the wave counter right three times.
6477 RRCA
6478 RRCA
6479 AND %00000111 Keep only bits 0-2.
647B CPL Invert all of the bits in A.
647C DAA Decimal adjust A.
647D LD D,A Use the result as the duration of the wave in D.
647E CALL PlaySquareWave Call PlaySquareWave.
6481 DEC C Decrease the wave counter by one.
6482 JR NZ,PlayRepellentHitSound_Loop Loop back to PlayRepellentHitSound_Loop until all of the waves have been played.
6484 RET Return.
Prev: 644D Up: Map Next: 6485