;This is the 'Fireworks Intro II' ! Coded by CORTO
;Only for Angels members !

; A,  Jrun
; WI  filename  run  end
; Ltext:
; L*** for comments


org $40000
load $40000

run:
movem.L d0-d7/a0-a6,-(sp)
bsr.L save_all
lea $50000,a0
move #$98ff,d7
run1:
clr.l (a0)+
dbra d7,run1

lea font,a0
lea fonts,a1
move #1727,d7
run2:
move (a0)+,(a1)+
clr (a1)+
dbra d7,run2

bsr.L makedet
move #15,d6
run3:
bsr.L makecopper
dbra d6,run3
bsr.L rectifzoom
move #$100,coltab2+2
lea $dff000,a6
move #$3fff,$9a(a6)
move #$c000,$9a(a6)
move #$3fff,$96(a6)
move #$83c0,$96(a6)
move.L #copperlist,$80(a6)
clr $88(a6)
bsr.L init_music
lea $dff000,a6
bsr.L normal


move.L #%111101111011100111101111,$63780+38
move.L #%100001001010100011001001,$63780+64+38
move.L #%100001001011100011001001,$63780+128+38
move.l #%100001001010010011001001,$63780+192+38
move.l #%111101111010010011001111,$63780+256+38

wait:
cmpi.b #1,6(a6)
bne.s wait
tst.b 5(a6)
bne.s wait
move.L bpw,d0
move.L bpa,bpw
move.l d0,bpa
move d0,copbpl3d+6
swap d0
move d0,copbpl3d+2
swap d0
addi.l #64,d0
move d0,copbpl3d+14
swap d0
move d0,copbpl3d+10
lea $dff000,a6
bsr.L clear3d
bsr.L calcule
bsr.L play
lea $dff000,a6
bsr.L draw

;lea $dff000,a6
move.b delai,d0
add.b d0,wait1
tst.b wait1
bne.s irq1
bsr.L print
irq1:bsr.L cycle

clr boum+2

lea det,a0
lea bp1,a4
bsr.L polaire

lea det+[40*nbdata],a0
lea bp3,a4
bsr.L polaire

	addi.b #2,cpal2
bne.s irq03
	bsr.L makecopper

irq03:
addi.b #$40,cpal
bne.s irq3

tst colmap1+2
beq.s irq01
move colmap1+2,d0
bsr.s noir
move d0,colmap1+2
irq01:
tst colmap2+2
beq.s irq3
move colmap2+2,d0
bsr.s noir
move d0,colmap2+2
move d0,colmap2+6
irq3:
lea $dff000,a6

;move #$f00,$dff180

btst #6,$bfe001
bne.L wait
bsr.L end_music
bsr.L restore_all
movem.L (sp)+,d0-d7/a0-a6
rts
wait1:dc.b 0
delai:dc.b $40
delai2:dc.l $c9f00000
even
speedtable:dc.W $10f9,$20e9,$40c9,$8089

noir:
move d0,d1
move d0,d2
move d0,d3
and #$f00,d1
tst d1
beq.s noir1
sub #$100,d1
noir1:and #$f0,d2
tst d2
beq.s noir2
sub #$10,d2
noir2:and #$f,d3
tst d3
beq.s noir3
subq #1,d3
noir3:
or d3,d1
or d2,d1
move d1,d0
rts

cpal:dc.b 0
cpal2:dc.b 0

clear3d:move #$8400,$96(a6)
clear31:btst #$e,2(a6)
bne.s clear31
move #$400,$96(a6)
move #20,$66(a6)	;64-44
move.l bpw,$54(a6)
move.L #$1000000,$40(a6)
move #[280*64]+22,$58(a6)
rts

rectifzoom:
lea angels2,a2
recl1:move (a2),d0
ext.l d0
lsl.l #8,d0
divs #128,d0
move d0,(a2)+
cmpi #$7777,(a2)
bne.s recl1
rts

;*** 8,16 et 24 sont les vitesses de rotation
;mais attention a ce que les lignes ne sortent pas de l'ecran

calcule:
addi #8,x+2
andi #$7fe,x+2
addi #16,y+2
andi #$7fe,y+2
addi #24,z+2
andi #$7fe,z+2
lea si,a0
lea cos,a1
lea angels2,a2
lea coord,a3
movem.L vide,d0-d7
calculoop:
movem.w (a2)+,d0/d1/d2
move d0,d5
move d1,d6
x:move #$200,d3
muls (a0,d3),d0	
muls (a1,d3),d1
sub.l d1,d0
muls (a1,d3),d5
move d6,d1
muls (a0,d3),d1
add.l d5,d1
asr.l #8,d0
asr.l #2,d0
asr.l #8,d1
asr.l #2,d1
y:move #$600,d3
move d1,d5
move d2,d6
muls (a0,d3),d1
muls (a1,d3),d2
sub.l d2,d1
muls (a1,d3),d5
move d6,d2
muls (a0,d3),d2
add.l d5,d2
asr.l #2,d1
asr.l #8,d2
asr.l #2,d2
z:move #$200,d3
move d2,d5
move d0,d6
muls (a0,d3),d2
muls (a1,d3),d0
sub.l d0,d2
muls (a1,d3),d5
move d6,d0
muls (a0,d3),d0
add.l d5,d0
asr.l #2,d0
asr.l #8,d2
asr.l #6,d2

add #300,d2
divs d2,d0
divs d2,d1
addi #[22*128],d0
addi #[111*16],d1
move d0,(a3)+
move d1,(a3)+
cmpi #$7777,(a2)
bne.L calculoop
rts

draw:
lea coord,a3
Lea angels2l,a4
movem.L vide,d0-d7
move.L bpw,a0
move #$8400,$96(a6)
wbbl:btst #6,2(a6)
bne.s wbbl
move #$400,$96(a6)
move.l #$ffff8000,$72(a6)
move.l #-1,$44(a6)
move.w #64,$60(a6)
move.w #64,$66(a6)

drawloop1:
move.b (a4)+,d0
move.b (a4)+,d2

lsl.b #2,d0
lsl.b #2,d2
ext d0
ext d2

move 2(a3,d0.w),d1
move (a3,d0.w),d0
move 2(a3,d2.w),d3
move (a3,d2.w),d2

