;***********************screen wipe********************************
; Each time routine is called from the interupt one line is removed
; from top and bottom of picture until screen is clr completely.
;******************************************************************
;at start of prg load variables as shown below :-
;
;	lea endpic,a0
;	move.l a0,scnend
;calc for following command 
;	(screen width bytes)*(No. of Bitplanes)*(2 lines)
;	sub.l #40*4*2,a0
;	move.l a0,line2	
;screen is immediate val. if picture is incbin + colourmap 
;	move.l #screen,d0
;	move.l d0,scnsrt
;	move.l d0,line
;otherwise do this.
;	lea screen,a0
;	move.l a0,scnsrt
;	move.l a0,line
;
;******************************************************************
; in interupt put
;
; 	tst.w done
;	beq lclear
;	bsr LINECLR
;lclear:
;******************************************************************
; variables   						size
; 	scnend = address of end of screen		dc.l 0
;       scnsrt = address of start of screen		dc.l 0
;	line   = address of start of screen		dc.l 0
;	line2  = address of end of screen less 2 lines	dc.l 0
;	done   = toggles to zero val once clear done	dc.w 0
;******************************************************************
;To start routine simply enter the following cmd.
;
;	eor.w #$FFFF,done
;
;to re-use command just reset the variables and use the command above
;
;BEFORE RELOADING VARIABLES YOU MUST CHECK ROUTINE IS NOT 1/2 WAY 
;THROUGH WITH
;
;in_progress:
;	TST.w done
;	bne in_progress
;******************************************************************

LINECLR:
	move.l line,a0
	move.l scnend,a1
	cmp.l a0,a1
	bmi downdone
	
	bsr wblit
	move.l #$ffffffff,BLTAFWM+Custom
	move.w #$0,BLTDMOD+Custom
	move.l a0,BLTDPT+Custom
	move.w #0,BLTAdat+Custom
	move.w #%0000000111110000,BLTCON0+Custom
	move.w #0,BLTCON1+Custom
	move.w #(64*4)+20,BLTSIZE+Custom	16lines by 20 words
; change this value    ^^ to your scrn width
; and this value    ^ to No. bitplanes in picture.	
	add.l #40*4*2,a0
	move.l a0,line
; add rts here for wipe to go down then up
downdone:	
	move.l line2,a0
	move.l scnsrt,a1
	cmp.l a0,a1
	bpl updone
	
	bsr wblit
	move.l #$ffffffff,BLTAFWM+Custom
	move.w #$0,BLTDMOD+Custom
	move.l a0,BLTDPT+Custom
	move.w #0,BLTAdat+Custom
	move.w #%0000000111110000,BLTCON0+Custom
	move.w #0,BLTCON1+Custom
	move.w #(64*4)+20,BLTSIZE+Custom	16lines by 20 words
; change this value    ^^ to your scrn width
; and this value    ^ to No. bitplanes in picture.	
	sub.l #40*4*2,a0
	move.l a0,line2
	rts
updone
	eor.w #$ffff,done
	rts
