Prev: C3AA Up: Map Next: C3D8
C3BD: Play Sound Effect
Used by the routine at StartGame.
Plays the next note of the current sound effect. The note counter is held at NoteCounter and the number of the sound effect at SoundNumber. A sound effect is started by setting the note counter to the number of notes.
The sound effects are:
Effect Sound
00, a new cell
01, a speed bonus
02, a health bonus
03, an item
Count down the notes of the current sound effect.
PlaySoundEffect C3BD LD HL,$BBF9 Point at the counter of notes still to play.
C3C0 LD A,(HL) Return if there are no more notes to play.
C3C1 AND A
C3C2 RET Z
C3C3 DEC (HL) Count down a note.
C3C4 EX AF,AF' Keep the note counter in AF'.
C3C5 INC HL Point at the number of the sound effect.
Find the pitch of this note.
C3C6 LD A,(HL) Fetch the number of the sound effect.
C3C7 LD BC,$C3D8 Point at the table of sound effects.
C3CA CALL GetTableEntry Fetch the address of the notes of the sound effect.
C3CD EX AF,AF' Get the number of the note back from AF'.
C3CE LD C,A Use it as the distance along the notes.
C3CF LD B,$00 Make the distance a whole number of bytes.
C3D1 ADD HL,BC Find the address of the note.
C3D2 LD B,(HL) Fetch the pitch of the note.
C3D3 LD C,$0C Set the length of the note.
C3D5 JP PlayTone Jump to PlayTone to play the note.
View the equivalent code in;
Prev: C3AA Up: Map Next: C3D8