asr #4,d0
asr #4,d1
asr #4,d2
asr #4,d3

cmp d0,d2
bne.s draw1
cmp d1,d3
beq.s draw2
draw1:
bsr.s drawline
draw2:
cmpi.B #$77,(a4)
bne.s drawloop1
rts

drawline:
move.l d1,d4
lsl.l #6,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 table_octants(pc,d5),d5
add.w d2,d2
move #$8400,$96(a6)
wblit:btst #6,$2(a6)
bne.s wblit
move #$400,$96(a6)
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)
and.w #$f,d0
ror.w #4,d0
or.w #$bca,d0
move.w d0,$40(a6)
move.w d5,$42(a6)
move.l d4,$48(a6)
move.l d4,$54(a6)
lsl.w #6,d3
addq.w #2,d3
move.w d3,$58(a6)
rts

table_octants:
dc.b 1,17,9,21,5,25,13,29
even

bpa:dc.L b3p1	;bitplan affiché
bpw:dc.L b3p2	;bitplan travail

vide:blk.b 32,0

angels2:
dc.w -600,100,400,-500,350,400,-400,100,400

dc.w -450,350,400,-300,350,400,-300,100,400

dc.w -125,225,400,-50,100,400,-225,100,400,-225,350,400
dc.W 75,350,400,0,350,400,0,250,400,125,250,400
dc.w 0,100,400,175,100,400

dc.W 250,350,400,250,100,400,600,100,400,400,350,400,500,350,400
dc.w $7777

angels2l:
dc.b 0,1,1,2,2,0
dc.b 3,4,4,5
dc.b 6,7,7,8,8,9,9,10,11,14,12,13,14,15
dc.b 16,17,17,18,18,19,19,20
dc.w $7777


coord:blk.w 80,0


clear:
lea $dff000,a6
move #$8400,$96(a6)
clear1:
btst #6,2(a6)
bne.s clear1
move #$400,$96(a6)
move.L #$1000000,$40(a6)
move #$14,$66(a6)
move.L #bp1,$54(a6)
move #[222*64]+22,$58(a6)
rts

clear2:
lea $dff000,a6
move #$8400,$96(a6)
clear5:
btst #6,2(a6)
bne.s clear5
move #$400,$96(a6)
move.L #$1000000,$40(a6)
move #$14,$66(a6)
move.L #bp3,$54(a6)
move #[222*64]+22,$58(a6)
rts

mod=0
arg=4
vmod=8
varg=12
modx=16
cx=20
cy=22
typ=24
adr=26
img=28
amod=30

nbdata=34

polaire:
lea si,a6	;sinus
lea cos,a5
;lea bp1,a4
lea bp2,a2
lea table_images,a3
;lea det,a0
move #39,d7
poloop1:
tst typ(a0)
bmi.L polend
beq.s pol2
move adr(a0),d1
move img(a0),d0
not d0
and d0,(a4,d1.w)
bra.s pol3
pol2:
move adr(a0),d1
move img(a0),d0
not d0
and d0,(a2,d1.w)
pol3:
move.l arg(a0),d0
add.l varg(a0),d0
move.l d0,arg(a0)
swap d0
and #$7fe,d0

move.L vmod(a0),d1
add.L amod(a0),d1
move.L d1,vmod(a0)

move.l mod(a0),d1
add.l vmod(a0),d1
move.l d1,mod(a0)

swap d1

move (a6,d0.w),d2
move (a5,d0.w),d3
muls d1,d2
muls d1,d3
asr.L #8,d2
asr.L #8,d3
asr.l #2,d2
asr.l #2,d3

addi cy(a0),d2
bmi.s pas_aff
cmpi #221,d2
bpl.s pas_aff
addi cx(a0),d3
bmi.s pas_aff
cmpi #351,d3
bpl.s pas_aff

tst typ(a0)
bne.s pols2	
;pret a exploser ?
tst.L vmod(a0)
bmi.L explose

pols2:

move d3,d4
;mulu #44
lsl #6,d2
lsr #3,d3
and #$fffe,d3
add d3,d2
and #$f,d4
add d4,d4
move (a3,d4.w),d4
tst typ(a0)
beq.s pol1
or d4,(a4,d2.w)
move d4,img(a0)
move d2,adr(a0)
polend:addi.L #nbdata,a0
dbra d7,poloop1
rts
pol1:or d4,(a2,d2.w)
move d4,img(a0)
move d2,adr(a0)
addi.L #nbdata,a0
dbra d7,poloop1
rts

pas_aff:
move #-1,typ(a0)
bra.s polend

table_images:dc.W $8000,$4000,$2000,$1000,$800,$400,$200,$100
dc.w $80,$40,$20,$10,8,4,2,1


typstop:dc.L 0
typcount:dc.B 0
even

lancer:
dc.l $6000000,$20000
dc.L $40000,$800000,-$900
dc.l $5d80000,-$20000
dc.L $40000,$600000,-$b00
dc.l $6000000,-$7000
dc.L $50000,$480000,-$1300
dc.l $6100000,$40000
dc.l $40000,$500000,-$e00
dc.L $5f00000,-$30000
dc.L $60000,$400000,-$1500
dc.L $6000000,$4000
dc.L $40000,$400000,-$1100
dc.L $5f80000,-$2000
dc.L $48000,$600000,-$1800
dc.L $6100000,$c000
dc.l $55000,$500000,-$1000
dc.l $6000000,$60000
dc.l $50000,$680000,-$1400
dc.L $5e00000,-$20000
dc.L $60000,$3c0000,-$1700
dc.l $5f40000,-$8000
dc.L $30000,$300000,-$1900
dc.L $6000000,0
dc.l $50000,$40000,-$1500
dc.l $6050000,$d000
dc.L $50000,$50000,-$1100
dc.L $5f00000,-$4000
dc.L $50000,$400000,-$1800
dc.L $6000000,$30000
dc.L $40000,$200000,-$1600
dc.L $6000000,-$14000
dc.L $48000,$400000,-$1000
dc.l $5f00000,-$40000
dc.l $40000,$500000,-$e00
dc.L $6000000,-$10000
dc.L $50000,$500000,-$1200
dc.l $6080000,$30000
dc.L $3b000,$400000,-$d00
dc.w $7777

