*********************************************************************
* 	     Paranoimia Intro V1.0 by Tom 'Vectorman' Bech	    *
* 	             Copyright 1989 CryptoBurners!                  *
* 		          All rigths reserved			    *
*********************************************************************
* Assemble the source and type 'y'. This will load the extern file! *
* Type your scrolltext at the label 'Scrtxt' and change cols of the *
* vector object in 'Copl' Default values are set! If the intro needs*
* to be put elsewhere than at $30000, change the label 'Introadr'.  *1
* If you want other movements (The Vector object), change the values*
* in the 'Movetab' table.                                           *
* Write the imagefile from 'STRT' to 'PRGEND'                       *
* We hope you need and enjoy this production!     CRYPTOBURNERS 1989*
**********************************************************************

* Imagefiles needed

>extern 'stars',stars,394		;precalculated 3D-koordinates

* constants

number=65				

* Program start

introadr=$35000				;intro address
org	introadr
load	introadr

*****************************************************************
* After the call of the 'Intro' label, a value of -1 is returned*
* in d0 if the exit was caused by the right mousebutton, if not	*
* d0 will contain 0. This option was made for trainers.		*
*****************************************************************

strt:	movem.l	d0-d7/a0-a6,-(a7)
	bsr.s	intro
	tst.w	d0
	bpl.s	endprg
	bsr.s	trainer
endprg:	movem.l	(a7)+,d0-d7/a0-a6
	rts

*********************************

trainer:rts
	
*********************************
* intro main part		*
*********************************

intro:	movem.l	clsrg,d0-d7/a0-a6
	lea	$dff000,a6
	bsr.l	setpls
	bsr.l 	initvectors
	bsr.l	setup
	bsr.l 	start

* Main loop/jumptable

mouse:	tst.b	$06(a6)
	bne.s	mouse
	cmp.w	#6000,pers
	beq.s	nosub
	sub.w	#200,pers
nosub:	bsr.s	move
	bsr.l 	swapscr
	bsr.l	angles
	bsr.l 	initrot
	bsr.l	rotate
	bsr.l	draw
	bsr.l 	stars3D
	bsr.l	putpix
	bsr.l	scroll
	move.b	$06(a6),rast

right:	btst	#10,$16(a6)
	bne.s	left
	move.w	#$ffff,d0
	bra.s	endit
left:	btst 	#6,$bfe001
	bne.s 	mouse
	clr.l	d0
endit:	bsr.l 	stop
	rts

rast:	dc.w	0

* AutoVector level3 interrupt routine (VBlank)

lev3int:movem.l d0-d7/a0-a6,-(a7)
	move.w 	sr,-(sp)
	move.w 	#$0020,$9c(a6)
	move.w 	(sp)+,sr
	movem.l	(a7)+,d0-d7/a0-a6
	rte

* Vectormovement control routine

move:	tst.w	counter
	beq.s	allok
	subq.w	#1,counter
	bra.s	endmove
allok:	tst.w	xyzok
	beq.s	xyzadd
	add.l	#14,entry
	cmp.l	#tabend-movetab,entry
	bne.s	notyet
	clr.l	entry
notyet:	lea	movetab(pc),a0
	add.l	entry(pc),a0
	move.w	(a0),counter
	move.w	2(a0),xspeed
	move.w	4(a0),yspeed
	move.w	6(a0),zspeed
	clr.w	xyzok
	clr.l	xok
	clr.w	zok
endmove:rts

* Angle adjustments

xyzadd:	lea	movetab(pc),a0
	add.l	entry(pc),a0
	move.w	8(a0),d0
	move.w	10(a0),d1
	move.w	12(a0),d2

testx:	cmp.w	xangle(pc),d0
	blt.s	minx
	bhi.s	morex
	clr.w	xspeed
	move.w	#$ffff,xok
	bra.s	testy
morex:	move.w	#2,xspeed
	clr.w	xok
	bra.s	testy
minx:	move.w	#718,xspeed
	clr.w	xok

testy:	cmp.w	yangle(pc),d1
	blt.s	miny
	bhi.s	morey
	clr.w	yspeed
	move.w	#$ffff,yok
	bra.s	testz
morey:	move.w	#2,yspeed
	clr.w	yok
	bra.s	testz
miny:	move.w	#718,yspeed
	clr.w	yok

testz:	cmp.w	zangle(pc),d2
	blt.s	minz
	bhi.s	morez
	clr.w	zspeed
	move.w	#$ffff,zok
	bra.s	testall
morez:	move.w	#2,zspeed
	clr.w	zok
	bra.s	testall
minz:	move.w	#718,zspeed
	clr.w	zok
