Text of this page, read by machine (may contain mistakes)
COLECOVISION SOUND USERS’ MANUAL page 17
FREO_SWEEP
FREO_SWEEP is usec by SND_MANACER and special effects routines to create
frequency sweeps. It operates cpon frequency data stored within @ song Gata
area, and is normally called @y SND_MANACER or a special effect routine) once
every VDP interrupt (16.?ms). The start of the data area (address of byte o>
is passed in IZ.
FREO_SWEEP assumes Gata has been stored as follows (names which may be used to
describe the various bytes or byte segments within the data area are indicated;
see Figure 1):
byte 3: the least significant & bits of that note'’s frequency (2 - Fv)
byte 4: top 2 bits of that note's frequency: Bi = FO, BZ © Fi
byte 5: NLEN - determines the note's duration:
1) if frequency is to be swept, NLEN » number of steps in the sweep
2 to 255 (0 => 236)
2 if {ized frequency, NLEN * 16.7 ms @ duration of the note:
1 to 25 (0 «> 256)
byte é. FPS |! FPSV - frequency sweep duration prescaler:
FPS «= prescaler reload walue: 0 to 15 (0 =) 16)
FPSV «= temp storage nibble for FPS: init ROM value, 6 to 15 (0 =) 164)
duration of sweep (6 note) = C((CNLEN-1) ® FPS) + initial FPSV] * 16.?ms
duration ist step = initial FPSV * 16.?ms
éuration all other steps = FPS * 16.?ms
byte 7: FSTEP = frequency sweep step sise: signed 8 bit number, two's
complement: 1 to 127, <1 to -128
if FSTEP = 00, frequency is not to be swept, but NLEN is decremented
each time called
Parameter limitations:
1) In a frequency sweep, a "step" consists of a single fired frequency tone;
therefore, the minimum number of steps a frequency sweep can have is two
(otherwise the frequency wouldn't have “swept™).
2 If a note is to be frequency swept, FSTEP must not be 0.
3) The minimum length fixed frequency note has NLEN «= 1.
© Maximum NLEN 0, which is equivalent to 254.
FREQ_SWEEP returns with the Z flag SET if the note (swept or fixed) is over,
RESET if the note is not over. (PROCESS_DATA_AREA Gecides that a note is over
when FREO_SWEEP returns with the Z flag set?
INPUT: 16 Bit address of a song Gata area in CPU RAM
PASSED: in Iz
DESCRIPTION: FREQ_SWEEP operates upon frequency date within this song Sata ares
OUTPUT: 1) duration and sweep counters are decremented
2) freq data in bytes 364 is modified if note is freq swept
3) returns with Z flag SET if note over, RESET if note not over