Prev: 72AB Up: Map Next: 72F2
72CF: Sound the flickering beams
Used by the routine at draw_beams.
Jumped to from the end of draw_beams when it has drawn a beam. The record in IX sets the sound: C = ((+0 XOR +1) AND 15) + 8 pulses, E = +2 AND $1F; for each pulse B = ((C + E) AND 15) x 2 loops on and D = 2(E + B) - B off (beep_pulse).
Input
IX The beam's record
sound_beams 72CF LD A,(IX+$00) 8-23 pulses
72D2 XOR (IX+$01)
72D5 AND $0F
72D7 ADD A,$08
72D9 LD C,A
72DA LD A,(IX+$02) E from +2
72DD AND $1F
72DF LD E,A
sound_beams_0 72E0 LD A,C The pulse's on and off lengths
72E1 ADD A,E
72E2 AND $0F
72E4 ADD A,A
72E5 LD B,A
72E6 LD A,E
72E7 ADD A,B
72E8 ADD A,A
72E9 SUB B
72EA LD D,A
72EB CALL beep_pulse One pulse; next C
72EE DEC C
72EF JR NZ,sound_beams_0
72F1 RET
Prev: 72AB Up: Map Next: 72F2