Prev: 54805 Up: Map Next: 54837
54825: 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 54825 LD C,32 Set the number of cycles to 32.
PlayProjectileSound_Loop 54827 LD A,C Fetch the number of cycles left.
54828 SUB B Take away the pitch.
54829 LD B,A Set it as the new pitch.
54830 CALL PlaySquareWave Call PlaySquareWave to make a cycle of the tone.
54833 DEC C Count the cycle.
54834 JR NZ,PlayProjectileSound_Loop Jump to PlayProjectileSound_Loop until all of the cycles have been made.
54836 RET Return.
View the equivalent code in;
Prev: 54805 Up: Map Next: 54837