The template consists of chunks stored in 3DO file format that specify an offset into the DSP code. The offset points to the first DSP code location that references the resource. The code at that location begins a singly linked list of other locations to be resolved with the same value, ending with a NULL field. The fields patched are all 10 bits right-justified.
The chunks in a DSPP FORM include:
There are three possible values for dcod_Type:
int32 dcod_Type
int32 dcod_Offset
int32 dcod_Size
The CalcType (see the table below) determines how the knob parameters are converted.
int32 dknb_Next /* offset in chunk of next knob */
int32 dknb_Min
int32 dknb_Max
int32 dknb_Nominal
int32 dknb_NumResources
char dknb_Name[AF_MAX_NAME_SIZE]
arrayof
int32 dknr_RsrcIndex
int32 dknr_CalcType
int32 dknr_Data1
int32 dknr_Data2
Table 1: CalcType and available resources. ------------------------------------------------------- CALC_LINEAR |Resource = knob_value * Data1 + Data2 ------------------------------------------------------- CALC_INVERT |Resource = (Data1/knob_value) + Data2 ------------------------------------------------------- CALC_LINEAR_FP |Resource = knob_value * Data1 + Data2 |(Multiplication is fixed point) ------------------------------------------------------- CALC_SIN |Resource = sin( knob_value * |Data1)*Data (Useful for cordics and |State Variable Filter) -------------------------------------------------------
DRLC Chunk (Relocation)
A DRLC chunk is an array of relocation commands consisting of the following:
Some important fields are discussed in the following table
uchar drlc_Attribute /* of resource */
uchar drlc_Flags
uchar drlc_Width /* of field to update */
uchar drlc_Bit /* bit position of LSB of field*/
int32 drlc_CodeIndex /* Index of subchunk in DCOD */
int32 drlc_RsrcIndex /* Index of entry in Resource Chunk */
int32 drlc_CodeOffset /* Offset within subchunk */
Table 2: DLRC chunk fields. -------------------------------------------------------- DLRC_Attribute|Used to calculate the relocation value |from the allocated value. An example |would be the STATUS address for a FIFO as |opposed to the normal FIFO address. -------------------------------------------------------- DRLC_ADD |Adds allocated value to current contents |of word pointed to by CodeOffset instead |of simply setting contents. Generally |used for relocating branches by |referencing EN Resource. When the EN |instruction space is allocated, the new |base address is added to the offset |currently compiled for each branch. -------------------------------------------------------- DRLC_LIST |The CodeOffset points to a singly linked |list of fields to be set to the allocated |value. This field should not be set if |DRLC_ADD is set. -------------------------------------------------------- DRLC_32 |32-bit data are relocated. Offsets are |indexes into uint32 instead of ushort |arrays. --------------------------------------------------------
DRSC Chunk (Resource Allocation Request)
A DRSC chunk consists of an array of resource requests, as follows:
The following types are supported are:
int32 drsc_Type
int32 drsc_Many
various drsc_Allocated /* Filled when allocated */
int32 drsc_References /* Count for exported references */