Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!umich!samsung!know!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!peregrine!sceard!ncr-sd!crash!jcs From: jcs@crash.cts.com (John Schultz) Newsgroups: comp.sys.amiga Subject: Re: NoiseTracker V2.0 out! Summary: Sounds/Interrupts Message-ID: <3992@crash.cts.com> Date: 18 Aug 90 16:56:52 GMT References: <9008120043.AA03382@jade.berkeley.edu> <0oPVN2w162w@valnet.UUCP> <1990Aug17.104306.17285@gdr.bath.ac.uk> Organization: Crash TimeSharing, El Cajon, CA Lines: 39 In article <1990Aug17.104306.17285@gdr.bath.ac.uk> mapjilg@gdr.bath.ac.uk (J I L Gold) writes: >One of the major uses of Soundtracker is to produce scores for demos/games >or whatever. In order for this to work the player routine must be called in a >50Hz vertical blank interrupt. As far as I can make out, the MED player routine >functions as a separate task, and so will not work in a program where the >system call Forbid() has been made to turn off multitasking (ie games, demos...) >Or am I showing my ignorance again? >Comments? Help? A VBlank interrupt is not necessary, as the audio hardware generates interrupts after the last word of data has been fetched. This allows audio interrupts to stuff the registers with the next sound before the first has finished. As long as DMA is not turned off, the next sound will continue immediately after the previous sound. See the Amiga Hardware Manual for more info. On the subject of stopping sounds immediately and starting a new sound cleanly, what's the best way to do this? Currently I do: move.w d2,intena(a0) ; disable 7-10 (aud) interrupts move.w d2,intreq(a0) ; clear any 7-10 interrupts move.w d6,dmacon(a0) ; shut off dma for both channels move.w #0,ac_dat(a3) ; write directly to output (to stop) move.w #0,ac_dat(a4) ; write directly to output (to stop) move.w #1,ac_per(a3) ; fast period (less waiting) move.w #1,ac_per(a4) ; fast period (less waiting) move.w #$c000,intena(a0) ; enable wasteloop move.w intreqr(a0),d5 ; wait for interrupt and.w d2,d5 ; test against current mask beq.b wasteloop ; not yet occurred ; Interrupt has occured, channel is stopped. move.w d2,intreq(a0) ; clear two 7-10 interrupts Is there a better way to do this? John