
;                  copper list example
;

bwobflag:	dc.w	0
execbase:	equ	4
dmacon:		equ	$dff096
oldopenlibary:	equ	-408


main:	move.l	execbase,a6
	lea	gfxname,a1
	move.l	#0,d0
	jsr	oldopenlibary(a6)
	tst	d0
	beq	error_no_libary
	move.l	d0,gfxbase
	move.l	d0,a0
	add.l	#$32,a0
	move.w	#$0080,dmacon
	move.l	(a0),oldcopper
	move.l	#newcopper,(a0)
	move.w	#$8080,dmacon
	jsr	startpos
	jsr	rrresud
	move.w	#$0020,$dff096
	jsr	resettext
	
	;move.l	$6c,store
	;lea	inter,a1
	;move.l	a1,$6c
	;move.w	#$0010,$dff09a
	;move.w	#$ffff,$dff088
	;move.w	#$8020,$dff09a
	;move.w	#$0403,$dff096

wait:	jsr	inter
	jsr	pause
	andi.b	#$40,$bfe001
	bne	wait
	;jsr 	start	
	move.l	gfxbase,a0
	add.l	#$32,a0
	move.w	#$8020,$dff096
	move.w	#$0080,dmacon
	move.l	oldcopper,(a0)
	move.w	#$8080,dmacon

error_no_libary:
	rts	

store:	dc.l	0,0,0,0

pause:	move.w	#$e000,d3
loop:	add.w	#1,d3
	bne	loop
	rts

inter:	jsr	moveit
	jsr	sine
	jsr	scrmove
	rts
	;move.l	store,a1
	;jmp	(a1)



gfxname:
	dc.b	"graphics.library",0
	even

scroll:	lea	$58000,a1
	move.l	chart,d1
	add.l	d1,a1
	lea	$59142,a2
	move.b	#$0,d1
loopy:	move.w	(a1),(a2)
	add.l	#48,a2
	add.l	#2,a1
	add.b	#1,d1
	cmp.b	#$20,d1	
	blt	loopy
	rts
chart:	dc.b	0,0
char:	dc.b	$1,$2,$c
	even

pauseflag:	dc.l	0,0
pausebit:	dc.l	0,0

pauser:	move.w	pausebit,d0
	sub.w	#1,d0
	cmp.w	#0,d0
	beq	unsetpause
	move.w	d0,pausebit
	rts

unsetpause:
	move.b	#0,pauseflag
	move.w	#0,pausebit
	bra	newchar

setpause:
	move.b	#$f,pauseflag
	move.w	#$0060,pausebit
	rts

scrspeed:	dc.w	$0022,0

moveit:	move.b	pauseflag,d0
	cmp.b	#$f,d0
	beq	pauser	
	move.w	scrspeed,d0
	move.w	scrpos,d1
	sub.w	d0,d1
	cmp.w	#$f1ef,d1
	bhi	resscr
	move.w	d1,scrpos
	rts

misschar:	
	move.b	#0,checkmoveflag
	rts

checkmoveflag:	dc.b	0,0,0,0

resscr:	move.b	checkmoveflag,d0
	cmp.b	#$f,d0
	beq	misschar

	move.w	#$00ff,scrpos
	lea	$59114,a2
	lea	$59116,a3
	move.w	#$0,d0
looppy:	move.w	(a3),(a2)
	add.l	#$2,a3
	add.l	#$2,a2
	add.w	#$1,d0
	cmp.w	#$180,d0
	blt	looppy
	jsr	scroll
	jsr	newchar
	rts

count:	dc.l	0,0
newchar:
	lea	count,a1
	lea	text,a2
	add.l	(a1),a2
	move.b	(a2),d1
	move.b	d1,shortbit
	move.w	shortstore,d1
	sub.w	#$31,d1
	mulu	#$20,d1
	move.w	d1,char
	add.l	#1,count
	cmp.b	#$ff,(a2)
	beq	resettext	
	cmp.b	#$ee,(a2)	
	beq	setpause
	cmp.b	#$d1,(a2)
	beq	scrspeed1
	cmp.b	#$d2,(a2)
	beq	scrspeed2
	cmp.b	#$d3,(a2)
	beq	scrspeed3
	cmp.b	#$d4,(a2)
	beq	scrspeed4
	cmp.b	#$d5,(a2)
	beq	scrspeed5
	cmp.b	#$c0,(a2)
	beq	upon
	cmp.b	#$c1,(a2)
	beq	upoff
	rts

