Prev: D629 Up: Map Next: D64E
D635: Play Footstep Sound
Used by the routine at StepLegs.
Makes the sound of a footstep, on every fourth call, which alternates between two pitches.
Play a tone on every fourth footstep.
PlayFootstepSound D635 LD HL,$A748 Take the count of the footsteps, FootstepCounter.
D638 INC (HL) Add one to it.
D639 LD A,(HL) Fetch it.
D63A BIT 2,A Jump to PlayFootstepSound_Other if bit 2 of the count is not set.
D63C JR Z,PlayFootstepSound_Other
D63E AND %00000011 Keep the lowest two bits.
D640 RET NZ Return if the count is not a multiple of four.
D641 LD BC,$4002 Set the pitch to 40 and the length to 02.
D644 JR PlayWaveSequence Jump to PlayWaveSequence to make the tone.
Play the other pitch on the other fourth steps.
PlayFootstepSound_Other D646 AND %00000011 Keep the lowest two bits.
D648 RET NZ Return if the count is not a multiple of four.
D649 LD BC,$6002 Set the pitch to 60 and the length to 02.
D64C JR PlayWaveSequence Jump to PlayWaveSequence to make the tone.
Prev: D629 Up: Map Next: D64E