Prev: F63C Up: Map Next: F6F9
F68D: Set up title music to start playing.
Used by the routine at Main_Title.
Input
Output
Music_Start F68D LD HL,Music_ScoreSheet Set to start of music sheet
F690 LD (Music_NextPtr),HL
F693 XOR A and no repeats, which will force a load of the next note.
F694 LD (Music_NoteRepeat),A
This entry point is used by the routine at Main_Title.
Music_PlayPart F697 LD A,(Music_NoteRepeat) See how many times we need to play the current note.
F69A OR A
F69B JR Z,Music_Start_0 None left, so go on to load next note.
F69D LD BC,(Music_NotePitch) Get current details...
F6A1 LD DE,(Music_NoteDuration)
F6A5 JR Music_Start_3
..
Music_Start_0 F6A7 LD BC,$0BB8 Create a gap.
F6AA CALL Pause
F6AD LD HL,(Music_NextPtr) Get next note details from the music sheet.
F6B0 LD A,(HL)
F6B1 OR A If its not a zero then go and get rest of data.
F6B2 JR NZ,Music_Start_1
F6B4 LD A,$01 Mark as end of music.
F6B6 LD (Music_EndFlag),A
F6B9 RET
Music_Start_1 F6BA INC HL
F6BB LD (Music_NoteRepeat),A Store data as repeat, this is how many times the note gets played for each call.
F6BE LD A,(HL) Get next bit of data for the note.
F6BF INC HL
F6C0 LD (Music_NextPtr),HL
F6C3 CP $FF Test for gap.
F6C5 JR NZ,Music_Start_2
F6C7 XOR A Clear note and create a gap.
F6C8 LD (Music_NoteRepeat),A
F6CB LD BC,$3A98
F6CE JP Pause
Music_Start_2 F6D1 DEC A Convert data into pitch and duration to create the note.
F6D2 LD L,A
F6D3 LD H,$00
F6D5 ADD HL,HL
F6D6 ADD HL,HL
F6D7 LD DE,Music_NoteTable
F6DA ADD HL,DE
F6DB LD C,(HL)
F6DC INC HL
F6DD LD B,(HL)
F6DE LD (Music_NotePitch),BC
F6E2 INC HL
F6E3 LD E,(HL)
F6E4 INC HL
F6E5 LD D,(HL)
F6E6 LD (Music_NoteDuration),DE
Music_Start_3 F6EA CALL Music_PlayNote
F6ED LD HL,Music_NoteRepeat
F6F0 DEC (HL)
F6F1 RET
Music_NextPtr F6F2 DEFW $F737 Pointer to next musical note.
Music_NoteRepeat F6F4 DEFB $00 Number of times to play note.
Music_NotePitch F6F5 DEFW $0118 Pitch of last note.
Music_NoteDuration F6F7 DEFW $0018 Duration of last note.
Prev: F63C Up: Map Next: F6F9