Prev: D5E4 Up: Map Next: D60D
D5F2: Play this turn's note of the sound effect under way
Used by the routine at OBJECT_DONE.
Called by OBJECT_DONE every turn. SOUND_COUNT is two bytes: how many notes are left, and which effect. While the count is not zero, this takes one off and plays twelve waves at the pitch found at the effect's address in EFFECTS plus the count before it was taken: the notes run backwards from the end, and the byte at the effect's address itself is never played.
Only two effects are started: 0, four notes, when a room has been entered (OBJECT_DONE), and 1, five notes, as he picks something up or puts it down (TAKE_OR_LEAVE). Effects 2 and 3 have their notes but nothing starts them.
EFFECT_NOTE D5F2 LD HL,SOUND_COUNT nothing under way: done
D5F5 LD A,(HL)
D5F6 AND A
D5F7 RET Z
D5F8 DEC (HL) one note fewer; keep the count before
D5F9 EX AF,AF'
D5FA INC HL HL = the effect's notes (EFFECTS)
D5FB LD A,(HL)
D5FC LD BC,EFFECTS
D5FF CALL TABLE_WORD
D602 EX AF,AF' twelve waves at the note the count points to
D603 LD C,A
D604 LD B,$00
D606 ADD HL,BC
D607 LD B,(HL)
D608 LD C,$0C
D60A JP BEEP
Prev: D5E4 Up: Map Next: D60D