Prev: D5D7 Up: Map Next: D5F2
D5E4: Play Jump Sound
Used by the routine at HandleJump.
Makes the rattling noise of a jump, from sixteen single cycles of a tone whose pitch jumps about.
Play sixteen cycles of a rattling tone.
PlayJumpSound D5E4 LD C,$10 Set the number of cycles to 10.
PlayJumpSound_Loop D5E6 LD A,C Fetch the number of cycles left.
D5E7 XOR %10100101 Scramble it.
D5E9 ADD A,C Add the number of cycles left again, to make the pitch.
D5EA LD B,A Put the pitch in B.
D5EB CALL PlaySquareWave Call PlaySquareWave to make a cycle of the tone.
D5EE DEC C Count the cycle.
D5EF JR NZ,PlayJumpSound_Loop Jump to PlayJumpSound_Loop until all of the cycles have been made.
D5F1 RET Return.
View the equivalent code in;
Prev: D5D7 Up: Map Next: D5F2