testall:tst.w	xok
	beq.s	notok
	tst.w	yok
	beq.s	notok
	tst.w	zok
	beq.s	notok
	move.w	#$ffff,xyzok
	bra.l	endmove
notok:	clr.w	xyzok
	bra.l	endmove

* scroll routine

scroll:	movem.l	d0-d7/a0-a6,-(a7)
	movem.l	clsrg,d0-d7
	tst.w	wait
	beq.s	nowait
	subq.w	#1,wait
	bra.l	noscr
nowait:	cmp.w	#4,space
	bne.s	scrblt
	clr.w	space

mainscr:lea	scrtxt(pc),a0
	add.w	howfar(pc),a0
	move.b	(a0),d0
	tst.b	d0
	bpl.s	notend
	clr.w	howfar
	moveq	#32,d0
notend:	cmp.b	#'s',d0
	bne.s	nostop
	move.b	1(a0),d0
	sub.b	#$30,d0
	mulu	#50,d0
	move.w	d0,wait
	addq.w	#2,howfar
	clr.l	d0
	move.b	#$20,d0
nostop:	sub.b	#32,d0
	lsl.w	#1,d0
	lea	font(pc),a1
	lea	chartab(pc),a2
	add.w	(a2,d0.w),a1
	move.w	#6-1,d1
	lea	[bpl4+[132*42]]+40,a0
putch:	move.b	(a1),(a0)
	add.w	#42,a0
	add.w	#50,a1
	dbra	d1,putch
	addq.w	#1,howfar

scrblt:	btst	#14,$02(a6)
	bne.s	scrblt
	addq.w	#1,space
	move.l 	#bpl4+[132*42]+2,$50(a6)
	move.l 	#bpl4+[132*42],$54(a6)
	clr.l	$64(a6)
	move.l 	#$ffffffff,$44(a6)
	move.l 	#$e9f00000,$40(a6)
	move.w 	#[7*64]+20,$58(a6)
noscr:	movem.l	(a7)+,d0-d7/a0-a6
	rts

* Scroll colors setup & text printout

setup:	movem.l	d0-d7/a0-a6,-(a7)	;scrollcolors
	lea	coptab(pc),a1
	move.l	#$b041fffe,d0
	move.w	#6-1,d1
colcon1:lea	cols(pc),a0
	move.w	#39-1,d2
	move.l	d0,(a1)+
colcon2:move.w	#$0194,(a1)+
	move.w	(a0)+,(a1)+
	dbra	d2,colcon2
	add.l	#$01000000,d0
	dbra	d1,colcon1
	clr.l	d0
	lea	vectab(pc),a0
	lea	bpl4+[250*42],a1
print:	move.b	(a0)+,d0
	tst.b	d0
	beq.s	endprt
	sub.b	#$20,d0
	lsl.w	#1,d0
	lea	chartab(pc),a2
	lea	font(pc),a3
	add.w	(a2,d0.W),a3
	move.w	#6-1,d1
putcon:	move.b	(a3),(a1)
	add.w	#42,a1
	add.w	#50,a3
	dbra	d1,putcon
	sub.w	#[6*42]-1,a1
	bra.s	print
endprt:	move.w	movetab(pc),d0
	move.w	d0,counter
	movem.l	(a7)+,d0-d7/a0-a6
	rts

* Bitplane setup

setpls:	movem.l	d0-d7/a0-a6,-(a7)
	lea 	bpls1(pc),a0
	lea 	bplanes(pc),a1
	move.w	#4,d0
	move.w 	#$e0,d2
	bsr.l 	setbpl
	movem.l	(a7)+,d0-d7/a0-a6
	rts

* pixelplot

putpix:	movem.l	clsrg,d0-d7
	lea	xstars(pc),a1
	lea	ystars(pc),a2
	lea	stars(pc),a3
	move.w	#number-1,d3

pixcon:	move.w	(a1)+,d0
	move.w	(a2)+,d1
	addq.w	#4,a3
	cmp.w	#319,d0
	bhi.l	toomuch
	tst.w	d0
	bmi.l	toomuch
	cmp.w	#256,d1
	bhi.s	toomuch
	tst.w	d1
	bmi.s	toomuch

pixel:	move.l	pl1(pc),a0
	mulu	#42,d1
	add.w	d1,a0
	move.w	d0,d1
	lsr.w	#3,d0
	move.w	d0,d2
	add.w	d0,a0
	lsl.w	#3,d2
	sub.w	d2,d1
	not.w	d1
	bset	d1,(a0)

pixend:	clr.l	d0
	clr.l	d1
	sub.w	#$80,(a3)
	addq.w	#2,a3
govid:	dbra	d3,pixcon
	rts

