C (83/254)

From:Colin Wenzel
Date:07 Apr 00 at 15:29:38
Subject:Re: Interrupt audio

On 07-Apr-00, Andrea Cometa wrote:
> it doesn't seem to work! (i missed 'not')
>>
>> The is_Code field should point to the actual interrupt
>> routine that is called when the buffer is empty.
>>
>> This routine should just refresh the buffer pointer &
>> clear down the interrupt bit, reinitialize the buffer
>> & restart DMA again to the new buffer....
>>
>> Don't forget to disable the interrupt before exit &
>> free the resources.
>>
>> PS: The audio data being played HAS TO BE in chip mem.
>>
> it's ok, but if I use AddIntServer(INTB_VERTB, myint), were is_code
> point to a simple routine that increment a counter, it work. when I
> use SetIntVector(INTB_AUD0, myint) it should increment the counter
> every time audio channel 0 has finished! But doesn't seem to work!
>
> N.B. to start sound i manually set the dma, using *(UWORD *)0xdffaxx
> to init audio channel 0 then i start playing with
> DMAF_SETCLR|DMAF_AUD0;

You have to reset the interrupt bit in the interrupt code each time
you get an interrupt so that you will get the next one.

The ASM code for this is:

MOVE.W #INTF_AUD0,(_custom+intreq) ;clear interrupt bit

Sorry, don't have C code for this....

I guess it would be:
custom.intreq = (UWORD)INTF_AUD0;

This of course being if you only use channel 0, for additional
channels, OR them together like this:

custom.intreq = (UWORD)(INTF_AUD0|INTF_AUD1);

-------------------------------------
Colin Wenzel. Australia.

EMAIL: mailto:colstv@hotkey.net.au
URL: http://www.hotkey.net.au/~colstv/
ICQ: 17608330
AMIGA: 4000T, 68060/50, 150Mb RAM,
OS 3.5, EGS Spectrum.
---------------------------------------

------------------------------------------------------------------------
LOW RATE, NO WAIT!
Get a NextCard Visa, in 30 seconds! Get rates
as low as 2.9% Intro or 9.9% Fixed APR and no hidden fees.
Learn more at:
http://click.egroups.com/1/937/1/_/451227/_/955117918/
------------------------------------------------------------------------