lancerc:dc.L lancer+20


	;***  -1:ligne suivante
	;     -2:decaler toute la prochaine ligne pour centrer
	;	 le texte
text1:
dc.b -1
dc.b -1
dc.b "        ANGELS        ",-1,-2	;centre 'Present'
DC.B "       PRESENT       ",-1
dc.B -1,-1,-1
dc.B "       BEAST II",-1
DC.B -1
DC.B " 100% 2 DISKS VERSION",0	;0=fini

dc.b "                      "	;22 chars. maxi

	;*** dc.b 1,2,3,4 : change speed
	;dc.b $80: stop scrolltext

text:
;dc.B 1,"   This is slow      ",2," This is medium       ",3
;dc.b "This is normal         ",4,"Thiiiiis iiiiiiiis"
;dc.B " faaaaaaaaaaaaaaast !!!        ",3

dc.B 3,"    --- ANGELS ---  ",2,32,1,32	;centre a 22 chars.
dc.b $80,1,32,2,32,3
dc.b "bring you another quality crack called..."
dc.B "  Shadow of the Beast II",$80
dc.B "  from Psygnosis "
dc.B "!   This is the two-disks 100%"
dc.B " version of this game !   "
dc.b "To contact us, write to ... ",1
dc.b "P.O. Box 10 - 4504 - Obercorn - LUXEMBURG ... "
dc.B "P.O. Box 3 - 6040 - Jumet - BELGIUM ... "
dc.b "P.O. Box 31 - 9910 - Mariakerke - BELGIUM ... "
dc.B "P.O. Box 2568 - 4300 - Sandnes - NORWAY   "
dc.b "or call our boards ... "
dc.b "Amiga East: 804-499-2266 (World HQ) ... "
dc.b "Insider BBS: +39-564-415-697 (Euro HQ) ... "
dc.b "World Trade Center: +41-170-11323 (Swiss HQ) ... "
dc.B "Skyfox BBS: +49-911-353-571 (German HQ) ... "
dc.b "City limits: +44-704-501-09 (England HQ) ... "
dc.b "The Dutch Pirate: +31-011-723-66 (Holland HQ) ... "
dc.b "Escape zone: 704-254-6448 ... "
dc.B "Digital Expression: 813-398-7393 ... "
dc.b "Wreck House: 201-751-2175 ... "
dc.b "Reign in blood: +49-202-406-0981 ... "
dc.B "House of Insanity: 813-584-6089      "
dc.b "That's all !  "
dc.B " Greetings to all our",3
dc.b " friends and contacts all over the world !           "
dc.b "This was ",2,"the Fireworks Intro"
dc.b " coded by CORTO   "
dc.b $7f," ANGELS 1990                          ",3,0
even
textptr:dc.l text

normal:
lea text1,a0
move.l #bp0,d2
normall1:
move.L d2,d1
normall2:clr.l d0
move.b (a0)+,d0
tst.B d0
beq.L ret
cmpi.B #-1,d0
beq.s line1
cmpi.b #-2,d0
bne.s norm1
move.l #$8fca8000,con1+2
bra.s normall2
norm1:
sub.b #$20,d0
;lsl.b #2,d0
mulu #72,d0
addi.l #fonts,d0
bsr.L letter
addq.L #2,d1
bra.s normall2
line1:
addi.l #16*64,d2
move.l #$0fca0000,con1+2
bra.s normall1

print:
tst.b textstop
bne.L ret
clr.l d0
move.l textptr,a0
move.b (a0)+,d0
tst.b d0
beq.s fini
move.l a0,textptr
cmpi.b #$80,d0
beq.L spechg1
cmpi.B #$20,d0
blo.s spechg
sub.b #$20,d0
mulu #36,d0
addi.l #font,d0
move.L d0,a0
lea scroll+44,a1
move (a0)+,[46*0](a1)
move (a0)+,[46*1](a1)
move (a0)+,[46*2](a1)
move (a0)+,[46*3](a1)
move (a0)+,[46*4](a1)
move (a0)+,[46*5](a1)
move (a0)+,[46*6](a1)
move (a0)+,[46*7](a1)
move (a0)+,[46*8](a1)
move (a0)+,[46*9](a1)
move (a0)+,[46*10](a1)
move (a0)+,[46*11](a1)
move (a0)+,[46*12](a1)
move (a0)+,[46*13](a1)
move (a0)+,[46*14](a1)
move (a0)+,[46*15](a1)
move (a0)+,[46*16](a1)
move (a0)+,[46*17](a1)
ret:rts
ret1:subq.B #1,textstop
rts
fini:
move.l #text,textptr
bra.L print
spechg:
subq.b #1,d0
lsl #1,d0
lea speedtable,a0
move (a0,d0.w),d0
move.b d0,delai2
lsr #8,d0
move.b d0,delai
clr.b wait1
bra.L print
spechg1:move.B #150,textstop
rts
textstop:dc.B 0
even

letter:	;d0=font,d1=bp
move #$8400,$96(a6)
letter1:btst #6,2(a6)
bne.s letter1
move #$400,$96(a6)
move.l d0,$50(a6)
move.l d1,$54(a6)
move.l d1,$48(a6)
move.l d0,$4c(a6)
con1:move.l #$fca0000,$40(a6)
move.l #$ffff0000,$44(a6)
move.w #60,$66(a6)
move #60,$60(a6)
clr.l $62(a6)
move.w #[18*64]+2,$58(a6)
rts

cycle:
tst.b textstop
bne.L ret1
move #$8400,$96(a6)
cyc1:btst #6,$2(a6)
bne.s cyc1
move #$400,$96(a6)
move.l #scroll-2,$54(a6)
move.l #scroll,$50(a6)
move.l delai2,$40(a6)
move.l #$ffffffff,$44(a6)
clr.l $64(a6)
move.w #1048,$58(a6)
rts

save_all:
move.L 4,a6
jsr -132(a6)
move.b #%10000111,$bfd100
move.l $6c,save_vecteur_irq
move.w $dff01c,save_intena
or.w #$c000,save_intena
move.w $dff002,save_dmacon
or.w #$8100,save_dmacon
rts
restore_all:
move.l save_vecteur_irq,$6c
move.w #$7fff,$dff09a
move.w save_intena,$dff09a
move.w #$7fff,$dff096
move.w save_dmacon,$dff096
move.l 4,a6
lea name_glib,a1
moveq #0,d0
jsr -552(a6)
move.l d0,a0
move.l 38(a0),$dff080
clr.w $dff088
move.L 4,a6
jsr -138(a6)
rts
save_intena:dc.w 0
save_dmacon:dc.w 0
save_vecteur_irq:dc.l 0
name_glib:dc.b "graphics.library",0
even