toomuch:move.w	#$4000,(a3)
	addq.w	#2,a3
	bra.s	govid

* 3D-2D converter

stars3D:movem.l	d0-d7/a0-a6,-(a7)
	lea 	stars(pc),a0
	lea	xstars(pc),a1
	lea	ystars(pc),a2
	lea	zstars(pc),a3

readpix:move.w 	(a0)+,d0	; Les inn (X,Y,Z) - (d0,d1,d2)
	cmp.w 	#$ff,d0
	beq.s 	endpix
	move.w 	(a0)+,d1
	move.w 	(a0)+,d2
	muls	#$4000,d0
	lsl.l	#2,d0
	swap	d0
	muls	#$4000,d1
	lsl.l	#2,d1
	swap	d1
	muls	#$4000,d2
	lsl.l	#2,d2
	swap	d2
	move.w	d2,(a3)+
	muls	#$00b2,d0 
	muls	#$00b2,d1
	add.w	#$0fa0,d2
	tst.w	d2
	beq.s	zero2
	divs	d2,d0
	divs	d2,d1
zero2:	add.w	#160,d0
	add.w	#128,d1
	move.w	d0,(a1)+
	move.w	d1,(a2)+
	bra.l	readpix
endpix:	movem.l	(a7)+,d0-d7/a0-a6
	rts

* LineDraw routine

draw:	movem.l	d0-d7/a0-a6,-(a7)
	movem.l	clsrg,d0-d7
	lea	lines(pc),a0
	lea	xtable(pc),a1
	lea	ytable(pc),a2
readlin:move.w	(a0)+,d4
	cmp.w	#$ff,d4
	beq.s	enddraw
	move.w	(a1,d4.w),d0
	move.w	(a2,d4.w),d1
	move.w	(a0)+,d4
	move.w	(a1,d4.w),d2 
	move.w	(a2,d4.w),d3 
	bra.s	drawlin
enddraw:movem.l	(a7)+,d0-d7/a0-a6
	rts

drawlin:movem.l	d0-d7/a0-a6,-(a7)
	move.l	pl1(pc),a0
	add.l	#[120*42],a0
	move.w	#42,a1

	cmp.w	d0,d2
	bne.s	nolik
	cmp.w	d1,d3
	bne.s	nolik
	addq.w	#1,d2
	addq.w	#1,d3
	
nolik:	move.l	a1,d4
	mulu	d1,d4
	moveq	#-$10,d5
	and.w	d0,d5
	lsr.w	#3,d5
	add.w	d5,d4
	add.l	a0,d4

	clr.l	d5
	sub.w	d1,d3
	roxl.b	#1,d5
	tst.w	d3
	bge.s	y2gy1
	neg.w	d3
y2gy1:	sub.w	d0,d2
	roxl.b	#1,d5
	tst.w	d2
	bge.s	x2gx1
	neg.w	d2
x2gx1:	move.w	d3,d1
	sub.w	d2,d1
	bge.s	dygdx
	exg	d2,d3
dygdx:	roxl.b	#1,d5
	move.b	okttab(pc,d5.w),d5
	add.w	d2,d2
wblit:	btst	#14,$02(a6)
	bne.s	wblit
	move.w	d2,$62(a6)
	sub.w	d3,d2
	bge.s	signnl
	or.b	#$40,d5
signnl:	move.w	d2,$52(a6)
	sub.w	d3,d2
	move.w	d2,$64(a6)
	move.l	#$ffff8000,$72(a6)
	move.w	#$ffff,$44(a6)
	and.w	#$000f,d0
	ror.w	#4,d0
	or.w	#$0bca,d0
	move.w	d0,$40(a6)
	move.w	d5,$42(a6)
	move.l	d4,$48(a6)
	move.l	d4,$54(a6)
	move.w	a1,$60(a6)
	move.w	a1,$66(a6)
	lsl.w	#6,d3
	addq.b	#2,d3
	move.w	d3,$58(a6)
	movem.l	(a7)+,d0-d7/a0-a6
	bra.l	readlin

okttab:	dc.b	0*4+1,4*4+1,2*4+1,5*4+1	;okt 6,7,5,4
	dc.b	1*4+1,6*4+1,3*4+1,7*4+1	;okt 1,0,2,3
	even

* Vector initial routine

initvectors:
	movem.l	d0-d7/a0-a6,-(a7)
	movem.l	clsrg,d0-d7/a0-a6
	lea	paranoimia(pc),a0
init1:	move.w	(a0),d0
	cmp.w	#$ff,d0
	beq.s	init2
	muls	#84,d0  	; (5461/85) = 65
	move.w	d0,(a0)+	; MAXVERDI I TABELL = 64 FOR X,Y,Z
	bra.s	init1
