Atari Falcon DSP System Calls
Here are some useful DSP system calls:
Opcode #109
Dsp_ExecProg(codeptr, codesize, ability)
char *codeptr;
long codesize;
int ability; Dsp_ExecProg executes a DSP program which resides as a binary in memory. Codeptr should point to a block of DSP binary code and codesize is the number of DSP words (24 bits = 3 bytes) that will be transferred to the DSP. The ability number can be set to any number, but should be set to the number given by the Dsp_RequestUniqueAbility call.
Opcode #108
status = Dsp_LoadProg(file, ability, buffer)
char *file;
int ability;
int status;
char *buffer; Dsp_LoadProg loads (from disk) and executes a DSP LOD file. The file is in the ASCII LOD format. File should point to the name of the program file to be loaded into the DSP. The ability number can be set to any number, but should be set to the number given by the Dsp_RequestUniqueAbility call. Buffer should point to a block of memory where the loader can place the DSP code it generates (32k byte is usually enough). A 0 return value indicates a successful launch. A return value of -1 indicates an error occured.
I don't recommend using this call since an extra LOD file is needed (and the path must be correct, otherwise the LOD cannot be loaded). Use the Dsp_ExecProg call instead. See below for details regarding LOD to binary conversion.
Opcode #111
size = Dsp_LodToBinary(file, codeptr)
char *file;
char *codeptr;
long size; Dsp_LodToBinary reads a LOD file and convert it to binary form used by the Dsp_ExecProg function. Codeptr should point to a block of memory large enough for the routine to place the DSP binary data. The program will return the size of the program in DSP words (24 bits = 3 bytes). A negative size means that an error occured during the conversion process.
Opcode #98
Dsp_BlkUnpacked(data_in, size_in, data_out, size_out)
char *data_in;
long size_in;
char *data_out;
long size_out; Dsp_BlkUnpacked transfers size_in number of DSP words (24 bits = 3 bytes) to the DSP using the DSP Host Port. Data_in should point to a block of data ready to be sent. If size_in equals zero, no transfer will be made.
Size_out number of DSP words will also be transferred from the DSP using the Host Port. Data_out should point to a block of memory big enough to place the data. If size_out equals zero, no transfer will be made.
Data is fetched from the least significant bytes of the longword and sent to the DSP. Similarly, data obtained from the DSP is placed into the least significant bytes of the data_out buffer. Note that the least significant 24 bits of each longword would contain DSP data, while the most significant 8 bits would contain something meaningless. Size_in and Size_out are limited to 64k.
Some other system calls:
#97 Dsp_BlkHandShake(data_in, size_in, data_out, size_out);
#123 Dsp_BlkWords(data_in, size_in, data_out, size_out);
#124 Dsp_BlkBytes(data_in, size_in, data_out, size_out);
#126 Dsp_SetVectors(receiver, transmitter);
#102 Dsp_RemoveInterrupts(mask);
#104 state = Dsp_Lock();
#105 Dsp_UnLock();