[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

This example details the system audio DMA action in a step-by-step
fashion.

Suppose you wanted to join together a sine and a triangle waveform,
end-to-end, for a special audio effect, alternating between them. The
following sequence shows the action of your program as well as its
interaction with the audio DMA system. The example assumes that the
 period ,  volume , and  length  of the data set remains the same for the
sine wave and the triangle wave.


                         Interrupt Program
                         -----------------
If (wave = triangle)
               write  AUD0LCL  with address of sine wave data.

Else if (wave = sine)
               write  AUD0LCL  with address of triangle wave data.


                          Main Program
                          ------------

1. Set up  volume ,  period , and  length .
2. Write  AUD0LCL  with address of sine wave data.
3. Start DMA.
4. Continue with something else.


                         System Response
                         ---------------

As soon as DMA starts,

   a. Copy to "back-up" length register from  AUD0LEN .
   b. Copy to "back-up" location register from  AUD0LCL  (will be used
      as a pointer showing current data word to fetch).
   c. Create an  interrupt  for the 680x0 saying that it has completed
      retrieving working copies of  length  and  location registers .
   d. Start retrieving audio data each allocated DMA time slot.


[Back to Amiga Developer Docs]