Text of this page, read by machine (may contain mistakes)
COLECOVISION SOUND USERS’ MANUAL page is
SND_MANAGCER
SND_MANACER should be called every VDP interrupt (every 16.7 ms). It agsumes
that the song data areas are stored contiguously in a data block beginning with
the Gata area assigned to song number one. For each data area, SND_MANACER, or
routines which it calls, processes the appropriate timer and sweep counters and
modifies the frequency and attenuation data accordingly. If the data area is
assigned to a special effect, SND_MANACER simply calls that effect, and doesn't
modify any data. When a note is finished, BND_MANACER, using the data area's
next note pointer, moves data for the next note of the song into the area and
fills in keys bytes within the area to allow proper processing of the Gata area
by the sweep routines it calls GREOQ_SWEEP and ATN_SWEEP). (SND_MANACER
considers a note finished when its frequency duration timers have timed out;
see the descriptions of the FREQ_SWEEP and ATN_SWEEP routines) A special
effect is responsible for deciding when its over and initiating the next note
in the song.
After the operations upon a data area have been performed, the channe! data
area pointers (PTR_TO_S_ON_x) may be updated (see description of
UP_CH_DATA_PTRS in “UTILITIES” section).
If SND_MANACER reads a header byte Gin CART ROM that has bits 364 set,
indicating repeat song, it will start the song again by reloading the first
note in the song, using the SONGNO portion (BS-BO) of byte 0 in the song's data
and the LST_OF_SND_ADDRS to find it.
SND_MANACER does not output the modified frequency end attenuation data.
PLAY_SONCS is usually called just before SND_MANACER to do this.
Special codes in byte 0 of the song data area indicate:
OFFH - data area inactive, do no processing, do not modify channel
data ares pointer
BS-BO = 62 - & special effect is to be played; SND_MANAGER calls the effect
routine
OOK - end of song datz areas (SND_MANACER processes data areas nti!
it sees 0 in byte 0)
NOTE: Song number 1 MUST use the first data area in the block of song data
areas.
INPUT: none
CALLS: PROCESS_DATA_AREA, PT_IX_TO_SxDATA
OUTPUT: 1) decrements song duration and sweep timers
2) modifies swept frequency and attenuation values
3) calls special effects routines where necessary
© restarts the song if indicated
S) may update the channel data area pointers @TR_TO_S_ON_®)