upon:	move.b	#$0,stopflag
	move.b	#$f,checkmoveflag
	bra	newchar
	
upoff:	move.b	#$f,stopflag
	move.b	#$f,checkmoveflag
	bra	newchar



scrspeed1:
	move.w	#$0011,scrspeed
	move.b	#$f,checkmoveflag
	bra	newchar
	
scrspeed2:
	move.w	#$0022,scrspeed
	move.b	#$f,checkmoveflag
	bra	newchar
	
scrspeed3:
	move.w	#$0044,scrspeed
	move.b	#$f,checkmoveflag
	bra	newchar
	
scrspeed4:
	move.w	#$0088,scrspeed
	move.b	#$f,checkmoveflag
	bra	newchar
	
scrspeed5:
	move.w	#$01ff,scrspeed
	move.b	#$f,checkmoveflag
	bra	newchar
	


shortstore:	dc.b	0
shortbit:	dc.b	0,0,0

resettext:
	move.l	#0,count
	rts
	
text:	DC.B	$D5,$c1,`          FAST SCROLL`,$5B,$5B,$5B,`   `,$EE
	dc.b	`            SPARK          `,$ee,$c0,$ee,$ee,$c1
	DC.B	`                 OF XXX INTERNATIONAL   `,$EE
	DC.B	$D4,$c1,`       HIMEDIUM SCROLL `,$5B,$5B,$5B,`  `,$EE
	dc.b	`            SPARK          `,$ee,$c0,$ee,$ee,$c1
	DC.B	`                 OF XXX INTERNATIONAL   `,$EE
	DC.B	$D3,$c1,`      LOWMEDIUM SCROLL `,$5B,$5B,$5B,`  `,$EE
	dc.b	`            SPARK          `,$ee,$c0,$ee,$ee,$c1
	DC.B	`                 OF XXX INTERNATIONAL   `,$EE
	DC.B	$D2,$c1,`          SLOW SCROLL `,$5B,$5B,$5B,`  `,$EE
	dc.b	`            SPARK          `,$ee,$c0,$ee,$ee,$c1
	DC.B	`                 OF XXX INTERNATIONAL   `,$EE
	DC.B	$D1,$c1,`         SLOWER SCROLL `,$5B,$5B,$5B,`  `,$EE
	dc.b	`            SPARK          `,$ee,$c0,$ee,$ee,$c1
	DC.B	`                 OF XXX INTERNATIONAL   `,$EE


	DC.B	$FF
	dc.b	`     greetings go to                   `
	dc.b	`channel fourteen       british bulldogs    sex dwarf`
	dc.b	`         `
	dc.b	`soft killer crew      scanner of crisis internation`
	dc.b	`al       special message to nero of crisis      `
	dc.b	`  why the fuck did you rip off our st scroller you`
	dc.b	` asshole        and no you `
	dc.b 	`cannt fucking keep it        right now back to the`
	dc.b	` greetings          greetings cont           `
	dc.b	`steve of the mission           red baron        `
	dc.b	`tristar        axxess and dma     the sinners      `
	dc.b	`sca      random access      the movers      the bit`
	dc.b	`stoppers       deltaforce       digitech     hqc    `
	dc.b	`  blizzard         def jam       antitrax      doc  `
	dc.b    `   the champs      alphawave     phr crew     tcc   `
	dc.b    `   vortex      tbr      mcp    the knight hawks     `
	dc.b    `  rob the bop hubbard      the outrunners      phs  `
	dc.b	`   ccs     the computer brains     megaforce        `
	dc.b	`the visitors    fairlight     northern lights       `
	dc.b    `the risky business boys     disaster area     danish`
	dc.b	` gold     the light circle     bitkillersoft     the`
	dc.b    ` limit crew     skyline     the stupid name team    `
	dc.b	`silver ghosts     the a team     lazer     irata    `
	dc.b	` alpha flight     the new age     unit a     tcc    `
	dc.b    ` gigaflops    cpu     the commodore guys    the play`
	dc.b	`boys     goffy crackings     tba     ccw team     `
	dc.b	`enterprise     bca     cfr     bfbs     ibb `
	dc.b    `        sorry if i missed anyone                    `
	dc.b	`ok        me thinks that will do for this demo    `
	dc.b	`look out for future xxx international productions`
	dc.b	`         xxx international           we deal with`
	dc.b	` the best       we dont mess with the rest  `
	dc.b	`        now its time for the rap            `
	dc.b	`yo party people in the place to be        `
	dc.b	`this is what you booted your amiga to see `
	dc.b	`                  bye from spark            `
	dc.b	`for now            `	      
	dc.b	$ff,0,0,0,0
	even

