Prev: 40557 Up: Map Next: 40595
40582: Play Pulse
Used by the routines at PlayDefaultBuzz and PlayRandomNoise.
Plays one cycle of a tone, by setting the speaker bit for a time and then clearing it for a time. This is the basis of the sound effects.
Input
B The length of the pulse
D The length of the gap
PlayPulse 40582 LD A,16 Set the speaker bit.
40584 OUT (254),A Write to the port.
PlayPulse_Pulse 40586 DJNZ PlayPulse_Pulse Wait for the length of the pulse.
40588 XOR A Clear the speaker bit.
40589 OUT (254),A Write to the port.
40591 LD B,D Copy the length of the gap into B.
PlayPulse_Gap 40592 DJNZ PlayPulse_Gap Wait for the length of the gap.
40594 RET Return.
View the equivalent code in;
Prev: 40557 Up: Map Next: 40595