Thread: Sine scroller
View Single Post
Old 15 April 2007, 00:27   #19
bobbybearing
Zone Friend
 
bobbybearing's Avatar
 
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
personaly, I initialize like that :
Code:
start:
...
move.w $10(a6),d0 ;save adkcon
ori.w #$8000,d0
move.w d0,adkcon(a5)
move.w 2(a6),d0 ;save dma
ori.w #$8000,d0
move.w d0,sDma(a5)
move.w $1c(a6),d0 ;save intena
ori.w #$8000,d0
move.w d0,intena(a5)

bsr waitvbl
move.w #$7fff,d0
move.w d0,$9a(a6) ; disable interrupts
move.w d0,$96(a6) ; stop dma channels
move.w d0,$9c(a6) ; stop int requests
	
move.l	$6c.w,saveintvbl ; or $6c(a1) with a1=VBR if you get vbr
lea interrupt(pc),a0
move.l a0,$6c.w

move.w	#$8000|$4000|$20,$9a(a6) ; start vbl interrupt
move.w	#$8200|$100|$80|$40,$96(a6) ; init dma

bsr Main
; restore
bsr waitvbl
move.w #$7fff,d0
move.w d0,$96(a6)
move.w d0,$9a(a6)
move.w d0,$9c(a6)
	
move.l	saveintvbl,$6c.w
move.w	intena(a5),$9a(a6)
move.w	sDma(a5),$96(a6)
move.w	adkcon(a5),$9e(a6)
...
rts
------------------
interrupt:
movem.l d0/a6,-(sp)
lea $dff000,a6
andi.w #$20,$1e(a6) ; it's possible to skip test
beq noint
...
move.w #$20,$dff09c ; twice (a4000 bug)
move.w #$20,$dff09c
noint
movem.l (sp)+,d0/a6
rte

Last edited by bobbybearing; 15 April 2007 at 00:37.
bobbybearing is offline  
 
Page generated in 0.04508 seconds with 11 queries