Prev: BF6D Up: Map Next: BF84
BF74: Play Square Wave Sound
Used by the routines at BF17, BF2F and PlayWaveSequence.
Input
B Duration of wave
Flip speaker on (set bit 4).
PlaySquareWave BF74 LD A,%00010000 A=10 (speaker on = bit 4).
BF76 OUT ($FE),A
BF78 LD A,B A=B.
PlaySquareWave_Loop BF79 DJNZ PlaySquareWave_Loop Decrease duration by one and loop back to PlaySquareWave_Loop until counter is zero.
BF7B LD B,A B=A.
Flip speaker off (unset bit 4).
BF7C XOR A Speaker off.
BF7D OUT ($FE),A
BF7F LD A,B A=B.
Silence_Loop BF80 DJNZ Silence_Loop Decrease duration by one and loop back to Silence_Loop until counter is zero.
BF82 LD B,A B=A.
BF83 RET Return.
View the equivalent code in;
Prev: BF6D Up: Map Next: BF84