makedet:
lea det,a0
move #79,d7
mdl1:
clr.L (a0)+
move.l #$6000000,(a0)+
move.L #$40000,(a0)+
move.l #$20000,(a0)+	;varg
move.L #$800000,(a0)+	;maxmod (modx)
move #176,(a0)+		;cx
move #221,(a0)+		;cy
move #-1,(a0)+		;type	-1=fini
clr (a0)+		;adr
clr (a0)+		;img
move.L #-$900,(a0)+	;amod

dbra d7,mdl1

lea det,a0
bsr.s makefusee
lea det+[50*nbdata],a0
bsr.s makefusee
rts

makefusee:
move.L lancerc,a2
clr.L (a0)+
move.l (a2),(a0)+
move.L 8(a2),(a0)+
move.L 4(a2),(a0)+	;varg
move.L 12(a2),(a0)+	;maxmod (modx)
move #176,(a0)+		;cx
move #221,(a0)+		;cy
move.L a0,typstop
move.B #150,typcount
move #0,(a0)+		;type	0=1e 1=eclats  2=arret
clr (a0)+		;adr
clr (a0)+		;img
move.L 16(a2),(a0)+	;amod
addi.L #20,a2
cmpi #$7777,(a2)
bne.s mf1a
lea lancer,a2
mf1a:move.L a2,lancerc
rts

explose:

;*** Enlever la ligne suivante pour que l'ecran ne bouge plus
;a chaque explosion

;move #$10,boum+2

cmpi.L #bp1,a4
bne.s exp1
bsr.L clear
bra.s exp2
exp1:
bsr.L clear2
exp2:
move #39,d7
move #$600,d4
move.l #$40000,d5
move.L a0,a1
expl1:
clr.l (a0)+
move d4,(a0)+
clr (a0)+
move.L d5,(a0)+
clr.L (a0)+
move.L #$7fffffff,(a0)+
move d3,(a0)+
move d2,(a0)+
move #1,(a0)+
clr.L (a0)+
clr.L (a0)+
add d2,d5
add d3,d5
add d2,d5
add $df0006,d5
;rol #4,d5
andi.L #$3fc00,d5
add d2,d4
add d3,d4
add d2,d4
add $df0006,d4
andi #$7fe,d4
dbra d7,expl1


move.L a1,a0
makedet1:
move.L lancerc,a2
clr.L (a0)+
move.l (a2),(a0)+
move.L 8(a2),(a0)+
move.L 4(a2),(a0)+	;varg
move.L 12(a2),(a0)+	;maxmod (modx)
move #176,(a0)+		;cx
move #221,(a0)+		;cy
move.L a0,typstop
move.B #150,typcount
move #0,(a0)+		;type	0=1e 1=eclats  2=arret
clr (a0)+		;adr
clr (a0)+		;img
move.L 16(a2),(a0)+	;amod
addi.L #20,a2
cmpi #$7777,(a2)
bne.s md1a
lea lancer,a2
md1a:move.L a2,lancerc
move.L coltabc,a2
move (a2)+,d0
cmpi #$7777,(a2)
bne.s md1b
lea coltab,a2
md1b:move.L a2,coltabc
cmpi.l #bp3,a4
beq.s exp5
move d0,colmap1+2
rts
exp5:move d0,colmap2+2
move d0,colmap2+6
rts

coltab:dc.W $fff,$ff0,$f,$f00,$f0
dc.w $f80,$ea6,$aaf
dc.w $ff,$f0f,$ff0
dc.w $80f,$f80,$f08,$fff,$f
dc.W $8f8,$d5d,$08f,$cfc,$fc8,$af0,$f0a
dc.W $fff,$fa0,$46f,$88f,$f84,$9d9,$b8f
dc.W $7777
coltabc:dc.l coltab

lastloop:dc.w 14
coltab2:dc.w -$11,0
dc.w -$100,1	;bleu
dc.w -1,$10	;vert
dc.w 0,$100	;jaune
dc.w -$10,1	;violet
dc.w -$100,$10	;bleu-vert
dc.w $7777
coltab2c:dc.l coltab2
makecopper:
lea cop1+6,a0
move lastloop,d7
mcl1:
move.l coltab2c,a1
move (a0),d0
move (a1)+,d1
move (a1)+,d2
add d1,d0
add d2,d0
move d0,(a0)
move d0,d1
move d0,d2
addq.L #8,a0
dbra d7,mcl1
subq #1,lastloop

tst lastloop
bmi.s mcl3
rts
mcl3:
move #14,lastloop
cmpi #$7777,(a1)
bne.s mcl2
lea coltab2,a1
mcl2:
move.l a1,coltab2c
rts

copperlist:
dc.L $8e2479,$9033c9,$920030,$9400d8

dc.l $1840ccc,$1860ccc,$18c0ccc,$18e0ccc

dc.L $1920fff,$1960fff,$19a0fff
col3d:dc.L $19400b7,$19800b7,$19c00b7,$19e00b7

dc.L $2c0ffffe
dc.l $1080002,$1001200,$1820f00
dc.l $e00005,$e20000
cop1:
dc.L $2d0ffffe,$1820fff
dc.L $2e0ffffe,$1820fff
dc.L $2f0ffffe,$1820fff
dc.L $300ffffe,$1820fff
dc.L $310ffffe,$1820fff
dc.L $320ffffe,$1820fff
dc.L $330ffffe,$1820fff
dc.L $340ffffe,$1820fff
dc.L $350ffffe,$1820fff
dc.L $360ffffe,$1820fff
dc.L $370ffffe,$1820fff
dc.L $380ffffe,$1820fff
dc.L $390ffffe,$1820fff
dc.L $3a0ffffe,$1820fff
dc.L $3b0ffffe,$1820fff
dc.L $3c0ffffe,$1820fff


