Prev: D692 Up: Map Next: D6B5
D69C: Play Music Once
Used by the routine at GameMenu.
Plays a tune once, and stops early if a key is pressed. After the tune has been played, nothing happens until TunePlayedFlag is cleared.
The tunes played by this routine are:
Tune Sound
Main Tune
Input
DE The address of the tune
Play only if TunePlayedFlag is clear.
PlayMusicOnce D69C LD HL,$A747 Point HL at the flag which says whether the tune has been played.
D69F LD A,(HL) Fetch the flag.
D6A0 AND A Return if the tune has already been played.
D6A1 RET NZ
D6A2 SET 0,(HL) Set the flag.
Stop if a key is pressed.
PlayMusicOnce_Loop D6A4 XOR A Read every row of the keyboard.
D6A5 CALL ReadKeyboardPort
D6A8 JR Z,PlayMusicOnce_Note Jump to PlayMusicOnce_Note if no key is pressed.
D6AA RET Return.
Play the next note.
PlayMusicOnce_Note D6AB LD A,(DE) Fetch the next note.
D6AC CP $FF Jump to PlayMusic_Done if the terminator has been reached.
D6AE JR Z,PlayMusic_Done
D6B0 CALL PlayNote Play the note.
D6B3 JR PlayMusicOnce_Loop Jump to PlayMusicOnce_Loop.
View the equivalent code in;
Prev: D692 Up: Map Next: D6B5