  # Atari Falcon DMA system calls

  DSP main page,
  DSP System calls.
  DMA System calls.
  DSP Host Communication Example.
  DMA Handshaked Communication Example.

  Here are some useful DMA system calls:

  Opcode #139
  devconnect(src, dst, srclk, prescale, protocol)
  int src;
  int dst;
  int srclk;
  int prescale;
  int protocol;
  The devconnect function call is used to attach a source device to any of the destination devices in the matrix. Given a source device, this call will attach that one source device to one or all of the destination devices. This call also sets up the source clock prescale value and protocol used.

  > src: Source devices are:
  >   3 - ADC (microphone/PSG)
  >   2 - EXTINP (External Port Input)
  >   1 - DSPXMIT (DSP Transmit)
  >   0 - DMAPLAY (DMA Playback)
  > dst: A bitmap of destination devices, several are allowed.
  >   0x8 - DAC (Headphone or Internal speaker)
  >   0x4 - EXTOUT (External Port Output)
  >   0x2 - DSPRECV (DSP Receive)
  >   0x1 - DMAREC (DMA Record)
  > srclk: The Clock source the device will use.
  >   0 - Internal 25.175 MHz Clock (ADC/DAC compatible)
  >   1 - External Clock
  >   2 - Internal 32 MHz Clock
  > prescale: Clock prescale value.
  >   1 - 49170Hz
  >   2 - 33880Hz
  >   3 - 24585Hz
  >   4 - 20770Hz
  >   5 - 16490Hz
  >   7 - 12292Hz
  >   9 - 9834Hz
  >   11 - 8195Hz
  > protocol: Handshake mode.
  >   0 - Enable Handshaking
  >   1 - Disable Handshaking

  Opcode #137
  dsptristate(dspxmit, dsprec)
  int dspxmit;
  int dsprec;
  dsptristate is used to tristate the DSP from the matrix.

  > dspxmit:
  >   0 - Tristate
  >   1 - Enable
  > dsprec:
  >   0 - Tristate
  >   1 - Enable

  Opcode #136
  status = buffoper(mode)
  int mode;
  long status;
  buffoper is used to control the operation of the DMA.

  > mode: Mode code, several modes are allowed.
  >   0x8 - Record Repeat on
  >   0x4 - Record Enable on
  >   0x2 - Playback Repeat on
  >   0x1 - Playback Enable on
  >   -1 - Current status is returned

  Opcode #131
  setbuffer(reg, begaddr, endaddr)
  int reg;
  long begaddr;
  long endaddr;
  setbuffer is used to set the play or record buffers. The ending address is the first invalid data location.

  > reg: Register select.
  >   0 - Sets playback registers.
  >   1 - Sets record registers.
  > begaddr: Sets the beginning address to the buffer.
  > endaddr: Sets the ending address to the buffer.