init2:	addq.w	#2,a0
	move.w	(a0),d0
	cmp.w	#$ff,d0
	beq.s	initend
	muls	#2,d0
	move.w	d0,(a0)
	bra.s	init2
initend:movem.l	(a7)+,d0-d7/a0-a6
	rts

* Vector [x,y,z] rotations

rotate:	movem.l	d0-d7/a0-a6,-(a7)
	lea 	paranoimia(pc),a0
	lea	xtable(pc),a1
	lea	ytable(pc),a2
	lea	ztable(pc),a3

ReadVec:move.w 	(a0)+,d0	; Les inn (X,Y,Z) - (d0.W,d1.W,d2.W)
	cmp.w 	#$ff,d0
	beq.l 	endrot
	move.w 	(a0)+,d1
	move.w 	(a0)+,d2
	move.w	d0,d3		; Start rotering av X,Y og Z
	move.w	d1,d4
	move.w	d2,d5
	muls	xx(pc),d0
	muls	xy(pc),d4
	muls	xz(pc),d5
	sub.l	d4,d0
	sub.l	d5,d0
	lsl.l	#2,d0
	swap	d0		; Rotert X i 3D-format
	move.w	d3,d4
	move.w	d1,d5
	move.w	d2,d6
	muls	yx(pc),d3
	muls	yy(pc),d1
	muls	yz(pc),d6
	add.l	d3,d1
	sub.l	d6,d1
	lsl.l	#2,d1
	swap	d1		; Rotert Y i 3D-format
	muls	zx(pc),d4
	muls	zy(pc),d5
	muls	zz(pc),d2
	add.l	d4,d2
	add.l	d5,d2
	lsl.l	#2,d2
	swap	d2		; Rotert Z i 3D-format
	move.w	d2,(a3)+	; Lagre Z i tabell for sortering
	add.w	xadd(pc),d0
	add.w	yadd(pc),d1
	muls	xpers(pc),d0	; Her begynner beregning av  
	muls	xpers(pc),d1	; perspektivet (3D - 2D convert)
	 
	add.w	pers(pc),d2
	tst.w	d2
	beq.s	zero
	divs	d2,d0
	divs	d2,d1
zero:	add.w	xsentrum(pc),d0
	add.w	ysentrum(pc),d1
	move.w	d0,(a1)+	; Lagre X i tabell (2D-format/skjerm)
	move.w	d1,(a2)+	; Lagre Y i tabell (2D-format/skjerm)
	bra.l	readvec
endrot:	movem.l	(a7)+,d0-d7/a0-a6
	rts

* Vector Sine/Cosine angle calculations

initrot:movem.l	d0-d7/a0-a6,-(a7)
	lea	sinus(pc),a0
	lea	cosinus(pc),a1
	lea	xangle(pc),a2

	move.w	(a2)+,d0
	move.w	(a0,d0.w),sinx	
	move.w	(a1,d0.w),cosx
	move.w	(a2)+,d0
	move.w	(a0,d0.w),siny
	move.w	(a1,d0.w),cosy
	move.w	(a2)+,d0
	move.w	(a0,d0.w),sinz
	move.w	(a1,d0.w),cosz	
	move.w	sinz(pc),d0	; Her begynner beregning av
	muls	sinx(pc),d0	; generell X-rotering
	lsl.l	#2,d0
	swap	d0
	move.w	d0,d2
	muls	siny(pc),d0
	move.w	cosz(pc),d1
	muls	cosy(pc),d1
	sub.l	d0,d1
	lsl.l	#2,d1
	swap	d1
	move.w	d1,xx		; XX=CosZ*CosY-SinY*[SinZ*SinX]
	move.w	cosz(pc),d0
	muls	sinx(pc),d0
	lsl.l	#2,d0
	swap	d0
	move.w	d0,d3
	muls	siny(pc),d0
	move.w	sinz(pc),d1
	muls	cosy(pc),d1
	add.l	d1,d0
	lsl.l	#2,d0
	swap	d0
	move.w	d0,xy		; XY=SinY*[CosZ*SinX]+SinZ*CosY
	move.w	siny(pc),d0
	muls	cosx(pc),d0
	lsl.l	#2,d0
	swap	d0
	move.w	d0,xz		; XZ=SinY*CosY
	move.w	sinz(pc),d0	; Her begynner beregning av
	muls	cosx(pc),d0	; generell Y-rotering
	lsl.l	#2,d0
	swap	d0
	move.w	d0,yx		; YX=SinZ*CosX
	move.w	cosz(pc),d0
	muls	cosx(pc),d0
	lsl.l	#2,d0
	swap	d0
	move.w	d0,yy		; YY=CosZ*CosX
	move.w	sinx(pc),YZ	; YZ=SinX
	move.w	cosz(pc),d0	; Her begynner beregning av
	muls	siny(pc),d0	; generell Z-rotering
	muls	cosy(pc),d2
	add.l	d2,d0
	lsl.l	#2,d0
	swap	d0
	move.w	d0,zx		; ZX=CosZ*SinY+CosY*[SinZ*SinX]
	muls	cosy(pc),d3
	move.w	sinz(pc),d0
	muls	siny(pc),d0
	sub.l	d0,d3
	lsl.l	#2,d3
	swap	d3
	move.w	d3,zy		; ZY=CosY*[CosZ*SinX]-SinZ*SinY
	move.w	cosy(pc),d0
	muls	cosx(pc),d0
	lsl.l	#2,d0
	swap	d0
	move.w	d0,zz		; ZZ=CosY*CosX
	move.w	zsentrum(pc),d1	; Her beregnes generellt perspektiv