dc.l $3d0ffffe,$1000200
boum:dc.l $1020000,$1040040,$1080014,$10a0014
colmap1:dc.L $1820fff
colmap2:dc.l $1880ff0,$18a0ff0

copbpl1:dc.w $e0,6,$e2,0,$e8,6,$ea,$4800,$f0,6,$f2,$9000
dc.L $e40005,$e60400
copbpl3d:dc.w $ec,5,$ee,$400,$f4,5,$f6,$400

dc.L $470ffffe,$1800002
dc.L $480ffffe,$1800004
dc.L $490ffffe,$1800007
dc.L $4a0ffffe,$1800004
dc.L $4b0ffffe,$1800002
dc.L $4c0ffffe,$1800000
dc.L $4d0ffffe,$1006600

dc.L $ffdffffe,$ffffe
dc.L $2b0ffffe,$1001200,$1820fff
dc.L $2c0ffffe,$1800002,$1820eee
dc.L $2d0ffffe,$1800004,$1820ddd
dc.l $2e0ffffe,$1800007,$1820ccc
dc.l $2f0ffffe,$1800004,$1820bbb
dc.l $300ffffe,$1800002,$1000200
dc.L $310ffffe,$1800000,$1820fff
dc.l $108ffa6,$1000200

dc.l -2

END_MUSIC:
;clr.w onoff
clr.l $dff0a6
clr.l $dff0b6
clr.l $dff0c6
clr.l $dff0d6
move.w #$000f,$dff096
rts

INIT_MUSIC:
;move.w #1,onoff
lea MODULE(pc),a0
lea 100(a0),a1
lea	SEQpoint(pc),a5
move.l a1,(a5)
move.l a0,a1
add.l 8(a0),a1
lea	PATpoint(pc),a5
move.l a1,(a5)
move.l a0,a1
add.l 16(a0),a1
lea	FRQpoint(pc),a5
move.l a1,(a5)
move.l a0,a1
add.l 24(a0),a1
lea	VOLpoint(pc),a5
move.l a1,(a5)
move.l 4(a0),d0
divu #13,d0

lea 40(a0),a1
lea SOUNDINFO+4(pc),a2
moveq #10-1,d1
initloop:
move.w (a1)+,(a2)+
move.l (a1)+,(a2)+
addq.w #4,a2
dbf d1,initloop
moveq #0,d2
move.l a0,d1
add.l 32(a0),d1
lea	waveforms(pc),a5
sub.l a5,d1
lea SOUNDINFO(pc),a0
move.l d1,(a0)+
moveq #9-1,d3
initloop1:
move.w (a0),d2
add.l d2,d1
add.l d2,d1
addq.w #6,a0
move.l d1,(a0)+
dbf d3,initloop1

move.l SEQpoint(pc),a0
moveq #0,d2
move.b 12(a0),d2		;Get replay speed
bne.s speedok
move.b #3,d2			;Set default speed
speedok:
lea	respcnt(pc),a5
move.w d2,(a5)		;Init repspeed counter
lea	repspd(pc),a5
move.w d2,(a5)
INIT2:
lea	audtemp(pc),a5
clr.w (a5)
move.w #$000f,$dff096		;Disable audio DMA
move.w #$0780,$dff09a		;Disable audio IRQ
moveq #0,d7
mulu #13,d0
moveq #4-1,d6			;Number of soundchannels-1
lea V1data(pc),a0		;Point to 1st voice data area
lea silent(pc),a1
lea o4a0c8(pc),a2
initloop2:
move.l a1,10(a0)
move.l a1,18(a0)
clr.l 14(a0)
clr.b 45(a0)
clr.b 47(a0)
clr.w 8(a0)
clr.l 48(a0)
move.b #$01,23(a0)
move.b #$01,24(a0)
clr.b 25(a0)
clr.l 26(a0)
clr.w 30(a0)
moveq #$00,d3
move.w (a2)+,d1
move.w (a2)+,d3
divu #$0003,d3
move.b d3,32(a0)
mulu #$0003,d3
andi.l #$00ff,d3
andi.l #$00ff,d1
addi.l #$dff0a0,d1
move.l d1,a6
move.l #$0000,(a6)
move.w #$0100,4(a6)
move.w #$0000,6(a6)
move.w #$0000,8(a6)
move.l d1,60(a0)
clr.w 64(a0)
move.l SEQpoint(pc),(a0)
move.l SEQpoint(pc),52(a0)
add.l d0,52(a0)
add.l d3,52(a0)
add.l d7,(a0)
add.l d3,(a0)
move.w #$000d,6(a0)
move.l (a0),a3
move.b (a3),d1
andi.l #$00ff,d1
lsl.w #6,d1
move.l PATpoint(pc),a4
adda.w d1,a4
move.l a4,34(a0)
clr.l 38(a0)
move.b #$01,33(a0)
move.b #$02,42(a0)
move.b 1(a3),44(a0)
move.b 2(a3),22(a0)
clr.b 43(a0)
clr.b 45(a0)
clr.w 56(a0)
adda.w #$004a,a0	;Point to next voice's data area
dbf d6,initloop2
rts

PLAY:
lea pervol(pc),a6
;tst.w onoff
;bne.s music_on
;rts
music_on:
lea	respcnt(pc),a5
subq.w #1,(a5)			;Decrease replayspeed counter
bne.s nonewnote
move.w repspd(pc),(a5)		;Restore replayspeed counter
lea V1data(pc),a0		;Point to voice1 data area
bsr.L new_note
lea V2data(pc),a0		;Point to voice2 data area
bsr.L new_note
lea V3data(pc),a0		;Point to voice3 data area
bsr.L new_note
lea V4data(pc),a0		;Point to voice4 data area
bsr.L new_note

