Prev: D615 Up: Map Next: D635
D629: Play Projectile Sound
Used by the routine at FireProjectile.
Makes the sound of a projectile that has been fired, from thirty-two single cycles of a tone whose pitch changes each cycle, in a way that depends on the value that B has when the routine is called.
Input
B Starting value of the pitch
Play thirty-two cycles of a changing tone.
PlayProjectileSound D629 LD C,$20 Set the number of cycles to 20.
PlayProjectileSound_Loop D62B LD A,C Fetch the number of cycles left.
D62C SUB B Take away the pitch.
D62D LD B,A Set it as the new pitch.
D62E CALL PlaySquareWave Call PlaySquareWave to make a cycle of the tone.
D631 DEC C Count the cycle.
D632 JR NZ,PlayProjectileSound_Loop Jump to PlayProjectileSound_Loop until all of the cycles have been made.
D634 RET Return.
View the equivalent code in;
Prev: D615 Up: Map Next: D635