Prev: 689A Up: Map Next: 68BF
68B1: Play Square Wave
Plays one cycle of a square wave; the speaker is switched on for a period of time and then switched off for the same amount of time.
Input
D Duration of wave
PlaySquareWave 68B1 LD A,$10 Play square wave sound.
68B3 OUT ($FE),A
68B5 LD B,D
PlaySquareWave_Loop 68B6 DJNZ PlaySquareWave_Loop
68B8 XOR A Play "silence".
68B9 OUT ($FE),A
68BB LD B,D
Silence_Loop 68BC DJNZ Silence_Loop
68BE RET Return.
View the equivalent code in;
Prev: 689A Up: Map Next: 68BF