nonewnote:
lea	audtemp(pc),a5
clr.w (a5)
lea V1data(pc),a0
bsr.L effects
move.w d0,(a6)+
move.w d1,(a6)+
lea V2data(pc),a0
bsr.L effects
move.w d0,(a6)+
move.w d1,(a6)+
lea V3data(pc),a0
bsr.L effects
move.w d0,(a6)+
move.w d1,(a6)+
lea V4data(pc),a0
bsr.L effects
move.w d0,(a6)+
move.w d1,(a6)+
lea pervol(pc),a6
move.w audtemp(pc),d0
ori.w #$8000,d0			;Set/clr bit = 1
move.w d0,-(a7)
moveq #0,d1
move.l start1(pc),d2		;Get samplepointers
move.w offset1(pc),d1		;Get offset
add.l d1,d2			;Add offset
move.l start2(pc),d3
move.w offset2(pc),d1
add.l d1,d3
move.l start3(pc),d4
move.w offset3(pc),d1
add.l d1,d4
move.l start4(pc),d5
move.w offset4(pc),d1
add.l d1,d5
move.w ssize1(pc),d0		;Get sound lengths
move.w ssize2(pc),d1
move.w ssize3(pc),d6
move.w ssize4(pc),d7
move.w (a7)+,$dff096		;Enable audio DMA
chan1:
lea V1data(pc),a0
tst.w 72(a0)
beq.l chan2
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s chan2
clr.w 72(a0)
move.l d2,$dff0a0		;Set soundstart
move.w d0,$dff0a4		;Set soundlength
chan2:
lea V2data(pc),a0
tst.w 72(a0)
beq.s chan3
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s chan3
clr.w 72(a0)
move.l d3,$dff0b0
move.w d1,$dff0b4
chan3:
lea V3data(pc),a0
tst.w 72(a0)
beq.s chan4
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s chan4
clr.w 72(a0)
move.l d4,$dff0c0
move.w d6,$dff0c4
chan4:
lea V4data(pc),a0
tst.w 72(a0)
beq.s setpervol
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s setpervol
clr.w 72(a0)
move.l d5,$dff0d0
move.w d7,$dff0d4
setpervol:
lea $dff0a6,a5
move.w (a6)+,(a5)	;Set period
move.w (a6)+,2(a5)	;Set volume
move.w (a6)+,16(a5)
move.w (a6)+,18(a5)
move.w (a6)+,32(a5)
move.w (a6)+,34(a5)
move.w (a6)+,48(a5)
move.w (a6)+,50(a5)
rts

NEW_NOTE:
moveq #0,d5
move.l 34(a0),a1
adda.w 40(a0),a1
cmp.w #64,40(a0)
bne.s samepat
move.l (a0),a2
adda.w 6(a0),a2		;Point to next sequence row
cmpa.l 52(a0),a2	;Is it the end?
bne.s notend
move.w d5,6(a0)		;yes!
move.l (a0),a2		;Point to first sequence
notend:
moveq #0,d1
lea	spdtemp(pc),a5
addq.b #1,(a5)
cmpi.b #4,(a5)
bne.s nonewspd
move.b d5,(a5)
move.b -1(a1),d1	;Get new replay speed
beq.s nonewspd
lea	respcnt(pc),a5
move.w d1,(a5)		;store in counter
lea	repspd(pc),a5
move.w d1,(a5)
nonewspd:
move.b (a2),d1		;Pattern to play
move.b 1(a2),44(a0)	;Transpose value
move.b 2(a2),22(a0)	;Soundtranspose value

move.w d5,40(a0)
lsl.w #6,d1
add.l PATpoint(pc),d1	;Get pattern pointer
move.l d1,34(a0)
addi.w #$000d,6(a0)
move.l d1,a1
samepat:
move.b 1(a1),d1		;Get info byte
move.b (a1)+,d0		;Get note
bne.s ww1
andi.w #%11000000,d1
beq.s noport
bra.s ww11
ww1:
move.w d5,56(a0)
ww11:
move.b d5,47(a0)
move.b (a1),31(a0)

		;31(a0) = PORTAMENTO/INSTR. info
			;Bit 7 = portamento on
			;Bit 6 = portamento off
			;Bit 5-0 = instrument number
		;47(a0) = portamento value
			;Bit 7-5 = always zero
			;Bit 4 = up/down
			;Bit 3-0 = value
t_porton:
btst #7,d1
beq.s noport
move.b 2(a1),47(a0)	
noport:
andi.w #$007f,d0
beq.s nextnote
move.b d0,8(a0)
move.b (a1),9(a0)
move.b 32(a0),d2
moveq #0,d3
bset d2,d3
lea	audtemp(pc),a5
or.w d3,(a5)
move.w d3,$dff096
move.b (a1),d1
andi.w #$003f,d1	;Max 64 instruments
add.b 22(a0),d1
move.l VOLpoint(pc),a2
lsl.w #6,d1
adda.w d1,a2
move.w d5,16(a0)
move.b (a2),23(a0)
move.b (a2)+,24(a0)
move.b (a2)+,d1
andi.w #$00ff,d1
move.b (a2)+,27(a0)
move.b #$40,46(a0)
move.b (a2)+,d0
move.b d0,28(a0)
move.b d0,29(a0)
move.b (a2)+,30(a0)
move.l a2,10(a0)
move.l FRQpoint(pc),a2
lsl.w #6,d1
adda.w d1,a2
move.l a2,18(a0)
move.w d5,50(a0)
move.b d5,26(a0)
move.b d5,25(a0)
nextnote:
addq.w #2,40(a0)
rts

EFFECTS:
moveq #0,d7
testsustain:
tst.b 26(a0)		;Is sustain counter = 0
beq.s sustzero
subq.b #1,26(a0)	;if no, decrease counter
bra.L VOLUfx
sustzero:		;Next part of effect sequence
move.l 18(a0),a1	;can be executed now.
adda.w 50(a0),a1
testeffects:
cmpi.b #$e1,(a1)	;E1 = end of FREQseq sequence
beq.L VOLUfx
cmpi.b #$e0,(a1)	;E0 = loop to other part of sequence
bne.s testnewsound
move.b 1(a1),d0		;loop to start of sequence + 1(a1)
andi.w #$003f,d0
move.w d0,50(a0)
move.l 18(a0),a1
adda.w d0,a1
testnewsound:
cmpi.b #$e2,(a1)	;E2 = set waveform
bne.s o49c64
moveq #0,d0
moveq #0,d1
move.b 32(a0),d1
bset d1,d0
lea	audtemp(pc),a5
or.w d0,(a5)
move.w d0,$dff096
move.b 1(a1),d0
andi.w #$00ff,d0
lea SOUNDINFO(pc),a4
add.w d0,d0
move.w d0,d1
add.w d1,d1
add.w d1,d1
add.w d1,d0
adda.w d0,a4
move.l 60(a0),a3
move.l (a4),d1
lea	waveforms(pc),a5
add.l a5,d1
move.l d1,(a3)
move.l d1,68(a0)
move.w 4(a4),4(a3)
move.l 6(a4),64(a0)
swap d1
move.w #$0003,72(a0)
tst.w d1
bne.s o49c52
move.w #$0002,72(a0)
o49c52:
clr.w 16(a0)
move.b #$01,23(a0)
addq.w #2,50(a0)
bra.L o49d02
o49c64:
cmpi.b #$e4,(a1)
bne.s testpatjmp
move.b 1(a1),d0
andi.w #$00ff,d0
lea SOUNDINFO(pc),a4
add.w d0,d0
move.w d0,d1
add.w d1,d1
add.w d1,d1
add.w d1,d0
adda.w d0,a4
move.l 60(a0),a3
move.l (a4),d1
lea	waveforms(pc),a5
add.l a5,d1
move.l d1,(a3)
move.l d1,68(a0)
move.w 4(a4),4(a3)
move.l 6(a4),64(a0)

