Prev: C400 Up: Map Next: C455
C435: The sound of a puff
Used by the routine at VANISHING.
Sixteen single waves at pitches read from the ROM, as Pentagram's puff and Knight Lore's crashes are: the random number with its high byte cut to five bits is an address in the first 8K, and each byte there, less its top bit, is a half-wave count. VANISHING plays it as a puff (graphics 12-15) ends, if it was drawn last turn; the flag is cleared.
Input
IX the record
PUFF_SOUND C435 BIT 1,(IX+$07) not drawn last turn: silent; the flag cleared either way
C439 RES 1,(IX+$07)
C43D RET Z
C43E LD HL,(RANDOM) HL = somewhere in the first 8K of the ROM; sixteen waves
C441 LD A,H
C442 AND $1F
C444 LD H,A
C445 LD E,$10
PUFF_SOUND_0 C447 LD A,(HL) each at the next ROM byte, less its top bit
C448 INC HL
C449 AND $7F
C44B LD B,A
C44C LD C,$01
C44E CALL BEEP
C451 DEC E
C452 JR NZ,PUFF_SOUND_0
C454 RET
Prev: C400 Up: Map Next: C455