
begin	movem.l a0-a6/d0-d7,-(a7)		; save all regesters
	move.l  a7,stackpoint			; save stack pointer
	move.l	4.w,a6			        ; get execbase
	moveq.l	#0,d0			        ; clear regester d0
	lea	gfxlib(pc),a1		        ; point to gfxname
	jsr	-552(a6)			; open graphics library
	move.l	d0,gfxbase    		        ; save base addr to gfxbase
	jsr	-132(a6)			; forbid multitasking
	move.w	$dff002.l,dmasave	        ; save dma
	move.w	$dff01c.l,intensave		; save intena	
	move.w	$dff01e.l,intrqsave		; save interq
	move.l	#copperlist,$dff080	        ; install new copperlist
	move.w	$dff088.l,d0		        ; clear second copperlist
	move.w	#%1000001110100000,$dff096      ; dma:cop/bit/sprite

	move.l	#screen,d0		set up screen
	move.w	d0,pl1l
	swap	d0
	move.w	d0,pl1h

	move.l	#screen-44*5,d0
	move.w	d0,pl3l
	swap	d0
	move.w	d0,pl3h

	move.l	#screen+$5000+$160,d0
	move.w	d0,pl2l
	swap	d0
	move.w	d0,pl2h

	move.l	#screen+$5000+$4160,d0
	move.w	d0,pl4l
	swap	d0
	move.w	d0,pl4h
	move.l	#screen+$5000+$160,pos

	bsr	prtext
	bsr	fillmem


WaitVBL:	move.l	$dff004.l,d7		;check raster count (vposr)
		and.l	#$1ff00,d7		;for line 214
		cmp.l	#$3000,d7		;if not wait around
		bne.s	WaitVBL

		bsr.w	scrol

		btst	#6,$bfe001.l		; test left mouse button
		bne.s	WaitVBL

	move.w intensave,d7		
	bset   #$f,d7			
	move.w d7,$dff09a		restore inten
	move.w intrqsave,d7		
	bset   #$f,d7			
	move.w d7,$dff09c		restore intrq
	move.w dmasave,d7
	bset   #$f,d7
	move.w d7,$dff096		restore dma
	move.l gfxbase,a0
	move.l $26(a0),$dff080
	move.l 4.w,a6
	jsr    -138(a6)			lvo permit
	move.l	stackpoint,a7	  ; restore stack pointer
	movem.l (a7)+,a0-a6/d0-d7 ; restore all regesters
	rts			  ; return back to cli
blank2nd	dc.w	0

fillmem	lea	screen+$5000,a0
	lea	screen+$9000,a1
	lea	gfxdata1,a3
	lea	gfxdata2,a4

	move.l	#$ffffffff,$dff044
	move.w	#$0000,$dff064
	move.w	#$002a,$dff066
	move.w	#$0000,$dff042
	move.w	#$09f0,$dff040

	moveq	#19-1,d2			;19 rows down...
fill2	moveq	#22-1,d0			;22 blocks across
fill	move.l	a0,$dff054			;dest
	move.l	a4,$dff050
	move.w	#$3c1,$dff058			;bpl 1
	bsr.s	blitready

	move.l	a1,$dff054			;dest
	move.l	a3,$dff050
	move.w	#$3c1,$dff058			;bpl 2
	bsr.s	blitready

	addq.l	#2,a0
	addq.l	#2,a1
	dbra	d0,fill
 
	lea	15*44(a0),a0
	lea	15*44(a1),a1
	dbra	d2,fill2
 	rts	

blitready
	btst	#14,$dff002
	bne.s	blitready
	rts

****************************************************************************
*		 print text						   *
****************************************************************************

prtext		lea	text(pc),a0	;text to print to screen
print		lea	screen,a1	;visible screen address
		moveq.l	#0,d0
		move.b	(a0)+,d0
		mulu	#44,d0		;screen width ( 44 words <overscan> )
		add.l	d0,a1
		moveq.l	#0,d0
		move.b	(a0)+,d0
		add.w	d0,a1
		move.l	a1,a4

getfont		lea	font(pc),a2	;fontdata
		moveq.l	#0,d0
		move.b	(a0)+,d0
		beq.s	print
		bmi.s	finished
		sub.b	#32,d0		;ascii chars from 32
		cmp.b	#39,d0
		ble.s	locate

		add.l	#600,a2		;position of newline from fontdata 

locate		moveq.l	#15,d1		;size of font ( depth )
		lea	(a2,d0.w),a2
lloop		move.b	(a2),(a1)
		add.l	#40,a2		;fontdata width
		add.l	#44,a1		;screen width ( 44 words <overscan> )
		dbra	d1,lloop
		addq.l	#1,a4
		move.l	a4,a1
		bra.s	getfont
finished	rts 

pos		dc.l	0

scrol		move.l	pos,d0
		move.w	d0,pl2l
		swap	d0
		move.w	d0,pl2h
		swap	d0

		add.l	#$4000,d0
		move.w	d0,pl4l
		swap	d0
		move.w	d0,pl4h

		add.l	#44,pos

		cmp.l	#screen+$5000+$160+$2c0,pos
		bge.s	reset
		rts

reset:		move.l	#screen+$5000+$160,pos
		rts

copperlist
	dc.w $008e,$1a64
	dc.w $0090,$39d1
	dc.w $0092,$0033
	dc.w $0094,$00cc
	dc.w $0100,$4400,$1fc,0,$10c,0
	dc.w $0102,$0000
	dc.w $0108,$0002
	dc.w $010a,$0002	bpl1/2mod