bp1count:	dc.l	0

startpos:	lea	btable,a0
		move.l	a0,bp1count
		rts

sine:	lea	gb1,a0
	lea	bp1count,a1
	jsr	updown
	rts


updown:	move.l	(a1),a2
	cmp.w	#$ffff,(a2)	
	beq	resud
	move.w	(a2),d0
	add.w	d0,gb1
	lea	gb2,a3
	lea	gbu,a4
loopp:	add.w	d0,(a3)
	add.l	#16,a3
	cmp.l	a4,a3
	bls	loopp
	add.l	#2,(a1)
	rts

resud:	lea	btable,a2
	move.l	a2,(a1)
	move.w	#$8111,(a0)
	rts

btable:	dc.w	0,0,0,0,256,0,256,0,256,256,256,256,512,256
	dc.w	512,256,512,512
	dc.w	512,512,768,512,768,512,768,512,768,768
	dc.w	768,768	

	dc.w	-$300,-$300,-$300,-$300,-$200,-$300,-$200,-$300
	dc.w	-$200,-$300
	dc.w	-$200,-$200,-$200,-$200,-$100,-$200,-$100,-$200
	dc.w	-$100,-$100
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
	
	
	dc.w	0,0,0,0,256,0,256,0,256,256,256,256,512,256
	dc.w	512,256,512,512
	dc.w	512,512,768,512,768,512,768,512,768,768
	dc.w	768,768	
	
	
	dc.w	-$200,-$300,-$200,-$300
	dc.w	-$200,-$300
	dc.w	-$200,-$200,-$200,-$200,-$100,-$200,-$100,-$200
	dc.w	-$100,-$100
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
	
	dc.w	0,0,0,0,256,0,256,0,256,256,256,256,512,256
	dc.w	512,256,512,512
	dc.w	512,512,768,512,768,512,768,512
	
	dc.w	-$200,-$300
	dc.w	-$200,-$200,-$200,-$200,-$100,-$200,-$100,-$200
	dc.w	-$100,-$100
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
	
	dc.w	0,0,0,0,256,0,256,0,256,256,256,256,512,256
	dc.w	512,256,512,512
	dc.w	512,512,768,512
	
	dc.w	-$200,-$200,-$100,-$200,-$100,-$200
	dc.w	-$100,-$100
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
	
	dc.w	0,0,0,0,256,0,256,0,256,256,256,256,512,256
	dc.w	512,256,512,512
	
	dc.w	-$100,-$200
	dc.w	-$100,-$100
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
	
	dc.w	0,0,0,0,256,0,256,0,256,256,256,256,512,256
	
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
	
	dc.w	0,0,0,0,256,0,256,0,256,256

	dc.w	0,-$100,0,0
	
	dc.w	0,0,0,0,256,0
	


	dc.w	-$300,-$300,-$300,-$300,-$200,-$300,-$200,-$300
	dc.w	-$200,-$300
	dc.w	-$200,-$200,-$200,-$200,-$100,-$200,-$100,-$200
	dc.w	-$100,-$100
	dc.w	-$100,-$100
	dc.w	0,-$100,0,-$100,0,0
		
	
	dc.w	$ffff


scrmovflag:	dc.l	0,0

uppauseflag:	dc.l	0,0,0,0
stopflag:	dc.b	0,0,0,0

checkstopflag:
	move.b	stopflag,d0
	cmp.b	#$f,d0
	beq	ender
	bra	renter
ender:	rts

scrmove:move.b	scrmovflag,d0
	cmp.b	#$f,d0
	beq	miss
	move.b	#$f,scrmovflag
	move.w	uppauseflag,d0
	cmp.w	#$17,d0
	beq	checkstopflag
renter:	add.w	#1,uppauseflag	

	lea	bp1,a3
	cmp.w	#$9500,(a3)
	bgt	rrresud	
	lea	bp2,a4
lloopp:	add.w	#48,(a3)
	add.l	#16,a3
	cmp.l	a4,a3
	bls	lloopp
	rts

miss:	move.b	#0,scrmovflag
	rts

rrresud:
	lea	bp1,a2
	move.w	#$8c67,d1
	lea	postable,a1
