Prev: AE98 Up: Map Next: AEBF
AEA9: Play Sound Effect
Used by the routine at InitialiseGame.
Called every frame. Plays the next note of the sound effect which is in progress, if there is one. The effects are started by setting SoundNotesLeft to the number of notes and SoundNoteAddress to the address one byte before the notes. The notes are played from the last to the first, and each is the length of a pulse, so a bigger number is a lower note.
The sound effects played by this routine are:
Effect Sound
Horse Sound
Money Bag Sound
Bag Hit Sound
Return if there are no notes left.
PlaySoundEffect AEA9 LD HL,$A23C Point HL at the number of notes left.
AEAC LD A,(HL) Fetch the number of notes left.
AEAD AND A Test whether the effect is over.
AEAE RET Z Return if it is.
Play the next note from the end of the list.
AEAF DEC (HL) Count down the notes.
AEB0 INC HL Move on to the address of the notes.
AEB1 LD E,(HL) Fetch the low byte of the address.
AEB2 INC HL Move on to the high byte.
AEB3 LD D,(HL) Fetch the high byte of the address.
AEB4 EX DE,HL Swap the address into HL.
AEB5 CALL AddAToHL Point HL at the note.
AEB8 LD A,(HL) Fetch the note.
AEB9 LD B,A Use it as the length of a pulse.
AEBA LD C,$0C Set the number of pulses.
AEBC JP PlayWaveSequence Play the note.
Prev: AE98 Up: Map Next: AEBF