Prev: EE5E Up: Map Next: EE9E
EE6E: Setup the next music pattern
Used by the routine at play_music_48k. Keep playing current pattern until this counter becomes zero.
next_pattern EE6E LD A,$00 Load number of pattern repetitions. Self modified by EE7E, and below.
EE70 DEC A Decrease
EE71 LD ($EE6F),A Self modify next_pattern above
EE74 RET NZ Return if non-zero
np_next EE75 LD HL,$0000 Load address of current pattern. Self modified by EE83.
This entry point is used by the routine at reset_music.
np_start_at_hl EE78 LD A,(HL) Read new repetition count
EE79 INC HL
EE7A CP $FF Jump to np_restart if it's $FF (end of patterns)
EE7C JR Z,np_restart
EE7E LD ($EE6F),A Self modify next_pattern above with new repetition count
EE81 LD C,(HL) Read music data offset
EE82 INC HL
EE83 LD ($EE76),HL Self modify np_next above (pattern addr)
Calculate address of music data.
EE86 LD B,$00 BC = C
EE88 LD HL,$F111 Address of base of music data
EE8B ADD HL,BC Combine with offset
EE8C LD A,(HL) A = *HL++ -- load first byte of music data
EE8D INC HL
EE8E LD ($EEBA),A Self modify pm_delay_complete (first byte of pattern)
EE91 LD ($EEAE),A Self modify pm_delay_1 (first byte of pattern)
EE94 LD ($EECA),HL Self modify pm_reset_pattern (addr of second music data byte in pattern)
EE97 RET Return
np_restart EE98 LD A,(HL) HL = wordat(HL); HL++
EE99 INC HL
EE9A LD H,(HL)
EE9B LD L,A
EE9C JR np_start_at_hl Jump to np_start_at_hl
Prev: EE5E Up: Map Next: EE9E