Prev: 70D8 Up: Map Next: 71E0
71D3: Sound one beeper pulse: B loops on, D loops off
Used by the routines at crackle and sound_beams.
The building block of the crackles (sound_crackle, sound_beams). The game runs with interrupts off and makes every sound by timing loops like these, so a sound costs its length in processor time: about 13 T-states for each loop of B and of D, here and in beep_cycle.
The border stays black: OUT ($FE) writes $10 (speaker on) and 0.
Input
B Loops with the speaker on (0 = 256)
D Loops with it off (0 = 256)
beep_pulse 71D3 LD A,$10 Speaker on, wait B loops
71D5 OUT ($FE),A
beep_pulse_0 71D7 DJNZ beep_pulse_0
71D9 XOR A Speaker off, wait D loops
71DA OUT ($FE),A
71DC LD B,D
beep_pulse_1 71DD DJNZ beep_pulse_1
71DF RET
Prev: 70D8 Up: Map Next: 71E0