swap d1
move.w #$0003,72(a0)
tst.w d1
bne.s o49cae
move.w #$0002,72(a0)
o49cae:
addq.w #2,50(a0)
bra.s o49d02
testpatjmp:
cmpi.b #$e7,(a1)
bne.s testnewsustain
move.b 1(a1),d0
andi.w #$00ff,d0
lsl.w #6,d0
move.l FRQpoint(pc),a1
adda.w d0,a1
move.l a1,18(a0)
move.w d7,50(a0)
bra.L testeffects
testnewsustain:
cmpi.b #$e8,(a1)	;E8 = set sustain time
bne.s o49cea
move.b 1(a1),26(a0)
addq.w #2,50(a0)
bra.L testsustain
o49cea:
cmpi.b #$e3,(a1)
bne.s o49d02
addq.w #3,50(a0)
move.b 1(a1),27(a0)
move.b 2(a1),28(a0)
o49d02:
move.l 18(a0),a1
adda.w 50(a0),a1
move.b (a1),43(a0)
addq.w #1,50(a0)
VOLUfx:
tst.b 25(a0)
beq.s o49d1e
subq.b #1,25(a0)
bra.s o49d70
o49d1e:
subq.b #1,23(a0)
bne.s o49d70
move.b 24(a0),23(a0)
o49d2a:
move.l 10(a0),a1
adda.w 16(a0),a1
move.b (a1),d0
cmpi.b #$e8,d0
bne.s o49d4a
addq.w #2,16(a0)
move.b 1(a1),25(a0)
bra.s VOLUfx
o49d4a:
cmpi.b #$e1,d0
beq.s o49d70
cmpi.b #$e0,d0
bne.s o49d68
move.b 1(a1),d0
andi.l #$003f,d0
subq.b #5,d0
move.w d0,16(a0)
bra.s o49d2a
o49d68:
move.b (a1),45(a0)
addq.w #1,16(a0)
o49d70:
move.b 43(a0),d0
bmi.s o49d7e
add.b 8(a0),d0
add.b 44(a0),d0
o49d7e:
andi.w #$007f,d0
lea PERIODS(pc),a1
add.w d0,d0
move.w d0,d1
adda.w d0,a1
move.w (a1),d0
move.b 46(a0),d7
tst.b 30(a0)
beq.s o49d9e
subq.b #1,30(a0)

bra.s o49df4
o49d9e:
move.b d1,d5
move.b 28(a0),d4
add.b d4,d4
move.b 29(a0),d1
tst.b d7
bpl.s o49db4
btst #0,d7
bne.s o49dda
o49db4:
btst #5,d7
bne.s o49dc8
sub.b 27(a0),d1
bcc.s o49dd6
bset #5,d7
moveq #0,d1
bra.s o49dd6
o49dc8:
add.b 27(a0),d1
cmp.b d4,d1
bcs.s o49dd6
bclr #5,d7
move.b d4,d1
o49dd6:
move.b d1,29(a0)
o49dda:
lsr.b #1,d4
sub.b d4,d1
bcc.s o49de4
subi.w #$0100,d1
o49de4:
addi.b #$a0,d5
bcs.s o49df2
o49dea:
add.w d1,d1
addi.b #$18,d5
bcc.s o49dea
o49df2:
add.w d1,d0
o49df4:
eori.b #$01,d7
move.b d7,46(a0)

; DO THE PORTAMENTO THING
moveq #0,d1
move.b 47(a0),d1	;get portavalue
beq.s a56d0		;0=no portamento
cmpi.b #$1f,d1
bls.s portaup
portadown: 
andi.w #$1f,d1
neg.w d1
portaup:
sub.w d1,56(a0)
a56d0:
add.w 56(a0),d0
o49e3e:
cmpi.w #$0070,d0
bhi.s nn1
move.w #$0071,d0
nn1:
cmpi.w #$06b0,d0
bls.s nn2
move.w #$06b0,d0
nn2:
moveq #0,d1
move.b 45(a0),d1
rts

pervol: blk.b 16,0	;Periods & Volumes temp. store
respcnt: dc.w 0		;Replay speed counter 
repspd:  dc.w 0		;Replay speed counter temp
firseq:	 dc.w 0		;First sequence
lasseq:	 dc.w 0		;Last sequence
audtemp: dc.w 0
spdtemp: dc.w 0

V1data:  blk.b 64,0	;Voice 1 data area
offset1: blk.b 02,0	;Is added to start of sound
ssize1:  blk.b 02,0	;Length of sound
start1:  blk.b 06,0	;Start of sound

V2data:  blk.b 64,0	;Voice 2 data area
offset2: blk.b 02,0
ssize2:  blk.b 02,0
start2:  blk.b 06,0

V3data:  blk.b 64,0	;Voice 3 data area
offset3: blk.b 02,0
ssize3:  blk.b 02,0
start3:  blk.b 06,0

V4data:  blk.b 64,0	;Voice 4 data area
offset4: blk.b 02,0
ssize4:  blk.b 02,0
start4:  blk.b 06,0

o4a0c8: dc.l $00000000,$00100003,$00200006,$00300009
SEQpoint: dc.l 0
PATpoint: dc.l 0
FRQpoint: dc.l 0
VOLpoint: dc.l 0