back:	add.w	(a1),d1
	move.w	d1,(a2)
	add.l	#16,a2
	add.l	#2,a1
	cmp.w	#$ffff,(a1)
	bne	back
	move.w	#0,uppauseflag
	rts
postable:	
	dc.w	0,96,96,48,48,48,0,48,0,0,48,0,0,48,0,0
	dc.w	0,0,48,0,0,48,0,0,48,0,48,48,48,96,96,$ffff


gfxbase:

	dc.l	0

oldcopper:

	dc.l	0

newcopper:

	dc.w	$1001,$fffe
	dc.w	$0180,$0000,$0182,$0070	
	dc.w	$0090,$31ff
	dc.w	$7f01,$fffe
	dc.w	$0100,$1000,$00e0,$0005
	dc.w	$0092,$0028,$0094,$00f8
	dc.w	$0102
scrpos:	dc.w	$00ff
gb1:	dc.w	$8001,$fffe
	
	dc.w	$0182,$0000,$00e2
bp1:	dc.w	$8fff,$0180,$0000
gb2:	dc.w	$8111,$fffe,$0182,$0111,$00e2,$8fff,$0180,$0101
	dc.w	$8211,$fffe,$0182,$0222,$00e2,$8fff,$0180,$0201
	dc.w	$8311,$fffe,$0182,$0333,$00e2,$8fff,$0180,$0302
	dc.w	$8411,$fffe,$0182,$0444,$00e2,$8fff,$0180,$0402
	dc.w	$8511,$fffe,$0182,$0555,$00e2,$902d,$0180,$0503
	dc.w	$8611,$fffe,$0182,$0666,$00e2,$902d,$0180,$0603
	dc.w	$8711,$fffe,$0182,$0777,$00e2,$902d,$0180,$0704
	dc.w	$8811,$fffe,$0182,$0888,$00e2,$902d,$0180,$0804
	dc.w	$8911,$fffe,$0182,$0999,$00e2,$905b,$0180,$0905
	dc.w	$8a11,$fffe,$0182,$0aaa,$00e2,$905b,$0180,$0a05
	dc.w	$8b11,$fffe,$0182,$0bbb,$00e2,$905b,$0180,$0b06
	dc.w	$8c11,$fffe,$0182,$0ccc,$00e2,$905b,$0180,$0c06
	dc.w	$8d11,$fffe,$0182,$0ddd,$00e2,$9089,$0180,$0d07
	dc.w	$8e11,$fffe,$0182,$0eee,$00e2,$9089,$0180,$0e07
	dc.w	$8f11,$fffe,$0182,$0fff,$00e2,$9089,$0180,$0f08
	dc.w	$9011,$fffe,$0182,$0eee,$00e2,$9089,$0180,$0e07
	dc.w	$9111,$fffe,$0182,$0ddd,$00e2,$9089,$0180,$0d07
	dc.w	$9211,$fffe,$0182,$0ccc,$00e2,$9089,$0180,$0c06
	dc.w	$9311,$fffe,$0182,$0bbb,$00e2,$90b7,$0180,$0b06
	dc.w	$9411,$fffe,$0182,$0aaa,$00e2,$90b7,$0180,$0a05
	dc.w	$9511,$fffe,$0182,$0999,$00e2,$90b7,$0180,$0905
	dc.w	$9611,$fffe,$0182,$0888,$00e2,$90b7,$0180,$0804
	dc.w	$9711,$fffe,$0182,$0777,$00e2,$90b7,$0180,$0704
	dc.w	$9811,$fffe,$0182,$0666,$00e2,$90e5,$0180,$0603
	dc.w	$9911,$fffe,$0182,$0555,$00e2,$90e5,$0180,$0503
	dc.w	$9a11,$fffe,$0182,$0444,$00e2,$90e5,$0180,$0402
	dc.w	$9b11,$fffe,$0182,$0333,$00e2,$90e5,$0180,$0302
	dc.w	$9c11,$fffe,$0182,$0222,$00e2,$9113,$0180,$0201
GBU:	dc.w	$9d11,$fffe,$0182,$0111,$00e2,$9113,$0180,$0101
	dc.w	$9e11,$fffe,$0182,$0000,$00e2,$9113,$0180,$000
bp2:	dc.w	$9113,$fffe,$0100,$0000,$00e2,$9113,$0180,$000
	
	


pal:	dc.w	$ffdf,$fffe,$0021,$fffe

end:	dc.w	$ffff,$fffe
	