sp_ptr	dc.w $0120,$0000,$0122,$0000,$0124,$0000,$0126,$0000
	dc.w $0128,$0000,$012a,$0000,$012c,$0000,$012e,$0000 ;no jib
	dc.w $0130,$0000,$0132,$0000,$0134,$0000,$0136,$0000
	dc.w $0138,$0000,$013a,$0000,$013c,$0000,$013e,$0000

	dc.w $01a0,$0000,$01a2,$0333,$01a4,$0ddd,$01a6,$0fff
	dc.w $01aa,$0333,$01ac,$0ddd,$01ae,$0fff

	dc.w $0180,$0000,$0182,$0fff,$0184,$0333,$0186,$0fff
	dc.w $0188,$0999,$018a,$0777,$018c,$0555,$018e,$0333
	dc.w $0190,$0000,$0192,$0444,$0194,$0888,$0196,$0666
	dc.w $0198,$0999,$019a,$0777,$019c,$0555,$019e,$0333

	dc.w	$00e0		set up copper bplane pointers
pl1h	dc.w	$0000
	dc.w	$00e2
pl1l	dc.w	$0000

	dc.w	$00e8
pl3h	dc.w	$0000
	dc.w	$00ea
pl3l	dc.w	$0000
	dc.w	$00e4
pl2h	dc.w	$0000
	dc.w	$00e6
pl2l	dc.w	$0000

	dc.w	$00ec
pl4h	dc.w	$0000
	dc.w	$00ee
pl4l	dc.w	$0000

	dc.w $ffff,$fffe

intrqsave	dc.w	0
intensave	dc.w	0
dmasave		dc.w	0
gfxlib		dc.b	"graphics.library",0
		even
gfxbase		dc.l	0
sysstackpoint	dc.l	0
stackpoint	dc.l	0
flag1		dc.l	0
textpos		dc.l	0
speed		dc.l	0
pause		dc.l	0
font		incbin	"dl:chars16.raw"
		even
		even
gfxdata1	dc.w	%1111111111111100
		dc.w	%1111111111111100
		dc.w	%1100000000001100
		dc.w	%1101111111111100
		dc.w	%1101111111111100
		dc.w	%1101111111011100
		dc.w	%1101110011011100
		dc.w	%1101110111011100
		dc.w	%1101111111011100
		dc.w	%1101111111011100
		dc.w	%1101100000011100
		dc.w	%1101111111111100
		dc.w	%1111111111111100
		dc.w	%1111111111111100
		dc.w	%0000000000000000

gfxdata2	dc.w	%0000000000000010
		dc.w	%0111111111111110
		dc.w	%0111111111110110
		dc.w	%0111111111110110
		dc.w	%0111000000010110
		dc.w	%0111011111110110
		dc.w	%0111011101110110
		dc.w	%0111011101110110
		dc.w	%0111010001110110
		dc.w	%0111011111110110
		dc.w	%0111011111110110
		dc.w	%0111111111110110
		dc.w	%0100000000000110
		dc.w	%0111111111111110
		dc.w	%1111111111111110

****************************************************************************
*			 text						   *
****************************************************************************

;usage-:	xpos,ypos,text,endline   
	even

TEXT:	DC.B	LINE02,0,"              - SIGNAL U.K. - ",ENDLINE
	DC.B	LINE03,0,"          IN APRIL 1990 PRESENTS: ",ENDLINE

	DC.B	LINE05,0,"       ANOTHER COOL COMPACT DISK!!!!!",ENDLINE

	DC.B	LINE08,0,"           DISK WAS COMPILED BY:    ",ENDLINE 
	DC.B	LINE09,0,"                  ANON",ENDLINE
	DC.B	LINE10,0,"                                  ",ENDLINE
	DC.B	LINE11,0,"          RELEASED AND SPREAD BY:",ENDLINE
	DC.B	LINE12,0,"                  ANON",ENDLINE

	DC.B	LINE14,0,"           INTRO CODED BY ANON",ENDLINE
	DC.B	LINE15,0,"    -SIGNAL U.K-  THE U.K. NUMBER ONE !!"

	dc.b	endtext
	even

; stop    - pause
; a       - speed 1 ( slow )
; b       - speed 2 ( fast ) 

scrolltext
	;    ;1234567890123456789012345678901234567890123;
	DC.B 'a           " SCOOTER AND 2-COOL "          ',STOP
	DC.B "     OF    b"
	DC.B "                - SIGNAL U.K. -              ",STOP
	DC.B "          IN APRIL OF 1990 PRESENTS:        ",STOP
	DC.B "                    a                                "
	DC.B "       -- ANOTHER COOL COMPACT !!!! --      ",STOP
	DC.B "b                                  " 
	DC.B "          INTRO CODING -: BY 2-COOL         ",STOP
	DC.B "         MUSIC COMPOSED -: BY 2-COOL        ",STOP
	DC.B "a        RELEASED AND SPREAD BY SCOOTER      ",STOP
	DC.B "                    NOTHING MORE TO SAY JUST NOW     "

	dc.b endscrl
	even

screen:		ds.b	40960*4

line00	equ	7*0
line01	equ	7*2
line02	equ	7*4
line03	equ	7*6
line04	equ	7*8
line05	equ	7*10
line06	equ	7*12
line07	equ	7*14
line08	equ	7*16
line09	equ	7*18
line10	equ	7*20
line11	equ	7*22
line12	equ	7*24
line13	equ	7*26
line14	equ	7*28
line15	equ	7*30
line16	equ	7*32
line17	equ	7*34
line18	equ	7*36
endline	equ	0
endtext	equ	255
endscrl	equ	"^"
stop	equ	"%"
fast	equ	"@"
slow	equ	"#"
time	equ	400

