Subject: Re: ASC info from Antoine Rosset!
To: Nathan Raymond <nate@portents.com>
From: Colin Wood <cwood@ichips.intel.com>
List: port-mac68k
Date: 05/27/1999 17:12:50
Nathan Raymond wrote:
> Last week I contacted Antoine Rosset for info about the Apple Sound 
> Chip, asking him for any info he could give to help the NetBSD 
> effort.  (Antoine used to have a driver in his Player Pro MOD 
> player/writing program called Direct ASC, which was much faster than 
> Apple's Sound Manager because he bypassed the API and worked directly 
> with the chip, but the speed gains were more negligible with PPC and 
> it was phased out.  I figured he'd be a good person to ask about 
> doing sound in NetBSD!)  Here's his response:

thanks for doing this, btw!

unfortunately, the code below is about what we have already figured out.
if he'd be willing to impart to us how the interrupt handler's and the
hi/lo watermark registers work, it'd be much more useful.  btw, for those
wondering, the code below moves raw sound data from 2 buffers (roughly,
"monaural sound for left" and "monaural sound for right") into the left
and right channel buffers of the ASC.  this is accomplished by moving the
address of the ASC's left buffer into address register A4, moving the
address of the buffer containing the raw audio for the left channel into
the A3 register, and then dumping 11 long words (44 bytes) at a time from
the area of memory into the ASC, transferring the data through the data
registers and a few of the address registers (until we get 352 bytes, then
the last few are filled in separately...perhaps this triggers playback on
that channel? i can't remember at the moment)  the process is then
repeated for the right channel...
 
later.

colin

> Date: Thu, 27 May 1999 21:47:41 +0200
> Subject: Re: ASC support in NetBSD, can you help?
> From: "Rosset Antoine" <rossetantoine@bluewin.ch>
> To: Nathan Raymond <nate@portents.com>
> X-Priority: 3
> 
> > What do you think, will you please consider it?  I bet it wouldn't be
> > difficult for you at all! :-)
> 
> I cancelled my support for the ASC driver...
> 
> Here is some doc:
> 
> #define ASCBase     0x0CC0
> #define ASCSIZE     370L
> #define ASCOFFSET   0x400L
> 
> destGPtr = *((Ptr*) ASCBase);     // Gauche
> destDPtr = destGPtr + ASCOFFSET;  // Droite
> 
> BlockMove( monSonPourGauche, destGPtr, ASCSIZE);
> BlockMove( monSonPourDroite, destDPtr, ASCSIZE);
> 
> void FillASCBuffer()
> {
> asm
> {
>   MOVEM.L  D0-D7/A0-A4, -(SP)
>  
>   MOVEA.L  (ASCBase), A4
>   MOVEA.L  monSonPourGauche, A3
>  
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)  /* 352, jusqu'ici */
> 
>   MOVEM.L  (A3)+, D0-D3
>   MOVEM.L  D0-D3, (A4)
>  
>   MOVE.W  (A3), (A4)
> 
>  
>   /* Droite !!! */
>  
>   MOVEA.L  (ASCBase), A4
>   ADDA.L  #0x400, A4
>   MOVEA.L  monSonPourDroite, A3
>  
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)
> 
>   MOVEM.L  (A3)+, D0-D7/A0-A2
>   MOVEM.L  D0-D7/A0-A2, (A4)  /* 352, jusqu'ici */
> 
>   MOVEM.L  (A3)+, D0-D3
>   MOVEM.L  D0-D3, (A4)
>  
>   MOVE.W  (A3), (A4)
> 
>   MOVEM.L  (SP)+, D0-D7/A0-A4
> }
> }
> 
> 
> --
> 
> Sincerely,
> 
> Antoine
> 
> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>