;	add.w	zadd(pc),d1
	move.l	perssub(pc),d0
	divs	d1,d0
	move.w	d0,xpers
	movem.l	(a7)+,d0-d7/a0-a6
	rts

* Angle add/sub

angles:	movem.l	d0-d7/a0-a6,-(a7)
	move.w	zspeed(pc),d0
	move.w	yspeed(pc),d1
	move.w	xspeed(pc),d2
	add.w	d0,zangle
	cmp.w	#719,zangle
	bmi.s	step1
	sub.w	#720,zangle
step1:	add.w	d1,yangle
	cmp.w	#719,yangle
	bmi.s	step2
	sub.w	#720,yangle
step2:	add.w	d2,xangle
	cmp.w	#719,xangle
	bmi.s	step3
	sub.w	#720,xangle
step3:	movem.l	(a7)+,d0-d7/a0-a6
	rts

* Swap & clear screen

swapscr:movem.l	d0-d7/a0-a6,-(a7)
	bchg 	#1,swp
	beq.s 	screen2
screen1:lea 	bpls1(pc),a0
	lea 	bplanes(pc),a1
	move.w 	#2,d0
	move.w 	#$00e0,d2
	bsr.l 	setbpl
	move.l 	#bpl1b,pl1
	bra.s	endswp

screen2:lea 	bpls2(pc),a0
	lea 	bplanes(pc),a1
	move.w 	#3,d0
	move.w 	#$00e0,d2
	bsr.l 	setbpl
	move.l 	#bpl1a,pl1
endswp:	btst 	#14,$02(a6)
	bne.s 	endswp
	move.l 	pl1,$54(a6)
	move.l 	#$01000000,$40(a6)
	move.w 	#$0002,$66(a6)
	move.w 	#[[120+214]*64]+[320/16],$58(a6)
	movem.l	(a7)+,d0-d7/a0-a6
	rts

* DMA/INT & copper settings/resettings

start:	move.w 	$02(a6),dmaconr
	move.w 	$1c(a6),intenar
	move.w 	#$7fff,$96(a6)
	move.w 	#$3fdf,$9a(a6)
	move.l 	$6c.w,oldlev3
	move.l 	#lev3int,$6c.w
	move.w 	#$87c0,$96(a6)
	move.l 	#copl,$84(a6)
	clr.w 	$8a(a6)
	rts

stop:	move.l 	oldlev3(pc),$6c.w
	or.w 	#$8000,dmaconr
	move.w 	#$0100,$96(a6)
	move.w 	dmaconr(pc),$96(a6)
	or.w	#$8000,intenar
	move.w 	intenar(pc),$9a(a6)
	rts

* Bitplane/Sprite 'allround' rout

setbpl:	move.w 	d2,(a1)+
	move.l 	(a0)+,d1
	swap 	d1
	move.w 	d1,(a1)+
	add.w 	#2,d2
	move.w 	d2,(a1)+
	swap 	d1
	move.w 	d1,(a1)+
	addq 	#2,d2
	subq 	#1,d0
	bne.s 	setbpl
	rts

* Copper data

copl:	dc.w 	$008e,$2c71,$0090,$2cd1,$0092,$0038,$0094,$00d0
	dc.w	$0100,$4600,$0102,$0000,$0104,$0040,$0108,$0002
	dc.w 	$010a,$0002,$0120,$0000,$0122,$0000
