Prev: 28888 Up: Map Next: 29152
29139: Make Click
Used by the routines at PlayCrashSound and PlayBeamSound.
Makes a click with the speaker: the speaker is on for a time that is set by B and off for a time that is set by D. PlayNoise uses it to make noise.
Input
B Length of the time that the speaker is on
D Length of the time that the speaker is off
MakeClick 29139 LD A,16 Turn the speaker on.
29141 OUT (254),A Send that to the speaker.
MakeClick_Delay 29143 DJNZ MakeClick_Delay Hold the speaker on for the time in B.
29145 XOR A Turn the speaker off.
29146 OUT (254),A Send that to the speaker.
29148 LD B,D The off-time becomes the delay.
MakeClick_Wait 29149 DJNZ MakeClick_Wait Hold the speaker off for that time.
29151 RET Return.
View the equivalent code in;
Prev: 28888 Up: Map Next: 29152