Showing changes from revision #3 to #4:
Added | Removed | Changed
The Update entry is called when a sound command is issued that requires a smooth change, without a new envelope (using extended amplitudes &180 to &1FF in the *Sound command for example). Normally the previous algorithm is continued, with only the amplitude, pitch and duration parameters supplied by the SCCB updated.
Entry | |
---|---|
R0 | Pointer to Voice Generator |
R4 | Flag byte |
R6 | Negative if Channel Handler configuration has changed |
R7 | Channel number (0-7) |
R8 | Sample period in µS |
R9 | Pointer to Sound Channel Control Block |
R10 | Buffer end address for this channel (exclusive) |
R11 | Interleave increment (1, 2, 4 or 8) |
R12 | Buffer start address for this channel (inclusive) |
Exit | |
---|---|
R0 | Flag byte |
On exit the A bit (bit 3) of the flag byte is returned unless the voice is to stop sounding; for example if the envelope has decayed to zero amplitude. In these cases the F2 bit (bit 1) is set, and the Channel Handler will automatically flush out the next two DMA buffers, before becoming dormant.
The Voice Generator is entered in IRQ mode with IRQs enabled, they must remain enabled to ensure that system devices do not have a lengthy wait to be serviced. The code for a Voice Generator must therefore be re-entrant, and R14 must not be used as a subroutine link register, since an interrupt will corrupt it. Sufficient IRQ stack depth must be maintained for system IRQ handling. You can enter SVC mode if you wish.
To return to the Channel Handler use LDR PC,[R13],#4
The buffer length is a multiple of 4 words (16 bytes) long, and word aligned and the interleave is dependent on the number of channels.