Prev: 49005 Up: Map Next: 49028
49012: Play Square Wave Sound
Used by the routines at 48919, 48943 and PlayWaveSequence.
Input
B Duration of wave
Flip speaker on (set bit 4).
PlaySquareWave 49012 LD A,%00010000 A=16 (speaker on = bit 4).
49014 OUT (254),A
49016 LD A,B A=B.
PlaySquareWave_Loop 49017 DJNZ PlaySquareWave_Loop Decrease duration by one and loop back to PlaySquareWave_Loop until counter is zero.
49019 LD B,A B=A.
Flip speaker off (unset bit 4).
49020 XOR A Speaker off.
49021 OUT (254),A
49023 LD A,B A=B.
Silence_Loop 49024 DJNZ Silence_Loop Decrease duration by one and loop back to Silence_Loop until counter is zero.
49026 LD B,A B=A.
49027 RET Return.
View the equivalent code in;
Prev: 49005 Up: Map Next: 49028