Text of this page, read by machine (may contain mistakes)
COLECOVISION SOUND USERS' MANUAL page 22
eee UP_CH_DATA_PTRS *2#
UP_CH_DATA_?PTRS adjusts each channel data pointer to point to the highest
priority Cordinal last) song data ares that uses that channel. It is called
whenever a change has been made to a song data ares that requires modification
of the channel data pointers.
All 4 channel data pointers (TR_TO_S_ON_x®) are initially poimted to a dummy
fmactive area, DUM_AREA. Then, moving in order from the first data area to the
lest, CHO in byte 0 of each data area is examined, and the corresponding
channel data pointer is pointed to that datz area. Thus, by the time the
routine is done, each channel data pointer is pointing to the last active data
area that contains date to be sent to that channel. If none of the active dats
areas used & particular channel, then that channel remains pointing to DUM_AREA
(and therefore its generator will Se tcmned off next time through PLAY_SONCS)
eee LEAVELEFFECT tt
LEAVE_EFFECT, called by a special sound effect reutine when it's finished,
reetores the SONGNO of the song to which the effect belongs to BS - BO of byte
in the effect's data area, and loads bytes 1 & 2 with the address of the next
note in the song. The address of the { dSyte SONGNO (saved by the effect when
it was first called) is passed in DE. The 2 byte address of the next note in
the song, also saved by the effect, ts passed in HL. IX ts assumed to be
pointing to byte 0 of the data area to which the song number is to be restored.
Bits 7 & 6 of the saved SONCNO byte are not stored into byte 0, and therefore
may be used during the course of the effect to store any useful flag
information.
SPECIAL SOUND EFFECTS
® Sound effects as notes within &@ song
Sounds which do not fit one of the siz categories of “normal” musical notes can
be created and played throughout the course of & song as “special effect"
notes. Unlike normal musical notes, which are stored in ROM as tables of
frequency/control and attenuation data, & special effect's cata are Getermined
algolrithmically by & custom routine written by the cartridge prograzmer.
Special effect notes can also be used to generate sounds that could have been
comprised of many normal notes, but which ace more ef nily Gin terms of ROM
space used) computed by @ short program.
These notes use the same song data area as the song within which they ere
contained, and they are stored in the song's ROM note List with a one byte
header as are normal notes. However, the bytes following the ROM header do not
contain data to be directiy loaded Inte the song date area. The header (see
Figure 2), which specifies the channel upon which to play the effect (which is
usually the same as the channel used by the rest of the notes in the song), is
followed by a two byte address of & routine written by the cartridge programmer
which will be called every 16.7ms by PROCESS_DATA_AREA. When called, this
special effect routine should compute data values and store them at the
appropriate Jocations within the song data area. (In fact, wany effect
routines gay call the O/S routines FREQ_SWEEP or ATN_SWEEP, which also require
that data be ordered appropriately within & song data area) This computed date
will then be output on the nest pass through PLAY_SONCS (assuming that this
song date area has the highest priority of any data area using the size
ehanneb.