Prev: 44696 Up: Map Next: 44735
44713: 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 44713 LD HL,41532 Point HL at the number of notes left.
44716 LD A,(HL) Fetch the number of notes left.
44717 AND A Test whether the effect is over.
44718 RET Z Return if it is.
Play the next note from the end of the list.
44719 DEC (HL) Count down the notes.
44720 INC HL Move on to the address of the notes.
44721 LD E,(HL) Fetch the low byte of the address.
44722 INC HL Move on to the high byte.
44723 LD D,(HL) Fetch the high byte of the address.
44724 EX DE,HL Swap the address into HL.
44725 CALL AddAToHL Point HL at the note.
44728 LD A,(HL) Fetch the note.
44729 LD B,A Use it as the length of a pulse.
44730 LD C,12 Set the number of pulses.
44732 JP PlayWaveSequence Play the note.
Prev: 44696 Up: Map Next: 44735