Offset | Contents |
---|---|
+0 | Pointer to fill code |
+4 | Pointer to overrun fixup code |
+8 | Pointer to linear-to-log table or 0 |
+12 | Pointer to log-scale table or 0 |
The fill code handles fill requests from the DMA Handler (SoundDMA)
It should translate the fill request to a series of calls to the Voice Generators, passing the required buffer offsets so that data from all channels correctly interleaves. Any unused channels within the buffer should be set to zero by the Channel Handler so they are silent.
When calling the Voice Generators, the following registers should be defined:
R10 | Buffer end address |
R11 | Interleave increment (1, 2, 4 or 8) |
R12 | Buffer start address |
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.
The overrun fixup code is no longer supported in RISC OS and is never called.
The pointer to the linear-to-log table holds the address of the base of an 8 Kbyte table which maps 32-bit signed integers directly to 8-bit signed volume-scaled logarithms in a suitable format for output to the VIDC chip. This is not used by the 16-bit sound system, which uses linear values.
The pointer to the log-scale table holds the address of a 256-byte table which scales the amplitude of VIDC-format 8-bit signed logarithms from their maximum range down to a value scaled to the volume setting. Voice Generators should use this table to adjust their overall volume. This is not used by the 16-bit sound system.