Prev: 611B Up: Map Next: 6158
614B: Play Square Wave
Used by the routines at SoundsBounce, SoundsCupRefuel and SoundsEngine.
Plays one cycle of a square wave. The speaker is flipped, then flipped back again after a delay of the same length.
Input
D Delay count for each half of the wave
PlaySquareWave 614B CALL PlaySound Flip the speaker using PlaySound.
614E LD B,D Set the delay counter to the period of the wave.
PlaySquareWave_Loop_1 614F DJNZ PlaySquareWave_Loop_1 Decrease the delay counter by one and loop back to PlaySquareWave_Loop_1 until the first half of the wave is over.
6151 CALL PlaySound Flip the speaker using PlaySound.
6154 LD B,D Set the delay counter to the period of the wave.
PlaySquareWave_Loop_2 6155 DJNZ PlaySquareWave_Loop_2 Decrease the delay counter by one and loop back to PlaySquareWave_Loop_2 until the second half of the wave is over.
6157 RET Return.
View the equivalent code in;
Prev: 611B Up: Map Next: 6158