SILENT: dc.w $0100,$0000,$0000,$00e1

PERIODS:dc.w $06b0,$0650,$05f4,$05a0,$054c,$0500,$04b8,$0474
	dc.w $0434,$03f8,$03c0,$038a,$0358,$0328,$02fa,$02d0
	dc.w $02a6,$0280,$025c,$023a,$021a,$01fc,$01e0,$01c5
	dc.w $01ac,$0194,$017d,$0168,$0153,$0140,$012e,$011d
	dc.w $010d,$00fe,$00f0,$00e2,$00d6,$00ca,$00be,$00b4
	dc.w $00aa,$00a0,$0097,$008f,$0087,$007f,$0078,$0071
	dc.w $0071,$0071,$0071,$0071,$0071,$0071,$0071,$0071
	dc.w $0071,$0071,$0071,$0071,$0d60,$0ca0,$0be8,$0b40
	dc.w $0a98,$0a00,$0970,$08e8,$0868,$07f0,$0780,$0714
	dc.w $1ac0,$1940,$17d0,$1680,$1530,$1400,$12e0,$11d0
	dc.w $10d0,$0fe0,$0f00,$0e28

SOUNDINFO:
;Offset.l , Sound-length.w , Start-offset.w , Repeat-length.w 

;Reserved for samples
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
	dc.w $0000,$0000 ,$0000 ,$0000 ,$0001 
;Reserved for synth sounds
	dc.w $0000,$0000 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0020 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0040 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0060 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0080 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$00a0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$00c0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$00e0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0100 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0120 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0140 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0160 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0180 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$01a0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$01c0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$01e0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0200 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0220 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0240 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0260 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0280 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$02a0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$02c0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$02e0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0300 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0320 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0340 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0360 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0380 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$03a0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$03c0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$03e0 ,$0010 ,$0000 ,$0010 
	dc.w $0000,$0400 ,$0008 ,$0000 ,$0008 
	dc.w $0000,$0410 ,$0008 ,$0000 ,$0008 
	dc.w $0000,$0420 ,$0008 ,$0000 ,$0008 
	dc.w $0000,$0430 ,$0008 ,$0000 ,$0008 
	dc.w $0000,$0440 ,$0008 ,$0000 ,$0008
	dc.w $0000,$0450 ,$0008 ,$0000 ,$0008
	dc.w $0000,$0460 ,$0008 ,$0000 ,$0008
	dc.w $0000,$0470 ,$0008 ,$0000 ,$0008
	dc.w $0000,$0480 ,$0010 ,$0000 ,$0010
	dc.w $0000,$04a0 ,$0008 ,$0000 ,$0008
	dc.w $0000,$04b0 ,$0010 ,$0000 ,$0010
	dc.w $0000,$04d0 ,$0010 ,$0000 ,$0010
	dc.w $0000,$04f0 ,$0008 ,$0000 ,$0008
	dc.w $0000,$0500 ,$0008 ,$0000 ,$0008
	dc.w $0000,$0510 ,$0018 ,$0000 ,$0018

WAVEFORMS:
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $3f37,$2f27,$1f17,$0f07,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c037,$2f27,$1f17,$0f07,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$2f27,$1f17,$0f07,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b027,$1f17,$0f07,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$1f17,$0f07,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a017,$0f07,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$0f07,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9007,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$ff07,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$8007,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$8088,$0f17,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$8088,$9017,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$8088,$9098,$1f27,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$8088,$9098,$a027,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$8088,$9098,$a0a8,$2f37
dc.w $c0c0,$d0d8,$e0e8,$f0f8,$00f8,$f0e8,$e0d8,$d0c8
dc.w $c0b8,$b0a8,$a098,$9088,$8088,$9098,$a0a8,$b037
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $817f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$817f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$817f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$817f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$8181,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$8181,$817f,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$8181,$8181,$7f7f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$8181,$8181,$817f,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$7f7f,$7f7f
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$8181,$8181
dc.w $8181,$8181,$8181,$8181,$8181,$8181,$817f,$7f7f
dc.w $8080,$8080,$8080,$8080,$8080,$8080,$8080,$8080
dc.w $8080,$8080,$8080,$8080,$8080,$8080,$8080,$7f7f
dc.w $8080,$8080,$8080,$8080,$8080,$8080,$8080,$8080
dc.w $8080,$8080,$8080,$8080,$8080,$8080,$8080,$807f
dc.w $8080,$8080,$8080,$8080,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$8080,$8080,$807f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$8080,$8080,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$8080,$807f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$8080,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$807f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f,$7f7f
dc.w $8080,$9098,$a0a8,$b0b8,$c0c8,$d0d8,$e0e8,$f0f8
dc.w $0008,$1018,$2028,$3038,$4048,$5058,$6068,$707f
dc.w $8080,$a0b0,$c0d0,$e0f0,$0010,$2030,$4050,$6070
dc.w $4545,$797d,$7a77,$7066,$6158,$534d,$2c20,$1812
dc.w $04db,$d3cd,$c6bc,$b5ae,$a8a3,$9d99,$938e,$8b8a
dc.w $4545,$797d,$7a77,$7066,$5b4b,$4337,$2c20,$1812
dc.w $04f8,$e8db,$cfc6,$beb0,$a8a4,$9e9a,$9594,$8d83
dc.w $0000,$4060,$7f60,$4020,$00e0,$c0a0,$80a0,$c0e0
dc.w $0000,$4060,$7f60,$4020,$00e0,$c0a0,$80a0,$c0e0
dc.w $8080,$9098,$a0a8,$b0b8,$c0c8,$d0d8,$e0e8,$f0f8
dc.w $0008,$1018,$2028,$3038,$4048,$5058,$6068,$707f
dc.w $8080,$a0b0,$c0d0,$e0f0,$0010,$2030,$4050,$6070

MODULE:
incbin "mod.tristar"	;*** ici pour changer la zik


si:
incbin "sincos"
cos=si+$200

det:blk.b 100*nbdata


font:
incbin "globulus"

end:
fonts:blk.b 3456*2
scroll=$50000+46
bp0=$50400

bp1=$60000
bp2=$64800
bp3=$69000
b3p1=$6d800
b3p2=$71e00
