**************************************
*            Alpha Flight            *
*     presents BTC`s first Intro     *
*                                    *
* Coding:   BTC/Arcadia/Alpha Flight *
* Muzak:    Thrust                   *
* Charsets: Knigh Hawks              *
*           BTC                      *
*           BTC                      *
*                                    *
*       Platinium Greetings to       *
*      all Members of the World      *
*               ruling               *
*            Alpha Flight            *
*                                    *
*       Write to : PLK 073908 C      *
*        5060 Berg.Gladbach2         *
*                                    *
*        Load Music to $60000        *
*  Load `AlphaFlight1` to Bitplane   *
*                                    *
* Signed: BTC                        *
**************************************

org	$30000
load	$30000
s:
lea	$50000,a0
lea	$60000,a1
clear:
clr.l	(a0)+
cmp.l	a0,a1
bne	clear

bsr	unpack

move.l	$04,a6
lea	gfxname,a1
jsr	-408(a6)
jsr	-132(a6)
move.l	d0,gfxbase
move.l	d0,a0
move.l	50(a0),oldclist
move.l	#newclist,50(a0)
move.l	gfxbase,a6
move.l	$6c,oldirq+2
move.l	#newirq,$6c
wait:
btst	#6,$bfe001
bne.s	wait
move.l	oldirq+2,$6c
move.l	gfxbase,a0
move.l	oldclist,50(a0)
move.l	$04,a6
move.l	gfxbase,a1
jsr	-414(a6)
jsr	-138(a6)
rts

newirq:
movem.l	d0-d7/a0-a6,-(sp)

loeschen:
move.b	#55,d0
lea	schwfarb,a0
loop:
clr.l	(a0)+
sub.b	#1,d0
bne	loop

move.l	zeigersinusdat,a0
move.l	a0,a6
lea	balken,a1
lea	schwfarb,a2
clr.b	d0
move.l	(a0)+,d1
cmp.l	#$ffff,d1
bne	nextz
lea	sinusdat,a0
clr.l	d1
nextz:
mulu	#2,d1
add.l	d1,a2
move.l	a0,zeigersinusdat
move.l	a0,a5
bewegen:
move.w	(a1),(a2)
addq.l	#$2,a1
addq.l	#$2,a2
addq.b	#$1,d0
cmp.b	#7,d0		;btc3
bne	bewegen

clr.b	d6
mehr:
add.l	#16,a6
lea	balken,a1	;btc4
lea	schwfarb,a2
clr.b	d0
move.l	(a6),d1
cmp.l	#$ffff,d1
bne	nextz2
clr.l	d1
nextz2:
mulu	#$2,d1
add.l	d1,a2
bewegen2:
move.w	(a1),(a2)
addq.l	#$2,a1
addq.l	#$2,a2
addq.b	#$1,d0
cmp.b	#7,d0		;btc5
bne	bewegen2
add.b	#1,d6
cmp.b	#7,d6		;btc6 
bne	mehr

lea	sinusbalken,a0
lea	Farb_und_wabbel,a4
lea	bitwabbel,a2
lea	wabbel,a3

move.w	#$34,d5
scrolligselbst:
move.w	(a0)+,(a4)
move.w	(a2)+,(a3)
add.l	#12,a4
add.l	#12,a3
sub.w	#$1,d5
bne	scrolligselbst

addq.b	#$1,counter
cmp.b	#$2,counter
bne	exit
clr.b	counter


move.w	sinusbalken,d0
lea	sinusbalken,a0
lea	lastsinus,a1
clr.b	d1
move.w	bitwabbel,d3
lea	bitwabbel,a2
lea	lastbit,a3

scroll:
move.w	2(a0),(a0)
move.w	2(a2),(a2)
addq.l	#$2,a0
addq.l	#$2,a2
addq.b	#$1,d1
cmp.b	#56,d1
bne	scroll
move.w	d0,(a1)
move.w	d3,(a3)

exit:

cmp.w	#$1e78,wert1
bcs	play
lea	c1,a0
lea	c2,a1
lea	c3,a2
lea	c4,a3
lea	c5,a4
move.w	#$333,(a0)
move.w	#$666,(a1)
move.w	#$999,(a2)
move.w	#$ccc,(a3)
move.w	#$eee,(a4)
bra	play2

play:
lea	c1,a0
lea	c2,a1
lea	c3,a2
lea	c4,a3
lea	c5,a4
move.w	#$eee,(a0)
move.w	#$eee,(a1)
move.w	#$eee,(a2)
move.w	#$eee,(a3)
move.w	#$eee,(a4)

play2:

move.w	wert1,d0
move.w	wert2,d1
move.w	wert3,d3
wait60:
cmp.b	#$60,$dff006
bne	wait60
move.w	d0,$dff0e2
move.w	d1,$dff0e6
move.w	d3,$dff0ea
move.l	pointer,a0
move.w	(a0)+,d0
cmp.w	#$ffff,d0
bne	next
clr.w	d0
lea	gfxtab,a0
next:
move.l	a0,pointer
add.w	d0,wert1
add.w	d0,wert2
add.w	d0,wert3

move.b	#$6f,d0
lea	schwfarb,a0
wait5b:
cmp.b	$dff006,d0
bne	wait5b
move.w	(a0)+,$dff180
addq.b	#$1,d0
cmp.b	#$de,d0
bne	wait5b
waitda:
cmp.b	$dff006,d0
bne	waitda
move.w	#$0,$dff180

move.w	#$f2,d0
lea	lastsinus,a0
lea	bitwabbel,a1
waitf2:
cmp.b	$dff006,d0
bne	waitf2
move.w	-(a0),$dff180
move.w	(a1)+,$dff102
addq.b	#$1,d0
cmp.b	#$26,d0
bne	waitf2

movem.l	(sp)+,d0-d7/a0-a6
oldirq:
jmp	$00000000

newclist:
dc.w	$008e,$2081,$0090,$30c1,$0092,$0038,$0094,$00d0
dc.w	$0102,$0000,$0104,$0000,$0108,$0050,$010a,$0050
dc.w	$0100,$3200,$0180,$0000,$0182,$0eee
dc.w	$00e0,$0005,$00e2,$0000,$00e4,$0005,$00e6,$0028
dc.w	$00e8,$0005,$00ea,$0050
dc.w	$0184,$0ccc,$0186,$0aaa,$0188,$0888,$018a,$0666
dc.w	$018c,$0444,$018e,$0332,$120,0,$122,0,$124,0,$126,0
dc.w	$128,0,$12a,0,$12c,0,$12d,0,$130,0,$132,0,$134,0,$136,0
dc.w	$138,0,$13a,0,$13c,0,$13e,0
dc.w	$1e11,$fffe,$0180,3
dc.w	$1f11,$fffe,$0180,4
dc.w	$2011,$fffe,$0180,5
dc.w	$2111,$fffe,$0180,0
dc.w	$2211,$fffe,$0180
Farb_und_Wabbel:
dc.w	$400
wabbelwert:
dc.w	$102
wabbel:
dc.w	0
dc.w	$2311,$fffe,$0180,$400,$102,0
dc.w	$2411,$fffe,$0180,$400,$102,0
dc.w	$2511,$fffe,$0180,$400,$102,0
dc.w	$2611,$fffe,$0180,$400,$102,0
dc.w	$2711,$fffe,$0180,$400,$102,0
dc.w	$2811,$fffe,$0180,$400,$102,0
dc.w	$2911,$fffe,$0180,$400,$102,0
dc.w	$2a11,$fffe,$0180,$400,$102,0
dc.w	$2b11,$fffe,$0180,$400,$102,0
dc.w	$2c11,$fffe,$0180,$400,$102,0
dc.w	$2d11,$fffe,$0180,$400,$102,0
dc.w	$2e11,$fffe,$0180,$400,$102,0
dc.w	$2f11,$fffe,$0180,$400,$102,0
dc.w	$3011,$fffe,$0180,$400,$102,0
dc.w	$3111,$fffe,$0180,$400,$102,0
dc.w	$3211,$fffe,$0180,$400,$102,0
dc.w	$3311,$fffe,$0180,$400,$102,0
dc.w	$3411,$fffe,$0180,$400,$102,0
dc.w	$3511,$fffe,$0180,$400,$102,0
dc.w	$3611,$fffe,$0180,$400,$102,0
dc.w	$3711,$fffe,$0180,$400,$102,0
dc.w	$3811,$fffe,$0180,$400,$102,0
dc.w	$3911,$fffe,$0180,$400,$102,0
dc.w	$3a11,$fffe,$0180,$400,$102,0
dc.w	$3b11,$fffe,$0180,$400,$102,0
dc.w	$3c11,$fffe,$0180,$400,$102,0
dc.w	$3d11,$fffe,$0180,$400,$102,0
dc.w	$3e11,$fffe,$0180,$400,$102,0
dc.w	$3f11,$fffe,$0180,$400,$102,0
dc.w	$4011,$fffe,$0180,$400,$102,0
dc.w	$4111,$fffe,$0180,$400,$102,0
dc.w	$4211,$fffe,$0180,$400,$102,0
dc.w	$4311,$fffe,$0180,$400,$102,0
dc.w	$4411,$fffe,$0180,$400,$102,0
dc.w	$4511,$fffe,$0180,$400,$102,0
dc.w	$4611,$fffe,$0180,$400,$102,0
dc.w	$4711,$fffe,$0180,$400,$102,0
dc.w	$4811,$fffe,$0180,$400,$102,0
dc.w	$4911,$fffe,$0180,$400,$102,0
dc.w	$4a11,$fffe,$0180,$400,$102,0
dc.w	$4b11,$fffe,$0180,$400,$102,0
dc.w	$4c11,$fffe,$0180,$400,$102,0
dc.w	$4d11,$fffe,$0180,$400,$102,0
dc.w	$4e11,$fffe,$0180,$400,$102,0
dc.w	$4f11,$fffe,$0180,$400,$102,0
dc.w	$5011,$fffe,$0180,$400,$102,0
dc.w	$5111,$fffe,$0180,$400,$102,0
dc.w	$5211,$fffe,$0180,$400,$102,0
dc.w	$5311,$fffe,$0180,$400,$102,0
dc.w	$5411,$fffe,$0180,$400,$102,0
dc.w	$5511,$fffe,$0180,$400,$102,0

dc.w	$5611,$fffe,$0180,0,$00e2,$f000,$00e6,$f000
dc.w	$00ea,$f000
dc.w	$5711,$fffe,$0180,$05,$0102,0
dc.w	$5811,$fffe,$0180,$04
dc.w	$5911,$fffe,$0180,$03
dc.w	$5a11,$fffe,$0180,$0
dc.w	$6011,$fffe,$0182
c1:
dc.w	$0333
dc.w	$6111,$fffe,$0182
c2:
dc.w	$0666
dc.w	$6211,$fffe,$0182
c3:
dc.w	$0999
dc.w	$6311,$fffe,$0182
c4:
dc.w	$0ccc
dc.w	$6411,$fffe,$0182
c5:
dc.w	$0eee

dc.w	$e411,$fffe,$0182,$0ccc
dc.w	$e511,$fffe,$0182,$0999
dc.w	$e611,$fffe,$0182,$0666
dc.w	$e711,$fffe,$0182,$0333
dc.w	$e811,$fffe,$00e2,$f000,$00e6,$f000,$00ea,$f000,$0182,$0eee
dc.w	$ee11,$fffe,$0180,3
dc.w	$ef11,$fffe,$0180,4
dc.w	$f011,$fffe,$00e2,$0000,$00e6,$0028,$00ea,$0050,$180,$5
dc.w	$f111,$fffe,$0180,0
dc.w	$ffd5,$fffe,$0190,0,$190,0,
dc.w	$2611,$fffe,$180,0
dc.w	$2711,$fffe,$0180,$5,$00e2,$f000,$00e6,$f000,$00ea,$f000
dc.w	$2811,$fffe,$0180,$4
dc.w	$2911,$fffe,$0180,3
dc.w	$2a11,$fffe,$0180,0
dc.w	$ffff,$fffe



even
zeiger:
dc.l	0
oldclist:
dc.l	0
gfxbase:
dc.l	0
gfxname:
dc.b	"graphics.library",0
even

unpack:	lea	bitplane,a0	;Adress of Compacted Picture
	lea	$50000,a1	;Adress for the de-pressed Picture
	add.l	#12,a0
	move.l	a0,bmhdchunk	;'BMHD' Chunk-Adress
	move.l	4(a0),d0
	add.l	d0,a0
	add.l	#8,a0
	move.l	a0,cmapchunk	;'CMAP' Chunk-Adress

iff1:	cmp.l	#$424f4459,(a0)
	beq	iff0
	add.l	#2,a0
	bra	iff1

iff0:	move.l	a0,bodychunk	; 'BODY' Chunk-Adress
	move.l	4(a0),d0	; Anzahl Bytes
	add.l	#1,d0
	and.l	#$fffffffe,d0

	add.l	#8,a0		; Pointer to first Byte

iff4:	clr.l	d2
	move.b	(a0)+,d2
	bmi	iff6

iff5:	move.b	(a0)+,(a1)+
	subi.l	#1,d0
	subi.b	#1,d2
	bpl	iff5
	bra	iff7
	
iff6:	neg.b	d2
	beq	iff7

iff61:	move.b	(a0),(a1)+
	subi.b	#1,d2
	bpl	iff61
	subi.l	#1,d0
	add.l	#1,a0

iff7:	subi.l	#1,d0
	bmi	iff8
	beq	iff8
	bra	iff4

iff8:	rts

bmhdchunk:	
	dc.l	0
cmapchunk:
	dc.l	0
bodychunk:
	dc.l	0

wert1:
dc.w	0
wert2:
dc.w	$28
wert3:
dc.w	$50
gfxtab:			;btc8
blk.w	100,0	
blk.w	100,$78
blk.w	100,0
blk.w	90,$78
blk.w	300,0
blk.w	76,$78
blk.w	200,0
blk.w	88,-[3*$78]
blk.w	2,-$78
blk.w	200,0
dc.w	$ffff
pointer:
dc.l	gfxtab
sinusbalken:	;btc9
dc.w	$300,$400,$500,0,0,0,0,$300,$400,$500,0,0,0,0
dc.w	$300,$400,$500,0,0,0,0,$300,$400,$500,0,0,0,0
dc.w	$300,$400,$500,0,0,0,0,$300,$400,$500,0,0,0,0
dc.w	$300,$400,$500,0,0,0,0,$300,$400,$500,0,0,0
lastsinus:
dc.w	0
bitwabbel:	;btc10
dc.w	0,0,0,0,$11,$11,$22,$22,$33,$44,$55,$55,$66
dc.w	$77,$88,$99,$99,$aa,$bb,$cc,$cc,$dd,$dd,$ee,$ee
dc.w	$ee,$ff,$ff,$ff,$ee,$ee,$ee,$dd,$dd,$cc,$cc,$bb
dc.w	$aa,$99,$99,$88,$77,$66,$55,$55,$44,$33,$22,$22,$11
dc.w	$11,$0,0,0,0
lastbit:
dc.w	0
counter:
dc.b	0
even
schwfarb:
blk.w	130,0

balken:		;btc11
dc.w	$555,$777,$999,$ccc,$999,$777,$555

sinusdat:
dc.l	0,0,0,0,0,0,0,0,0,1,2,2,3,4,6,7,8,$a,$b,$d,$e,$10,$12
dc.l	$14,$16,$18,$1a,$1d,$1f,$21,$24,$26,$29,$2b,$2e,$30	
dc.l	$33,$35,$37,$3a,$3c,$3f,$41,$44,$46,$48,$4b,$4d,$4f,$51,$53
dc.l	$55,$57,$58,$5a,$5b,$5d,$5e,$5f,$61,$62,$63,$64,$65,$65,$65
dc.l	$65,$65,$66,$65,$65,$65,$65,$65,$64,$63,$62,$61,$5f,$5e
dc.l	$5d,$5b,$5a,$58,$57,$55,$53,$51,$4f,$4d,$4b,$48,$46,$44
dc.l	$41,$3f,$3c,$3a,$37,$35,$32,$30,$2e,$2b,$29,$26,$24,$21
dc.l	$1f,$1d,$1a,$18,$16,$14,$12,$10,$e,$d,$b,$a,8,7,6,4,3,2,2
dc.l	1,0,0,0,0,$ffff
dc.l	0,0,0,0,0,0,0,0,0,1,2,2,3,4,6,7,8,$a,$b,$d,$e,$10,$12
dc.l	$14,$16,$18,$1a,$1d,$1f,$21,$24,$26,$29,$2b,$2e,$30	
dc.l	$33,$35,$37,$3a,$3c,$3f,$41,$44,$48,$4b,$4d,$4f,$51,$53
dc.l	$55,$57,$58,$5a,$5b,$5d,$5e,$5f,$61,$62,$63,$64,$65,$65
dc.l	$65,$65,$66,$65,$65,$65,$65,$65,$64,$63,$62,$61,$5f,$5e
dc.l	$5d,$5b,$5a,$58,$57,$55,$53,$51,$4f,$4d,$4b,$48,$46,$44

even
zeigersinusdat:
dc.l	sinusdat
*****************************************
* And now it comes...			*
* The Instructions for this Intro	*
* When you see a command called		*
* BTC and there`s a number at the	*
* end (e.g. BTC1) just type into	*
* your Seka lBTC and the number		*
* (e.g. lBTC1) then press `l`		*
* for the second time and you will	*
* see the comment....			*
* Hope you understood this !!!		*
*					*
* btc2:This is the init-routine of	*
* D.O.C`s playroutine6 (ST6)		*
* btc3:Anzahl der Zeilen fuer letzten	*
*      Stripe !!!			*
* btc4:Musst du weglassen wenn du	*
*      stripes mit verschiedenen        *
*      Farben haben willst (zusaetzlich *
*      noch editieren (bei btc11)	*
* btc5:Anzahl der Zeilen fuer einen	*
*      Stripe (1.,2.,3.,...)		*
* btc6:Anzahl der gesammten Stripes -1	*
* btc7:Play Sound.... (D.O.C)		*
* btc8:Werte fuer das Gfx-Scrolling	*
*      $78  = 1 nach unten		*
*      -$78 = 1 nach oben		*
*      $0   = stehen bleiben		*
* btc9:Farben fuer Farbscrolling	*
* btc10:Werte fuer Wabbeln		*
* btc11:Farben fuer den (die Stripes)	*
*       Editieren wenn mehrere Stripes	*
*       mit versch. Farben		*
* I think that was all !!!		*
* Die Routinen sind schon sehr alt	*
* und deshalb schon ueberholt...	*
* es war immerhin mein erstes intro	*
*					*
* Ciao					*
*					*
*****************************************
bitplane:
blk.b	9202,0
allend:

