next up previous contents
Next: CD-Rom Access (cdfs.c) Up: Hardware Abstraction Layer: DC Previous: PC Fonts (font.c)   Contents

Subsections

Sound Processor Unit (spu.c)

The sound processor unit (as mentioned in the README) is a Yamaha(tm) AICA sound system. To use the processor you will need to write a seperate program that runs on the ARM7 RISC core and uses the AICA's own registers. This isn't covered in this document (or anywhere, to my knowledge). For some decent examples, though, take a look at ``s3mplay'' on the Cryptic Allusion DCDev site (see README).

The following defines and functions are available to assist in using the sound processor:

SMP_BASE

All samples loaded to the AICA should proceed from this location relative to sound RAM (which maps to 0xa0810000 in the SH-4). This is mainly used in the S3M player but it's a good guideline to follow in general since it gives you 64k of space for the sound program (which is generally plenty).

void snd_ram_write_wait()

The AICA's RAM is attached to the chip itself rather than the SH-4, and so access proceeds through an ASIC. You must call this function every 8 long-words of written sound memory so that the ASIC's FIFO can catch up. If you don't, the data won't be written accurately.

void snd_load_arm(void *src, int size)

Loads an ARM7 program and starts it executing. The program will be loaded at offset 0, so it needs to begin with reset/exception vectors.

void snd_stop_arm()

Stops execution in the ARM7, and disables all AICA synthesizer channels. This insures that whatever was going on in the SPU is stopped completely.

void snd_init()

Initialize the SPU: disable the ARM7 and clear sound memory.

void snd_load(void *src, int dest, int len)

Load miscellaneous data into the SPU's RAM. 'src' is where to load from, and 'dest' is relative to the SPU based (so you could pass, e.g., SMP_BASE here). 'len' is in bytes but will be rounded up to long-words.


next up previous contents
Next: CD-Rom Access (cdfs.c) Up: Hardware Abstraction Layer: DC Previous: PC Fonts (font.c)   Contents
Dan Potter 2002-07-29