Prev: 7234 Up: Map Next: 725C
724C: Play Hit Sound
Plays a falling note of 10 beeps. It is used when an object is hit, destroyed or damaged.
PlayHitSound 724C LD C,$10 The falling note has 10 beeps.
This entry point is used by the routine at PlayExplosionHitSound.
PlayHitSound_Loop 724E LD A,C The pitch starts at the number of beeps left.
724F ADD A,A Double it.
7250 ADD A,A Double it again, so the note falls quickly.
7251 CPL Invert it so the note falls as the count does.
7252 AND %01111111 Keep the bits of A that are set in 7F.
7254 LD B,A That is the half-period of this beep.
7255 CALL PlaySquareWave Call PlaySquareWave.
7258 DEC C One beep of the falling note has been played.
7259 JR NZ,PlayHitSound_Loop Jump to PlayHitSound_Loop if the zero flag is clear.
725B RET Return.
Prev: 7234 Up: Map Next: 725C