View Single Post
Old 16 January 2020, 01:29   #1
Herpes
... aka Amix73

Herpes's Avatar
 
Join Date: Jan 2009
Location: Austria
Posts: 85
Cannot use AUDX-INT (Level 4 IRQ) to stop sample.

Hi there!
Since I have some days off I play around with 68K assembly. What I want is to play samples one time and than it should stop or bet stopped.

Unfortunately, I have a behavior I don't understand.

I wanted to use Level 4 interrupts (AUDx) to stop the sample which was started via DMA. My understanding was whenever the last data-word was read a Level 4 INT for the channel is issued.

My handler code loooks like this:
own_level4_handler:
Code:
movem.l   d0-a6,-(a7)
    ; waste some time - but show it
    move.w  #$0fff,$180(a6)            ; WHITE flash
    move.w    #$2ff,d0                     ; wait x lines to waste some time
    bsr.w    loop_n_time
    move.w    #$0000,$180(a6)       ; back to black
    ; The plan was to stop DMA of channel 0 by:
    ; move.w    #$0001,$096(a6)     ; AUD0 DMA off
    move.w    #$0080,$09c(a6)
    movem.l   (a7)+,d0-a6       
   rte
I registered the handler like this:[/FONT]
Code:
 
    ; in a4 is the vbr
    lea        own_level4_handler(pc),a1
    move.l    a1,$70(a4)
I enabled ONLY AUD0 INT (level 4) with the following statement:
Code:
move.w    #$c080,$9a(a6)                    ; intena-wr SET:INTEN--|---AUD0|----|----
When I trigger to play a sample via the rmb
the sample plays continuously of course and the screen flashes white on different locations since DMA-switch-off is disabled. That's what I expected.

BUT when I enable the line: 'move.w #$0001,$096(a6)' to stop the AUD0-DMA
I hear NOTHING at all - it seems that the DMA is instantly stopped.
Furthermore I see 3 white areas on the screen which indicates that the IRQ-handler is called 3 times consecutively.

WHAT am I doing wrong.
Any help much appreciated.
Thanks.

Last edited by Herpes; 16 January 2020 at 01:33. Reason: removed the font-tags
Herpes is offline  
 
Page generated in 0.04191 seconds with 11 queries