Text of this page, read by machine (may contain mistakes)
COLECOVISION SOUND USERS’ MANUAL page
ATN_SWEEP
ATN_SWEEP is used to create attenuation sweeps. It operates upon attenuation
data stored within a song data area, and is normally called by
PROCESS_DATA_AREA or a special effect routine) once every VDP interrupt
(16.?ms). The start Of the data area (address of byte 0) ts passed in IZ.
ATN_SWEEP assumes data has been stored as follows ( see Figure 1):
byte 4: ATN - the MSN = 4 bit attenuation
byte 8: ALEN ! ASTEP - no-sweep code or sweep length and step size:
1) 16 byte B = 00, ATN is not to be swept and counters aren't changed
D Uf byte 8 non cero, attenuation ts te be swept:
a) ALIN «= number of steps in the sweep: 1 to 15 (0 =) 16)
b) ASTEP = sweep step size: 1 to 7, <1 to -8 (signed, 4 Bit two's
complement)
byte ?: APS ! APSV - attenuation sweep duration prescaler:
1) if attenuation Is not swept, byte ¥ is not used by ATN_SWEIF
2 if attenuation is to be swept:
APS = prescaler reload value: 1 to 15 (0 =) 16)
APSV = texp storage nibble for APS: init ROM walue, 1 to 18 (oO => 16)
duration of swept attenuation part of note «
CUALEN - 1) © APS) ¢ initial APSV] * 16.7 ms
duration Ist step = initial APSV *® 16.7ms
duration all other steps « APS * 1é6.?ms
Paraseter limitations:
1) In an attenuation sweep, a “step” consists of 2 tone (swept or not) played
at a fixed attenuation level; so, the minimum number of steps an
attenuation sweep can have is two (otherwise the attenuation wouldn't have
“swept"). Therefore, the minimum ALEN value is 2 (0 =) 16)
2) If a note is to be attenuation swept, byte § must not be 00.
3) The absolute value of ASTEP must be) «= 1.
If byte 8 is 00, ATN_SWEEP returns immediately with 2 flag SET (the sweep is
over or the note was never swept), and doesn't modify any counters. When a
sweep finishes, ATN_SWEEP sets byte 8 to 00 and returns with the Z flag SET.
If a sweep is in progress, ATN_SWEEP returns with the Z flag RESET. CNOTE:
PROCESS_DATA_AREA decides that a note is over when FREQ_SWEEP returns with =
set: the length of a note has nothing to do with when its attn sweep is over)
INPUT: 16 Bit address of a song Gata area in CPU RAM
PASSED: in Iz
DESCRIPTION: ATN_SWEEP operates upon frequency cata within this song data area
OUTPUT: 1 duration and sweep counters are decremented if sweep in progress
2) atn data in byte 4 is modified If note is atn rwept
2) RETs C SET, byte 8 = O if sweep is corer or note was never swept
RETs C RESET Uf sweep in progress