bplanes:blk.l	$0c,$00f60000
colors:	dc.w	$0180,$0000,$0182,$0fff,$0184,$00ff,$0186,$0fff
	dc.w	$0188,$0fff,$018a,$0fff,$018c,$0fff,$018e,$0fff
	dc.w	$0190,$0000,$0192,$0f48	;<- color of Vectors here!
	dc.w	$0194,$0000,$0196,$0fff

	dc.w	$3001,$fffe,$0182,$0ddd
	dc.w	$8001,$fffe,$0182,$0777
	dc.w	$9401,$fffe,$0182,$0444
	dc.w	$b001,$fffe,$0108,-82
coptab:	blk.w	[80*6],$0000
	dc.w	$c001,$fffe,$0182,$0444,$0194,$0112
	dc.w	$d401,$fffe,$0182,$0777
	dc.w	$e801,$fffe,$0182,$0ddd
	dc.w 	$ffff,$fffe

* Variables

intenar:dc.w 	0
dmaconr:dc.w 	0
oldlev3:dc.l 	0
counter:dc.w	0
begun:	dc.w	0
space:	dc.w	0
howfar:	dc.w	0
entry:	dc.l	0
wait:	dc.w	0
xok:	dc.w	0
yok:	dc.w	0
zok:	dc.w	0
xyzok:	dc.w	0
swp:	dc.w 	0
pers:	dc.w 	30000
perssub:dc.l 	50000
xsentrum:dc.w 	160
ysentrum:dc.w 	124
zsentrum:dc.w 	280
xadd:	dc.w 	0
yadd:	dc.w 	0
zadd:	dc.w 	0
xangle:	dc.w 	180*2
yangle:	dc.w 	0*2
zangle:	dc.w 	0*2
sinx:	dc.w 	0
cosx:	dc.w 	0
siny:	dc.w 	0
cosy:	dc.w 	0
sinz:	dc.w 	0
cosz:	dc.w 	0
xx:	dc.w 	0
xy:	dc.w 	0
xz:	dc.w 	0
yx:	dc.w 	0
yy:	dc.w 	0
yz:	dc.w 	0
zx:	dc.w 	0
zy:	dc.w 	0
zz:	dc.w 	0
xpers:	dc.w 	0
ypers:	dc.w 	0
xspeed:	dc.w	0
yspeed:	dc.w	0
zspeed:	dc.w	0
pl1:	dc.l 	bpl1a
xtable:	blk.w	31,$ff
ytable:	blk.w 	31,$ff
ztable:	blk.w 	31,$ff
xstars:	blk.w	[[number*2]+2],$ff
ystars:	blk.w 	[[number*2]+2],$ff
zstars:	blk.w 	[[number*2]+2],$ff
clsrg:	blk.l	16,0

stars:	blk.w	[3*number]+2,$00ff

paranoimia:
dc.w	-28,0,0, -20,4,0, -28,8,0, -28,-8,0, -20,-8,0, -20,0,0 	;pa
dc.w	-14,0,0, -18,0,0, -18,-8,0, -10,-8,0, -10,0,0		;ra 
dc.w	-8,-8,0, -8,0,0, -2,0,0, -2,-8,0			;n
dc.w	0,-8,0, 0,0,0, 6,0,0, 6,-8,0				;o
dc.w	8,-8,0, 8,0,0						;i
dc.w	10,-8,0, 10,0,0, 18,0,0, 18,-8,0, 14,0,0, 14,-4,0	;m
dc.w	20,0,0, 20,-8,0, 28,-8,0, 28,0,0			;ia
dc.w	$ff

lines:
dc.w	0,1, 1,2, 2,3, 3,4, 4,5, 5,3	;pa
dc.w	6,7, 7,8, 8,9, 9,10, 10,8	;ra
dc.w	11,12, 12,13, 13,14		;n
dc.w	15,16, 16,17, 17,18, 18,15	;o
dc.w	19,20				;i
dc.w	21,22, 22,23, 23,24, 25,26	;m
dc.w	27,28, 28,29, 29,30, 30,28	;ia
dc.w	$ff

