
; Listing3e.s	Scrolleffect met een Kleurverlopende achtergrond.
	
;	Routine wordt eenmaal alle drie Frames uitgevoerd.


	SECTION CIPenCOP,CODE	; Fast is OK

Begin:
	move.l	4.w,a6	    ; Execbase in a6
	jsr	-$78(a6)    ; Disable 
	lea	GfxName,a1  ; 
	jsr	-$198(a6)   ; OpenLibrary
	move.l	d0,GfxBase	
	move.l	d0,a6
	move.l	$26(a6),OldCop	
	move.l	#MijnCopper,$dff080  ; COP1LC 
	move.w	d0,$dff088	     ; COPJMP1 
mouse:
	cmpi.b	#$ff,$dff006	; VHPOSR - lijn 255 aangekomen?
	bne.s	mouse		

frame:
	cmpi.b	#$fe,$dff006 ; lijn 254 aangekomen? 
	bne.s	frame	     ; 


frame2:
	cmpi.b	#$fd,$dff006 ; Lijn 253 aangekomen? 
	bne.s	frame2	     ; 


	bsr.s	ScrollColors	; Een zogenaamde RASTERBAR!


	btst	#6,$bfe001	
	bne.s	mouse		

	move.l	OldCop(PC),$dff080	; COP1LC 
	move.w	d0,$dff088		; COPJMP1 

	move.l	4.w,a6
	jsr	-$7e(a6)	; Enable 
	move.l	GfxBase(PC),a1	
				
	jsr	-$19e(a6)	; Closelibrary 
	rts

;Deze routine laat de 14 kleuren van onze groene Copperlist 'lopen'.
;Technisch gezien doen we niets anders dan de kleuren opschuiven.
;Beter nog: We laten ze roteren. Kleur 2 -> Kleur 1, Kleur 3 -> Kleur 2,
;Kleur 4 -> Kleur 3 enz.... Kleur 14 -> Kleur 13 en Kleur 1 -> Kleur 14.
;Let op de laatste regel : "move.w col1,col14".
;Dit is een eindeloze cyclus die er als volgt uitziet:
;
;	>>>>>>>>>>>>>>>>>>>>>
;	^		    v
;	<<<<<<<<<<<<<<<<<<<<
;

Scrollcolors:
	move.w	col2,col1	; col2 komt in col1
	move.w	col3,col2	; col3 komt in col2
	move.w	col4,col3	; col4 komt in col3
	move.w	col5,col4	; col5 komt in col4
	move.w	col6,col5	; col6 komt in col5
	move.w	col7,col6	; col7 komt in col6
	move.w	col8,col7	; col8 komt in col7
	move.w	col9,col8	; col9 komt in col8
	move.w	col10,col9	; col10 komt in col9
	move.w	col11,col10	; col11 komt in col10
	move.w	col12,col11	; col12 komt in col11
	move.w	col13,col12	; col13 komt in col12
	move.w	col14,col13	; col14 komt in col13
	move.w	col1,col14	; col1 komt in col14
	rts

GfxName:
	dc.b	"graphics.library",0,0	
GfxBase:	   
	dc.l	0  
OldCop:		 
	dc.l	0

;=========== Copperlist ==========================


	section cop,data_C

MIJNCOPPER:
	dc.w	$100,$200	
				

	DC.W	$180,$000	

	dc.w	$9a07,$fffe	
	dc.w	$180		
col1:
	dc.w	$0f0		
	dc.w	$9b07,$fffe	
	dc.w	$180		
col2:
	dc.w	$0d0		
	dc.w	$9c07,$fffe	
	dc.w	$180		
col3:
	dc.w	$0b0		
	dc.w	$9d07,$fffe	
	dc.w	$180		
col4:
	dc.w	$090		
	dc.w	$9e07,$fffe	
	dc.w	$180		
col5:
	dc.w	$070		
	dc.w	$9f07,$fffe	
	dc.w	$180		
col6:
	dc.w	$050		
	dc.w	$a007,$fffe	
	dc.w	$180		
col7:
	dc.w	$030		
	dc.w	$a107,$fffe	
	dc.w	$180		
col8:				
	dc.w	$030
	dc.w	$a207,$fffe	
	dc.w	$180
col9:
	dc.w	$050
	dc.w	$a307,$fffe	
	dc.w	$180
col10:
	dc.w	$070
	dc.w	$a407,$fffe	
	dc.w	$180
col11:
	dc.w	$090
	dc.w	$a507,$fffe	
	dc.w	$180
col12:
	dc.w	$0b0
	dc.w	$a607,$fffe	
	dc.w	$180
col13:
	dc.w	$0d0
	dc.w	$a707,$fffe	
	dc.w	$180
col14:
	dc.w	$0f0
	dc.w	$a807,$fffe	

	dc.w	$180,$0000	
				

	DC.W	$FFFF,$FFFE	

	END



Probeer eens de volgende wijziging aan te brengen: Zet de volgende regel
voor de RTS instructe van de Subroutine Scrollcolors.

	add.w	#$100,col13