sinus:
dc.w 0,286,572,857,1143,1428,1713,1997,2280
dc.w 2563,2845,3126,3406,3686,3964,4240,4516,4790
dc.w 5063,5334,5604,5872,6138,6402,6664,6924,7182
dc.w 7438,7692,7943,8192,8438,8682,8923,9162,9397
dc.w 9630,9860,10087,10311,10531,10749,10963,11174,11381
dc.w 11585,11786,11982,12176,12365,12551,12733,12911,13085
dc.w 13255,13421,13583,13741,13894,14044,14189,14330,14466
dc.w 14598,14726,14849,14968,15082,15191,15296,15396,15491
dc.w 15582,15668,15749,15826,15897,15964,16026,16083,16135
dc.w 16182,16225,16262,16294,16322,16344,16362,16374,16382
cosinus:
dc.w 16384,16382,16374,16362,16344,16322,16294,16262,16225
dc.w 16182,16135,16083,16026,15964,15897,15826,15749,15668
dc.w 15582,15491,15396,15296,15191,15082,14968,14849,14726
dc.w 14598,14466,14330,14189,14044,13894,13741,13583,13421
dc.w 13255,13085,12911,12733,12551,12365,12176,11982,11786
dc.w 11585,11381,11174,10963,10749,10531,10311,10087,9860
dc.w 9630,9397,9162,8923,8682,8438,8192,7943,7692
dc.w 7438,7182,6924,6664,6402,6138,5872,5604,5334
dc.w 5063,4790,4516,4240,3964,3686,3406,3126,2845
dc.w 2563,2280,1997,1713,1428,1143,857,572,286
dc.w 0,-286,-572,-857,-1143,-1428,-1713,-1997,-2280
dc.w -2563,-2845,-3126,-3406,-3686,-3964,-4240,-4516,-4790
dc.w -5063,-5334,-5604,-5872,-6138,-6402,-6664,-6924,-7182
dc.w -7438,-7692,-7943,-8192,-8438,-8682,-8923,-9162,-9397
dc.w -9630,-9860,-10087,-10311,-10531,-10749,-10963,-11174,-11381
dc.w -11585,-11786,-11982,-12176,-12365,-12551,-12733,-12911,-13085
dc.w -13255,-13421,-13583,-13741,-13894,-14044,-14189,-14330,-14466
dc.w -14598,-14726,-14849,-14968,-15082,-15191,-15296,-15396,-15491
dc.w -15582,-15668,-15749,-15826,-15897,-15964,-16026,-16083,-16135
dc.w -16182,-16225,-16262,-16294,-16322,-16344,-16362,-16374,-16382
dc.w -16384,-16382,-16374,-16362,-16344,-16322,-16294,-16262,-16225
dc.w -16182,-16135,-16083,-16026,-15964,-15897,-15826,-15749,-15668
dc.w -15582,-15491,-15396,-15296,-15191,-15082,-14968,-14849,-14726
dc.w -14598,-14466,-14330,-14189,-14044,-13894,-13741,-13583,-13421
dc.w -13255,-13085,-12911,-12733,-12551,-12365,-12176,-11982,-11786
dc.w -11585,-11381,-11174,-10963,-10749,-10531,-10311,-10087,-9860
dc.w -9630,-9397,-9162,-8923,-8682,-8438,-8192,-7943,-7692
dc.w -7438,-7182,-6924,-6664,-6402,-6138,-5872,-5604,-5334
dc.w -5063,-4790,-4516,-4240,-3964,-3686,-3406,-3126,-2845
dc.w -2563,-2280,-1997,-1713,-1428,-1143,-857,-572,-286
dc.w 0,286,572,857,1143,1428,1713,1997,2280
dc.w 2563,2845,3126,3406,3686,3964,4240,4516,4790
dc.w 5063,5334,5604,5872,6138,6402,6664,6924,7182
dc.w 7438,7692,7943,8192,8438,8682,8923,9162,9397
dc.w 9630,9860,10087,10311,10531,10749,10963,11174,11381
dc.w 11585,11786,11982,12176,12365,12551,12733,12911,13085
dc.w 13255,13421,13583,13741,13894,14044,14189,14330,14466
dc.w 14598,14726,14849,14968,15082,15191,15296,15396,15491
dc.w 15582,15668,15749,15826,15897,15964,16026,16083,16135
dc.w 16182,16225,16262,16294,16322,16344,16362,16374,16382

* VectorMovements table:
* entry: [duration in secs *50],xspeed,yspeed,zspeed
* then:  which angel to stop at/adjust to - x,y,z angle...

movetab:dc.w	[7*50],0,0,0,	180*2,0*2,0*2
	dc.w	[7*50],0,2,0,	180*2,0*2,0*2
	dc.w	[7*50],4,2,0,	180*2,0*2,0*2
	dc.w	[5*50],2,4,2,	180*2,0*2,0*2
	dc.w	[7*50],0,4,4,	180*2,0*2,0*2
	dc.w	[3*50],4,0,2,	180*2,0*2,0*2
tabend:

* guess what this is... ['s'+number of secs to stop]=scrollstop!
* Number ranges from 0 to z (0=lowest, 3=3 secs, z=74 secs)

scrtxt:	dc.b	'                               '
	dc.b	' SPACE ACE ... THE MEGA-TITLE OF THE YEAR'
        dc.b	' WAS CRACKED BY THE BEST ...'
	DC.B	'                PARANOIMIA              s1   '
	dc.b	'    MESSAGE TO ALL OTHER GROUPS THAT ARE WORKING '
	DC.B 	'ON THIS GAME : NEVER TRY TO WORK ON A HARD'
	DC.B 	' PROTECTED GAME , WHEN PARANOIMIA IS DOING IT !!!'
	DC.B 	' THAT IS ONLY A WASTE OF TIME !!!        '
	DC.B 	'    CONTACT PARANOIMIA : P.O. BOX 10 , 4140 AMAY ,'
	DC.B 	' BELGIUM !!!   ITALIANS WRITE TO : P.O. BOX 127 , BARI'
	DC.B 	' , ITALY !!!!                '
scrend:	dc.b	$ff
even

* never mind the rest of this source!

chartab:dc.w	47,36,0,0,0,0,0,45,43,44	; sp ! " # $ % & ' ( )
	dc.w	0,0,39,41,38,46,35,26,27,28	;  * + , - . / 0 1 2 3
	dc.w	29,30,31,32,33,34,40,0,0,0	;  4 5 6 7 8 9 : ; < =
	dc.w	0,37,0,0,1,2,3,4,5,6		;  > ? @ A B C D E F G
	dc.w	7,8,9,10,11,12,13,14,15,16	;  H I J K L M N O P Q
	dc.w	17,18,19,20,21,22,23,24,25	;  R S T U V W X Y Z

cols:	dc.w	$0000,$0111,$0222,$0333,$0444,$0555,$0666,$0777
	dc.w	$0888,$0999,$0aaa,$0bbb,$0ccc,$0ddd,$0eee,$0fff
	dc.w	$0fff,$0fff,$0fff,$0fff,$0fff,$0fff,$0fff,$0fff
	dc.w	$0eee,$0ddd,$0ccc,$0bbb,$0aaa,$0999,$0888,$0777
	dc.w	$0666,$0555,$0444,$0333,$0222,$0111,$0000

vectab:	dc.w	$2020,$2020,$2020,$2049,$4e54,$524f,$2042,$5920
	dc.w	$4352,$5950,$544f,$4255,$524e,$4552,$5320,$3139
	dc.w	$3839,$2020,$2020,$2020,$2000

font:	dc.w	$78f8,$78f8,$fcfc,$7ccc,$fcfc,$ccc0,$84cc,$78f8
	dc.w	$78f8,$7cfc,$cccc,$cccc,$ccfc,$38f8,$f838,$fc7c
	dc.w	$fc78,$7878,$30f8,$0000,$0000,$0060,$1830,$0c00
	dc.w	$0000,$cccc,$cccc,$c0c0,$c0cc,$300c,$ccc0,$ccec
	dc.w	$cccc,$cccc,$c030,$cccc,$cccc,$cc0c,$780c,$0c78
	dc.w	$c0c0,$0ccc,$ccdc,$300c,$0000,$3000,$00c0,$0c30
	dc.w	$1800,$0000,$fcf8,$c0cc,$f0f0,$dcfc,$300c,$f8c0
	dc.w	$fcfc,$ccf8,$ccf8,$7830,$cccc,$fc78,$7830,$1878
	dc.w	$38d8,$f8f8,$1878,$7cec,$3038,$0000,$00fc,$00c0
	dc.w	$0c60,$3000,$0000,$cccc,$cccc,$c0c0,$cccc,$30cc
	dc.w	$ccc0,$ccdc,$ccc0,$dccc,$0c30,$cc78,$cccc,$30c0
 	dc.w	$18c0,$0cfc,$0ccc,$30cc,$0ccc,$0000,$3030,$3000
 	dc.w	$00c0,$0c00,$6000,$0000,$ccf8,$78f8,$fcc0,$7ccc
 	dc.w	$fc78,$ccfc,$cccc,$78c0,$7ccc,$f830,$7c30,$84cc
 	dc.w	$30fc,$18fc,$f818,$f878,$3078,$f878,$3030,$3030
 	dc.w	$0000,$fc60,$1800,$c000,$0000,$0000,$0000,$0000
 	dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
 	dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
 	dc.w	$0060,$0000,$0000,$0000,$0000,$0000,$0000,$0000

bpls1:	dc.l 	bpl1a,bpl2a,bpl3,bpl4
bpls2:	dc.l 	bpl1b,bpl2b,bpl3,bpl4

	blk.b	1024,$00
bpl1a:	blk.b 	[336/8*120],$00
bpl2a:	blk.b	[336/8*258],$00
bpl1b:	blk.b 	[336/8*120],$00
bpl2b:	blk.b	[336/8*258],$00
bpl3:	blk.b	[336/8*256],$00
bpl4:	blk.b	[336/8*256],$00
prgend:
