>EXTERN "the song",mt_sampleinfo
>EXTERN "monobass",s1
>EXTERN "perco",s2
>EXTERN "bassdrum2",s3
>EXTERN "popsnare2",s4
>EXTERN "hihat2",s5
>EXTERN "strings6",s6
>EXTERN "strings3",s7
>EXTERN "ombre",dataombre
>EXTERN "lettre",datalettre
>EXTERN "datalogocbc",dmon1
***********************************
mt_speed=$1f4
jmp run

dc.b 'demo programmed by FREDDY . If you want to contact me '
dc.b 'call the 30.64.69.10 (France near Versailles)'
even

music:
bsr		mt_init
move.w		#$4000,$dff09a
move.l		$00006c,mt_oldirq
move.l		#mt_newirq,$00006c
move.w		#$c000,$dff09a

mt_wait:
jsr suite

move.w		#$000f,$dff096
move.w		#$4000,$dff09a
move.l		mt_oldirq,$00006c
move.w		#$c000,$dff09a
clr.l		d0
rts

mt_init:
move.l		#s1,mt_sample1
move.l		#s2,mt_sample2
move.l		#s3,mt_sample3
move.l		#s4,mt_sample4
move.l		#s5,mt_sample5
move.l		#s6,mt_sample6
move.l		#s7,mt_sample7
move.l		#s8,mt_sample8
move.l		#s9,mt_sample9
move.l		#sa,mt_sample10
move.l		#sb,mt_sample11
move.l		#sc,mt_sample12
move.l		#sd,mt_sample13
move.l		#se,mt_sample14
move.l		#sf,mt_sample15

move.l		#mt_sample1,a0
clr.l		d0
mt_clear:
move.l		(a0,d0),a1
clr.l		(a1)
addq		#4,d0
cmp.l		#$3c,d0
bne.s		mt_clear

move.w		#0,$dff0a8
move.w		#0,$dff0b8
move.w		#0,$dff0c8
move.w		#0,$dff0d8
eor.w		#$c000,mt_voice0+12
clr.l		mt_partnrplay
clr.l		mt_partnote
clr.l		mt_partpoint

move.b		mt_sampleinfo+$1d6,mt_maxpart+1
move.b		mt_sampleinfo+$1d7,mt_kn1+1
rts


mt_newirq:
movem.l		d0-d7/a0-a6,-(a7)
bsr		mt_music
movem.l		(a7)+,d0-d7/a0-a6

dc.w		$4ef9
mt_oldirq:
dc.l		0


mt_music:
addq.l		#1,mt_counter
move.l		mt_tempo,d0
cmp.l		mt_counter,d0
bne.s		mt_notsix
clr.l		mt_counter
bra.L		mt_rout2

mt_notsix:
lea		mt_aud1temp,a6
tst.b		3(a6)
beq.s		mt_arp1
move.l		#$dff0a0,a5		
bsr.s		mt_arprout

mt_arp1:
lea		mt_aud2temp,a6
tst.b		3(a6)
beq.s		mt_arp2
move.l		#$dff0b0,a5
bsr.s		mt_arprout

mt_arp2:
lea		mt_aud3temp,a6
tst.b		3(a6)
beq.s		mt_arp3
move.l		#$dff0c0,a5
bsr.s		mt_arprout

mt_arp3:
lea		mt_aud4temp,a6
tst.b		3(a6)
beq.s		mt_arp4
move.l		#$dff0d0,a5
bsr.s		mt_arprout
mt_arp4:
bra.L		mt_stop


mt_arprout:
tst.w	24(a6)
beq.s	mt_noslide

clr.w	d0
move.b	25(a6),d0
lsr.b	#4,d0
tst.b	d0
beq.s	mt_voldwn2
bsr.L	mt_pushvol1
bra.s	mt_noslide

mt_voldwn2:
clr.w	d0
move.b	25(a6),d0
bsr.L	mt_pushvol2

mt_noslide:
move.b	2(a6),d0
and.b	#$0f,d0
tst.b	d0
beq.L	mt_arpegrt
cmp.b	#3,d0
beq.L	mt_arpegrt
cmp.b	#4,d0
beq.L	mt_arpegrt
cmp.b	#5,d0
beq.L	mt_arpegrt
cmp.b	#1,d0
beq.s	mt_portup
cmp.b	#6,d0
beq.s	mt_portup
cmp.b	#7,d0
beq.s	mt_portup
cmp.b	#8,d0
beq.s	mt_portup
cmp.b	#2,d0
beq.s	mt_portdwn
cmp.b	#9,d0
beq.s	mt_portdwn
cmp.b	#10,d0
beq.s	mt_portdwn
cmp.b	#11,d0
beq.s	mt_portdwn
cmp.b	#13,d0
beq.s	mt_volup
rts

mt_portup:
clr.w	d0
move.b	3(a6),d0
sub.w	d0,22(a6)
cmp.w	#$71,22(a6)
bpl.s	mt_ok1
move.w	#$71,22(a6)
mt_ok1:
move.w	22(a6),6(a5)
rts

mt_portdwn:
clr.w	d0
move.b	3(a6),d0
add.w	d0,22(a6)
cmp.w	#$358,22(a6)
bmi.s	mt_ok2
move.w	#$358,22(a6)
mt_ok2:
move.w	22(a6),6(a5)
rts

mt_volup:
clr.w	d0
move.b	3(a6),d0
lsr.b	#4,d0
tst.b	d0
beq.s	mt_voldwn
mt_pushvol1:
add.w	d0,$12(a6)
cmp.w	#$40,$12(a6)
bmi.s	mt_ok3
move.w	#$40,$12(a6)
mt_ok3:
move.w	$12(a6),8(a5)
rts

mt_voldwn:
clr.w	d0
move.b	3(a6),d0
mt_pushvol2:
and.b	#$0f,d0
sub.w	d0,$12(a6)
bpl.s	mt_ok4
clr.w	$12(a6)
mt_ok4:
move.w	$12(a6),8(a5)
rts

mt_arpegrt:
cmp.l		#1,mt_counter
beq.s		mt_loop2
cmp.l		#2,mt_counter
beq.s		mt_loop3
cmp.l		#3,mt_counter
beq.s		mt_loop4
cmp.l		#4,mt_counter
beq.s		mt_loop2
cmp.l		#5,mt_counter
beq.s		mt_loop3
rts

mt_loop2:
clr.l		d0
move.b		3(a6),d0
lsr.b		#4,d0
bra.s		mt_cont

mt_loop3:
clr.l		d0
move.b		3(a6),d0
and.b		#$0f,d0
bra.s		mt_cont

mt_loop4:
move.w		16(a6),d2
bra.s		mt_endpart

mt_cont:
lsl.w		#1,d0
clr.l		d1
move.w		16(a6),d1
lea		mt_arpeggio,a0
mt_loop5:
move.w		(a0,d0),d2
cmp.w		(a0),d1
beq.s		mt_endpart
addq.l		#2,a0
bra.s		mt_loop5

mt_endpart:
move.w		d2,6(a5)
rts

mt_rout2:
lea		mt_sampleinfo,a0
move.l		a0,a3
add.l		#$0c,a3
move.l		a0,a2
add.l		#$1d8,a2
add.l		#$258,a0
move.l		mt_partnrplay,d0
clr.l		d1
move.b		(a2,d0),d1
mulu		#$0400,d1
add.l		mt_partnote,d1
move.l		d1,mt_partpoint
clr.w		mt_dmacon

move.l		#$dff0a0,a5
lea		mt_aud1temp,a6
bsr.L		mt_playit

move.l		#$dff0b0,a5
lea		mt_aud2temp,a6
bsr.L		mt_playit

move.l		#$dff0c0,a5
lea		mt_aud3temp,a6
bsr.L		mt_playit

move.l		#$dff0d0,a5
lea		mt_aud4temp,a6
bsr.L		mt_playit

move.l		#mt_speed,d0
mt_rls:
dbf		d0,mt_rls

move.l		#$8000,d0
add.w		mt_dmacon,d0
move.w		d0,$dff096

move.l		#mt_aud4temp,a6
cmp.w		#1,14(a6)
bne.s		mt_voice3
move.l		10(a6),$dff0d0
move.w		#1,$dff0d4
mt_voice3:
move.l		#mt_aud3temp,a6
cmp.w		#1,14(a6)
bne.s		mt_voice2
move.l		10(a6),$dff0c0
move.w		#1,$dff0c4
mt_voice2:
move.l		#mt_aud2temp,a6
cmp.w		#1,14(a6)
bne.s		mt_voice1
move.l		10(a6),$dff0b0
move.w		#1,$dff0b4
mt_voice1:
move.l		#mt_aud1temp,a6
cmp.w		#1,14(a6)
bne.s		mt_voice0
move.l		10(a6),$dff0a0
move.w		#1,$dff0a4

mt_voice0:
lea		mt_modulate,a0
move.l		mt_partnote,d0
lsl.b		#7,d0
add.l		#$10,d0
move.l		d0,mt_partnote
cmp.l		#$400,d0
bne.s		mt_stop
clr.l		mt_partnote
addq.l		#1,mt_partnrplay
clr.l		d0
move.w		mt_maxpart,d0
move.l		mt_partnrplay,d1
cmp.l		d0,d1
bne.s		mt_stop
clr.l		mt_partnrplay
mt_stop:
rts


mt_playit:
move.l		(a0,d1),(a6)
addq.l		#4,d1
clr.l		d2
move.b		2(a6),d2
and.b		#$f0,d2
lsr.b		#4,d2
tst.b		d2
beq.s		mt_nosamplechange

clr.l		d3
lea		mt_samples,a1
move.l		d2,d4
mulu		#4,d2
mulu		#$1e,d4
move.l		(a1,d2),4(a6)
move.w		(a3,d4),8(a6)
move.w		2(a3,d4),18(a6)
move.w		4(a3,d4),d3
tst.w		d3
beq.s		mt_displace
move.l		4(a6),d2
add.l		d3,d2
move.l		d2,4(a6)
move.l		d2,10(a6)
move.w		6(a3,d4),8(a6)
move.w		6(a3,d4),14(a6)
move.w		18(a6),8(a5)
bra.s		mt_nosamplechange
mt_displace:
move.l		4(a6),d2
add.l		d3,d2
move.l		d2,10(a6)
move.w		6(a3,d4),14(a6)
move.w		18(a6),8(a5)
mt_nosamplechange:
tst.w		(a6)
beq.s		mt_retrout
move.w		(a6),16(a6)
move.w		20(a6),$dff096
move.l		4(a6),(a5)
move.w		8(a6),4(a5)
move.w		(a6),6(a5)
move.w		20(a6),d0
or.w		d0,mt_dmacon

mt_retrout:
move.w	20(a6),d0
lsl.w	#4,d0
add.w	20(a6),d0
move.w	d0,$dff09e

tst.w	(a6)
beq.s	mt_nonewper
move.w	(a6),22(a6)
mt_nonewper:

move.b	2(a6),d0
and.b	#$0f,d0
cmp.b	#14,d0
beq.s	mt_zx1
cmp.b	#15,d0
bne.s	mt_noset

move.w	2(a6),d0
and.l	#$f,d0
move.l	d0,mt_tempo
rts

mt_zx1:
move.w	2(a6),24(a6)
rts
mt_noset:
tst.b	3(a6)
bne.s	mt_noclr
clr.w	24(a6)
mt_noclr:
cmp.b	#3,d0
beq.s	mt_modvol
cmp.b	#6,d0
beq.s	mt_modvol
cmp.b	#9,d0
beq.s	mt_modvol
cmp.b	#4,d0
beq.s	mt_modper
cmp.b	#7,d0
beq.s	mt_modper
cmp.b	#10,d0
beq.s	mt_modper
cmp.b	#5,d0
beq.s	mt_modvolper
cmp.b	#8,d0
beq.s	mt_modvolper
cmp.b	#11,d0
beq.s	mt_modvolper
cmp.b	#12,d0
bne.s	mt_nochnge
move.b	3(a6),8(a5)
mt_nochnge:
rts

mt_modvol:
move.w	20(a6),d0
bra.s	mt_push

mt_modper:
move.w	20(a6),d0
lsl.w	#4,d0
bra.s	mt_push

mt_modvolper:
move.w	20(a6),d0
lsl.w	#4,d0
add.w	20(a6),d0

mt_push:
add.w	#$8000,d0
move.w	d0,$dff09e
rts


mt_aud1temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0001,$0000,$0000
mt_aud2temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0002,$0000,$0000
mt_aud3temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0004,$0000,$0000
mt_aud4temp:
dc.w $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dc.w $0000,$0000,$0008,$0000,$0000
mt_partnote:
dc.l 0
mt_partnrplay:
dc.l 0
mt_counter:
dc.l 0
mt_tempo:
dc.l 6
mt_partpoint:
dc.l 0
mt_samples:
dc.w $0000,$0000
mt_sample1:
dc.l 0
mt_sample2:
dc.l 0
mt_sample3:
dc.l 0
mt_sample4:
dc.l 0
mt_sample5:
dc.l 0
mt_sample6:
dc.l 0
mt_sample7:
dc.l 0
mt_sample8:
dc.l 0
mt_sample9:
dc.l 0
mt_sample10:
dc.l 0
mt_sample11:
dc.l 0
mt_sample12:
dc.l 0
mt_sample13:
dc.l 0
mt_sample14:
dc.l 0
mt_sample15:
dc.l 0
mt_maxpart:
dc.w $0000
mt_kn1:
dc.w $0000
mt_dmacon:
dc.w $0000

mt_modulate:
dc.w $0c39,$0039,$00bf,$ec01,$6630,$0839,$0007,$00bf
dc.w $e001,$6626,$2c79,$0000,$0004,$43fa,$0020,$4eae
dc.w $fe68,$2c40,$4280,$41fa,$0026,$223c,$0000,$0032
dc.w $4eae,$ffa6,$60ee,$0000,$0000,$4e75,$696e,$7475
dc.w $6974,$696f,$6e2e,$6c69,$6272,$6172,$7900,$0104
dc.w $1753,$6f75,$6e64,$5472,$6163,$6b65,$7220,$5632
dc.w $0063,$00f0,$20a9,$2054,$6865,$204a,$756e,$676c
dc.w $6520,$436f,$6d6d,$616e,$6400,$0000

mt_arpeggio:
dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000

; **************
; * 50 lettres *
; **************
; 3 mots bitplan 0 \
; 3 mots bitplan 1  |=> ligne 0
; 3 mots bitplan 2 /

run:
	move.l $4,a6
	jsr -132(a6)
	move #$ffff,d0 ; $16c lignes
	lea $60000,a0
aa:	move.b #0,(a0)+
	dbf d0,aa
	move #$3fff,d0 ; $16c lignes
	lea $70000,a0
ac:	move.b #0,(a0)+
	dbf d0,ac
	move #$3fff,d0 ; $16c lignes
	lea $74000,a0
ae:	move.b #$ff,(a0)+
	dbf d0,ae
	jsr dessine
	move #$8400,$dff096
	move.l #$ffffffff,$dff044
	move #0,$dff042
	move #28,d0
	lea datalettre,a0
	lea scrolt,a1
decat:	move.l a0,$dff050
	move.l a0,$dff054
	move.w (a1)+,d1
	ori #$9f0,d1
	move d1,$dff040
	move #28*18,$dff064
	move #28*18,$dff066
	move #50*$40+9,$dff058
	adda.l #18,a0
	dbf d0,decat

	move #35,d0
	lea dataombre,a0
	lea scrolo,a1
decao:	move.l a0,$dff050
	move.l a0,$dff054
	move (a1)+,d1
	ori #$9f0,d1
	move d1,$dff040
	move #35*6,$dff064
	move #35*6,$dff066
	move #50*$40+3,$dff058
	adda.l #6,a0
	dbf d0,decao

	move.l #0,$dff064
	move.l #$7fffffff,$dff044
	jsr caldamsi
	jsr defilciel
	lea dmon1,a0
	move.l #40*30+$6000e,a1
	move #59,d0
bb01:	move #5,d1
bb02:	move (a0)+,(a1)+
	dbf d1,bb02
	adda.l #40-12,a1
	dbf d0,bb01
	move.l #40*30+$6c00e,a1
	move #59,d0
bb11:	move #5,d1
bb12:	move (a0)+,(a1)+
	dbf d1,bb12
	adda.l #40-12,a1
	dbf d0,bb11
	move.l #40*30+$6400e,a1
	move #59,d0
bb21:	move #5,d1
bb22:	move (a0)+,(a1)+
	dbf d1,bb22
	adda.l #40-12,a1
	dbf d0,bb21
	move.l #40*30+$7000e,a1
	move #59,d0
bb31:	move #5,d1
bb32:	move (a0)+,(a1)+
	dbf d1,bb32
	adda.l #40-12,a1
	dbf d0,bb31
	move.l #40*30+$7400e,a1
	move #59,d0
bb41:	move #5,d1
bb42:	move (a0)+,(a1)+
	dbf d1,bb42
	adda.l #40-12,a1
	dbf d0,bb41

	jmp music

suite:
	jsr cop
boucle0:move.l $dff004,d0
	andi.l #$1ff00,d0
	cmpi.l #$2000,d0
	bne boucle0

;move #$444,$dff180
	cmpi.l #50*30,compt
	blt pasciel
	jsr defilciel
pasciel:
;move #$8,$dff180
	jsr scroldam
;move #$80,$dff180
	tst wlet
	beq cxv
	subq #1,wlet
	bra cxw
cxv:	jsr scroltext
;move #$800,$dff180
	jsr scrolombre
;move #$088,$dff180
	jsr affichelettre
;move #$808,$dff180
	jsr afficheombre
;move #$0,$dff180
cxw:
paslet:
	clr $61c1e
	clr $65c1e
	clr $69c1e
	addq.l #1,compt
tstbsouris:
	btst #6,$bfe001
	beq stbs
	jmp boucle0
stbs:	jmp fincop

wlet: dc.w 0
postext:dc.l 0
post:	blk.l 29,0
poso:	blk.l 36,0
comptscroll:dc.w 0
setom:dc.w 0
posdam:dc.l 0
vdam:dc.l 0
accdam:dc.l $2000
fc:dc.w 0
compt:dc.l 0

caldamsi:
	move #12*64,d4
	lea $78000,a0
	move #63,d3
wn1:	move #25,d2
	move d4,d0
wn2:	move d0,d1
	asr #1,d1
	addi #128,d1
	move.l #$4b00,d5
	divu d1,d5
	addi #$aa-37,d5
	move.b d5,(a0)+
	subi #32,d0
	dbf d2,wn2
	subi #$1,d4
	dbf d3,wn1
	rts

scroldam:
	move posdam,d0
	andi #$3f,d0
	mulu #26,d0
	lea $78000,a0
	adda.l d0,a0
	move posdam,d0
	andi.l #$1fc0,d0
	asr.l #3,d0
	lea fcodam,a1
	suba.l d0,a1
	tst d0
	bne wse
	lea codam,a1
wse:	lea licop,a2
	move (a1)+,foc1
	move (a1)+,foc2
	adda.l #4,a1
	cmpi.l #fcodam,a1
	bne qzd
	lea codam,a1
qzd:	move #11,d0
	clr d1
	clr fc
boscda:	clr d1
	move.b (a0)+,d1
	move.b (a0)+,d7
	cmpi #$90,d1
	bgt phb
	tst fc
	bne phb
	move #$ff,fc
	move.l #$ffdffffe,(a2)+
phb:	move.b d1,(a2)+
	move.b #$01,(a2)+
	move #$ff00,(a2)+
	move #$198,(a2)+
	move (a1)+,(a2)+
	move #$19c,(a2)+
	move (a1)+,(a2)+
	move #$19a,(a2)+
	move (a1)+,(a2)+
	move #$19e,(a2)+
	move (a1)+,(a2)+
	cmpi.l #fcodam,a1
	blt wxv
	lea codam,a1
wxv:	dbf d0,boscda
	move.l vdam,d0
	add.l d0,posdam
	cmpi.l #50*4,compt
	blt azy
	move.l accdam,d0
	add.l d0,vdam
	cmpi #8,vdam
	bne aze
	cmpi.l #50*12,compt
	bgt azt
	neg.l accdam
aze:	cmpi #-8,vdam
	bne azr
	neg.l accdam
azr:	bra azy
azt:	clr.l accdam
azy:
	tst fc
	bne aqw
	move.l #$ffdffffe,(a2)+
aqw:	move.l #$1b01ff00,(a2)+
	move.l #$1900000,(a2)+
	move.l #$1920000,(a2)+
	move.l #$1940000,(a2)+
	move.l #$1980000,(a2)+
	move.l #$19a0000,(a2)+
	move.l #$19b0000,(a2)+
	move.l #$19c0000,(a2)+
	move.l #$19e0000,(a2)+
	move.l #$1080000,(a2)+
	move.l #$1800000,(a2)+
	move.l #$10a0000,(a2)+
	move.l #$fffffffe,(a2)+
	rts

codam:
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $01f,0,$018,0,0,$02f,0,$018
	dc.w $03f,0,$028,0,0,$04f,0,$028
	dc.w $05f,0,$038,0,0,$06f,0,$038
	dc.w $07f,0,$048,0,0,$08f,0,$048
	dc.w $09f,0,$058,0,0,$0af,0,$058
	dc.w $0bf,0,$068,0,0,$0cf,0,$068
	dc.w $0df,0,$078,0,0,$0ef,0,$078
	dc.w $0ff,0,$088,0,0,$0ff,0,$088
	dc.w $0ef,0,$078,0,0,$0df,0,$078
	dc.w $0cf,0,$068,0,0,$0bf,0,$068
	dc.w $0af,0,$058,0,0,$09f,0,$058
	dc.w $08f,0,$048,0,0,$07f,0,$048
	dc.w $06f,0,$038,0,0,$05f,0,$038
	dc.w $04f,0,$028,0,0,$03f,0,$028
	dc.w $02f,0,$018,0,0,$01f,0,$018
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $10f,0,$108,0,0,$20f,0,$108
	dc.w $30f,0,$208,0,0,$40f,0,$208
	dc.w $50f,0,$308,0,0,$60f,0,$308
	dc.w $70f,0,$408,0,0,$80f,0,$408
	dc.w $90f,0,$508,0,0,$a0f,0,$508
	dc.w $b0f,0,$608,0,0,$c0f,0,$608
	dc.w $d0f,0,$708,0,0,$e0f,0,$708
	dc.w $f0f,0,$808,0,0,$f0f,0,$808
	dc.w $e0f,0,$708,0,0,$d0f,0,$708
	dc.w $c0f,0,$608,0,0,$c0f,0,$608
	dc.w $a0f,0,$508,0,0,$90f,0,$508
	dc.w $80f,0,$408,0,0,$70f,0,$408
	dc.w $60f,0,$308,0,0,$50f,0,$308
	dc.w $40f,0,$208,0,0,$30f,0,$208
	dc.w $20f,0,$108,0,0,$10f,0,$108
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $11e,0,$008,0,0,$22d,0,$117
	dc.w $33c,0,$117,0,0,$44b,0,$226
	dc.w $55a,0,$226,0,0,$669,0,$335
	dc.w $778,0,$335,0,0,$887,0,$444
	dc.w $996,0,$444,0,0,$aa5,0,$553
	dc.w $bb4,0,$553,0,0,$cc3,0,$662
	dc.w $dd2,0,$662,0,0,$ee1,0,$771
	dc.w $ff0,0,$771,0,0,$ff0,0,$880
	dc.w $ee1,0,$771,0,0,$dd2,0,$771
	dc.w $cc3,0,$662,0,0,$bb4,0,$662
	dc.w $aa5,0,$553,0,0,$996,0,$553
	dc.w $887,0,$444,0,0,$778,0,$444
	dc.w $669,0,$335,0,0,$55a,0,$335
	dc.w $44b,0,$226,0,0,$33c,0,$226
	dc.w $22d,0,$117,0,0,$11e,0,$117
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
	dc.w $00f,0,$008,0,0,$00f,0,$008
fcodam:

afficheombre:
	move setom,d0
	bne afomb
	rts
afomb:	clr setom
	lea codelettre,a0
	adda.l d3,a0
	clr.l d2
	move.b (a0),d2
	mulu #36*6,d2
	lea dataombre,a0
	adda.l d2,a0
	move #35,d0
	move.l #$6e0e0,a1
bafl:	move (a0)+,d1
	or d1,(a1)+
	move (a0)+,d1
	or d1,(a1)+
	move (a0)+,d1
	or d1,(a1)+
	adda.l #50,a1
	cmpi #28,d0
	bne nad1
	adda.l #2,a1
nad1:	cmpi #20,d0
	bne nad2
	adda.l #2,a1
nad2:	cmpi #11,d0
	bne nad3
	adda.l #2,a1
nad3:	cmpi #3,d0
	bne nad4
	adda.l #2,a1
nad4:	dbf d0,bafl
	rts

affichelettre:
	addq #1,comptscroll
	cmpi #11,comptscroll
	beq afll
	rts
afll:	move #$ff,setom
	clr comptscroll
let:	lea text,a0	
	clr.l d0
	adda.l postext,a0 
	addq.l #1,postext
	move.b (a0),d0
	cmpi.b #$ff,d0
	bne nonre
	clr.l postext
	jmp let
nonre:	cmpi.b #$fe,d0
	bne nonrf
	move #4*50,wlet
	jmp let
nonrf:	lea codelettre,a0
	move.l d0,d3
	adda.l d3,a0
	clr d2
	move.b (a0),d2
	mulu #29*18,d2
	lea datalettre,a0
	adda.l d2,a0
	move #28,d0
	move.l #$61c48,a1
	move.l #$65c48,a2
	move.l #$69c48,a3
baffl:	move (a0)+,d1
	or d1,(a1)+
	move (a0)+,d1
	or d1,(a1)+
	move (a0)+,d1
	or d1,(a1)+
	move (a0)+,d1
	or d1,(a2)+
	move (a0)+,d1
	or d1,(a2)+
	move (a0)+,d1
	or d1,(a2)+
	move (a0)+,d1
	or d1,(a3)+
	move (a0)+,d1
	or d1,(a3)+
	move (a0)+,d1
	or d1,(a3)+
	adda.l #50,a1
	adda.l #50,a2
	adda.l #50,a3
	cmpi #22,d0
	bne noad1
	adda.l #2,a1
	adda.l #2,a2
	adda.l #2,a3
noad1:	cmpi #15,d0
	bne noad2
	adda.l #2,a1
	adda.l #2,a2
	adda.l #2,a3
noad2:	cmpi #8,d0
	bne noad3
	adda.l #2,a1
	adda.l #2,a2
	adda.l #2,a3
noad3:	cmpi #2,d0
	bne noad4
	adda.l #2,a1
	adda.l #2,a2
	adda.l #2,a3
noad4:	dbf d0,baffl
	rts

scrolombre:
	lea poso,a0
	lea vscrol2,a1
	move.l #$6e0b6,a2
	move #35,d0
an1:	move.l #0,d1
	move (a1)+,d1
	add.l d1,(a0)
	add.l d1,(a0)
	add.l d1,(a0)
	move.l (a0),d1
	clr (a0)
	adda.l #4,a0
	clr d1
	asr.l #4,d1
	tst d1
	beq passco
	move.l a2,a3
	adda.l #2,a3
	eor #$f000,d1
	add #$1000,d1
	or #$9f0,d1
	move.l a2,a4
	move.l a4,$dff054
	move.l a3,$dff050	
	move d1,$dff040
	move #$5b,$dff058
passco:	adda.l #56,a2
	dbf d0,an1
	rts

scroltext:
	lea post,a0
	lea vscrol1,a1
	move.l #$61c1e,a2
	move #28,d0
an0:	move.l #0,d1
	move (a1)+,d1
	add.l d1,(a0)
	add.l d1,(a0)
	add.l d1,(a0)
	move.l (a0),d1
	clr (a0)
	adda.l #4,a0
	clr d1
	asr.l #4,d1
	tst d1
	beq passc
	move.l a2,a3
	adda.l #2,a3
	eor #$f000,d1
	add #$1000,d1
	or #$9f0,d1
	move.l a2,a4
	move.l a4,$dff054
	move.l a3,$dff050	
	move d1,$dff040
	move #$5b,$dff058
	adda.l #$4000,a4
	adda.l #$4000,a3
	move.l a4,$dff054
	move.l a3,$dff050	
	move d1,$dff040
	move #$5b,$dff058
	adda.l #$4000,a4
	adda.l #$4000,a3
	move.l a4,$dff054
	move.l a3,$dff050	
	move d1,$dff040
	move #$5b,$dff058
passc:	adda.l #56,a2
	dbf d0,an0
	rts

defilciel:
	addi.l #2,ncoci
	cmpi.l #endcoci,ncoci
	bne nfici
	move.l #tabcoci,ncoci
nfici:	move.l ncoci,a0
	lea ciel,a1
	move #25,d0
bociel:	move (a0)+,(a1)
	adda.l #8,a1
	cmpi.l #endcoci,a0
	bne nfic
	move.l #tabcoci,a0
nfic:	dbf d0,bociel
	rts

vscrol1: ; vitesse de chaque ligne du texte (29 l.)
	dc.w $b851,$bae1,$bd70,$c000,$c28f,$c51e,$c7ae,$ca3d
	dc.w $cccc,$cf5c,$d1eb,$d47a,$d70a,$d999,$dc28,$deb8
	dc.w $e147,$e3d7,$e666,$e8f5,$eb85,$ee14,$f0a3,$f333
	dc.w $f5c2,$f851,$fae1,$fd70,$ffff

vscrol2: ; vitesse de chaque ligne de l'ombre (36 l.)
	dc.w $b851,$ba5e,$bc6a,$be76,$c083,$c28f,$c49b,$c6a7
	dc.w $c8b4,$cac0,$cccc,$ced9,$d0e5,$d2f1,$d4fd,$d70a
	dc.w $d916,$db22,$dd2f,$df3b,$e147,$e353,$e560,$e76c
	dc.w $e978,$eb85,$ed91,$ef9d,$f1a9,$f3b6,$f5c2,$f7ce
	dc.w $f9db,$fbe7,$fdf3,$ffff

scrolt:
	dc.w $0000,$1000,$4000,$6000,$9000,$b000,$d000,$0000
	dc.w $2000,$5000,$7000,$a000,$c000,$e000,$1000,$3000
	dc.w $6000,$8000,$a000,$d000,$f000,$2000,$4000,$6000
	dc.w $9000,$b000,$e000,$0000,$3000
scrolo:
	dc.w $0000,$2000,$4000,$6000,$8000,$a000,$c000,$e000
	dc.w $0000,$2000,$4000,$6000,$8000,$a000,$c000,$e000,$0000
	dc.w $2000,$3000,$5000,$7000,$9000,$b000,$d000,$f000
	dc.w $1000,$3000,$5000,$7000,$9000,$b000,$d000,$f000
	dc.w $1000,$3000,$5000,$6000,$8000

text:
	dc.b '       SALUT VINCENT , BONJOUR A TOUS LES MEMBRES DE'
	dc.b '  C.B.C  . ',$fe
	dc.b 'AUSSITOT DIT ........ AUSSITOT FAIT : VOICI LE NOUVEAU '
	dc.b 'LOGO !'
	dc.b '   BRAVO IL EST SUPERBE !!.  POUVEZ VOUS '
	dc.b 'LAISSEZ LE TEXTE QUI NaAPPAIRAITRA PAS A LaECRAN S.V.P.'
	dc.b ' ET POUVEZ VOUS MENTIONNER MON PSEUDO :  FREDDY .  ',$FE
	dc.b 'TOUTES LES INDICATIONS SONT SUR LA LETTRE . '
	dc.b 'VOICI MON NUMERO DE TELEPHONE: 30.64.69.10 ',$FE
	dc.b '   ENCORE MERCI ET A BIENTOT CAR JaAI UN TAS DaIDEES !!'
	DC.B '     FREDDY .......         ',$ff
	even

codelettre:
	dc.l 0,0,0,0,0,0,0,0
	dc.b 0,38
	dc.b 0,0,0,0,0,0,44,45,0,0,43,0,37,39,36
	dc.b 27,28,29,30,31,32,33,34,35,41,0,0,0,0,40,0
	dc.b 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
	dc.b 17,18,19,20,21,22,23,24,25,26,0,0,0,0,0,0,42
even
datalettre:
	blk.w 3*3*29*50,$5500
dataombre:
	blk.w 3*36*50,$5500


dtail:dc.l 0
dproch:dc.l 0
dcarre:dc.w 0
dabsc:dc.w 0
dessine:
	lea 233*40+$70778,a0
	move.l #$450000,dtail
	move #96+16,d0
dbfr:	move.l #$a00000,dproch
	move #0,dcarre
	move.l dtail,d1
drec:	bchg #0,dcarre
	sub.l d1,dproch
	bpl drec
	move dproch,dabsc
	add.l d1,dproch
dbou1:	tst dcarre
	bne dnon
	tst dabsc
	bmi dnon
	jsr dpoint
dnon:	addq #1,dabsc
	cmpi #320,dabsc
	bge dsu1
	move dproch,d2
	cmp dabsc,d2
	bgt dbou1
	bchg #0,dcarre
	add.l d1,dproch
	jmp dbou1
dsu1:	subi.l #56,a0
	subi.l #$8000,dtail
	dbf d0,dbfr
	rts

dpoint:
	clr.l d3
	move dabsc,d3
	move.l a0,a1
	asr.l #3,d3
	andi.l #$fffffffe,d3
	adda.l d3,a1
	move dabsc,d3
	andi #$f,d3
	move.l #$8000,d4
	asr.l d3,d4
	or (a1),d4
	move d4,(a1)
	rts

execbase=4
openlib=-408
cop:	move.l execbase,a6
	lea grname,a1
	jsr openlib(a6)
	move.l d0,a5
	adda.l #50,a5
	move.l a5,adadcop
	move.l (a5),adcop
	move.l #moncop,(a5)
	move #$20,$dff096
	rts
fincop:	move.l adadcop,a5
	move.l adcop,(a5)
	move #$8020,$dff096
	rts

grname:	dc.b 'graphics.library'
even
adadcop:dc.l 0
adcop:	dc.l 0
moncop:	dc.w $008e,$2e81
	dc.w $0090,$33c1
	dc.w $0092,$0034
	dc.w $0094,$00cc
	dc.w $0100,%0101001000000000
	dc.w $00e0,$0006
	dc.w $00e2,$0000
	dc.w $00e4,$0006
	dc.w $00e6,$c000
	dc.w $00e8,$0006
	dc.w $00ea,$4000
	dc.w $00ec,$0007
	dc.w $00ee,$0000
	dc.w $00f0,$0007
	dc.w $00f2,$4000
	dc.w $0102,$0000
	dc.w $0104,$0000

	dc.w $0180,$000
	dc.w $0182,$0ffd
	dc.w $0184,$0dda
	dc.w $0186,$aa6
	dc.w $0188,$222
	dc.w $018a,$444
	dc.w $018c,$555
	dc.w $018e,$666
	dc.w $0190,$777
	dc.w $0192,$888
	dc.w $0194,$999
	dc.w $0196,$aaa
	dc.w $0198,$ccc
	dc.w $019a,$ddd ; ombre sur le vide du damier
	dc.w $019c,$eee ; couleur damier
	dc.w $019e,$fff ; ombre sur le damier
	dc.w $01a0,$000
	dc.w $01a2,$fca
	dc.w $01a4,$0dda
	dc.w $01a6,$aa6
	dc.w $01a8,$f00
	dc.w $01aa,$0f
	dc.w $01ac,$e44
	dc.w $01ae,$08
	dc.w $01b0,$ec0
	dc.w $01b2,$da0
	dc.w $01b4,$b80
	dc.w $01b6,$a70
	dc.w $01b8,$960
	dc.w $01ba,$850 ; ombre sur le vide du damier
	dc.w $01bc,$740 ; couleur damier
	dc.w $01be,$620 ; ombre sur le damier

	dc.w $1d03,$fffe
	dc.w $01a0
ciel:	dc.w $100
	dc.w $3003,$fffe
	dc.w $01a0,$200
	dc.w $4003,$fffe
	dc.w $01a0,$300
	dc.w $4d03,$fffe
	dc.w $01a0,$400
	dc.w $5903,$fffe
	dc.w $01a0,$500
	dc.w $6203,$fffe
	dc.w $01a0,$600
	dc.w $6a03,$fffe
	dc.w $01a0,$700
	dc.w $7103,$fffe
	dc.w $01a0,$800
	dc.w $7703,$fffe
	dc.w $01a0,$900
	dc.w $7d03,$fffe
	dc.w $01a0,$a00
	dc.w $8203,$fffe
	dc.w $01a0,$b00
	dc.w $8603,$fffe
	dc.w $01a0,$c00
	dc.w $8a03,$fffe
	dc.w $01a0,$d20
	dc.w $8e03,$fffe
	dc.w $01a0,$e30
	dc.w $9103,$fffe
	dc.w $01a0,$f40
	dc.w $9403,$fffe
	dc.w $01a0,$f50
	dc.w $9703,$fffe
	dc.w $01a0,$f60
	dc.w $9a03,$fffe
	dc.w $01a0,$f70
	dc.w $9c03,$fffe
	dc.w $01a0,$f80
	dc.w $9e03,$fffe
	dc.w $01a0,$f90
	dc.w $a003,$fffe
	dc.w $01a0,$fa0
	dc.w $a203,$fffe
	dc.w $01a0,$eb0
	dc.w $a403,$fffe
	dc.w $01a0,$dc0
	dc.w $a603,$fffe
	dc.w $01a0,$dd0
	dc.w $a803,$fffe
	dc.w $01a0,$ee0
	dc.w $a903,$fffe
	dc.w $01a0,$ff0

	dc.w $0100,%0110011000000000
	dc.w $00f0,$0006
	dc.w $00f2,$9338
	dc.w $00f4,$0007
	dc.w $00f6,$5338
	dc.w $0190,$0
	dc.w $0192,$0
	dc.w $0194,$0
	dc.w $0196,$0
	dc.w $0198,$0
	dc.w $0180,$000
	dc.w $0182,$0ffd
	dc.w $0184,$0dda
	dc.w $0186,$aa6
	dc.w $0188,$f00
	dc.w $018a,$0f
	dc.w $018c,$e44
	dc.w $018e,$08
	dc.w $019a,$222 ; ombre sur le vide du damier
	dc.w $019c,$e0e ; couleur damier
	dc.w $019e,$505 ; ombre sur le damier

	dc.w $aa01,$ff00
	dc.w $0108,$0010
	dc.w $0188,$0662
	dc.w $018c,$0c
	dc.w $0198
foc1:	dc.w $0000
	dc.w $019c
foc2:	dc.w $0000
	dc.w $010a,$0010

licop:	dc.w $ab01,$fffe
	dc.w $019c,$00f
	dc.w $0198,$0000
	dc.w $ac01,$fffe
	dc.w $0198,$00e
	dc.w $019c,$0000
	dc.w $ad01,$fffe
	dc.w $019c,$00f
	dc.w $0198,$0000
	dc.w $ae01,$fffe
	dc.w $0198,$00e
	dc.w $019c,$0000
	dc.w $b001,$fffe
	dc.w $019c,$00f
	dc.w $0198,$0000
	dc.w $b101,$fffe
	dc.w $0198,$00e
	dc.w $019c,$0000
	dc.w $b301,$fffe
	dc.w $019c,$00f
	dc.w $0198,$0000
	dc.w $b501,$fffe
	dc.w $0198,$00e
	dc.w $019c,$0000
	dc.w $b701,$fffe
	dc.w $019c,$00f
	dc.w $0198,$0000
	dc.w $b901,$fffe
	dc.w $0198,$00e
	dc.w $019c,$0000
	dc.w $bb01,$fffe
	dc.w $019c,$00f
	dc.w $0198,$0000
	dc.w $be01,$fffe
	dc.w $0198,$00e
	dc.w $019c,$0000
	dc.w $c101,$fffe
	dc.w $019c,$00f
	dc.w $0198,$0000
	dc.w $c401,$fffe
	dc.w $0198,$00e
	dc.w $019c,$0000
	dc.w $c801,$fffe
	dc.w $019c,$00d
	dc.w $0198,$0000
	dc.w $cb01,$fffe
	dc.w $0198,$00c
	dc.w $019c,$0000
	dc.w $d001,$fffe
	dc.w $019c,$00b
	dc.w $0198,$0000
	dc.w $d501,$fffe
	dc.w $0198,$00a
	dc.w $019c,$0000
	dc.w $db01,$fffe
	dc.w $019c,$009
	dc.w $0198,$0000
	dc.w $e101,$fffe
	dc.w $0198,$008
	dc.w $019c,$0000
	dc.w $e901,$fffe
	dc.w $019c,$007
	dc.w $0198,$0000
	dc.w $f201,$fffe
	dc.w $0198,$006
	dc.w $019a,$003
	dc.w $019e,$000
	dc.w $019c,$0000
	dc.w $fd01,$fffe
	dc.w $019c,$005
	dc.w $019e,$003
	dc.w $019a,$000
	dc.w $0198,$0000




	dc.w $ffdf,$fffe
	dc.w $a01,$fffe
	dc.w $019a,$005
	dc.w $0198,$003
	dc.w $019c,$000
	dc.w $019e,$0000
	dc.w $1b01,$fffe
	dc.w $019a,$000
	dc.w $0198,$000
	dc.w $019c,$000
	dc.w $019e,$0000
	dc.w $0108,$000
	dc.w $0180,$0000
	dc.w $010a,$000
	dc.w $fffe,$ffff
blk.l 112

ncoci:	dc.l dtabci

dtabci:	dc.w $100,$200,$300,$400,$500,$600,$700,$800
	dc.w $900,$a00

tabcoci:
	dc.w $b00,$c00,$d00,$d10,$e10,$e20,$f20,$f30,$f40
	dc.w $f50,$f60,$f70,$f80,$f90,$fa0,$fb0,$fc0,$fd0,$fe0,$ff0
	dc.w $ff1,$ff2,$ff3,$ff4,$ff5,$ff6,$ff7,$ff8,$ff9,$ffa,$ffb
	dc.w $ffc,$ffd,$ffe,$fff,$ffd,$ffc,$ffa,$ff8,$ff6,$ff4,$ff2
	dc.w $ff0,$fd0,$fc0,$fa0,$f80,$f60,$f40,$f20,$e20,$e00,$c00
	dc.w $c01,$b02,$802,$803,$804,$804,$805
	dc.w $905,$906,$a06,$a07,$b07,$b08,$c08,$c09,$d09,$d0a,$e0a
	dc.w $e0b,$f0b,$f0c,$f0d,$f0e,$f0f,$f1f,$f2f,$f3f,$f4f,$f5f
	dc.w $f6f,$f7f,$f8f,$f9f,$faf,$fbf,$fcf,$fdf,$fef,$fff,$fff
	dc.w $efe,$dfd,$cfc,$bfb,$afa,$9f9,$8f8,$7f7,$6f6,$5f5,$4f4
	dc.w $3f3,$2f2,$1f1,$0f0,$e1,$d2,$c3,$b4,$a5,$96,$87,$78,$69
	dc.w $5a,$4b,$3c,$2d,$1e,$f,$11f,$22f,$33f,$44f,$55f,$66f
	dc.w $77f,$88f,$99f,$aaf,$bbf,$ccf,$ddf,$eef,$fff
	dc.w $ddd,$bbb,$aaa,$888,$766,$655,$744,$833
	dc.w $922,$a11
endcoci:

dmon1:
	blk.w 6*60*5

mt_sampleinfo:	blk.b	6744,0
s1:		blk.b   $19c8,0
s2:		blk.b	$1194,0
s3:		blk.b	$bb8,0
s4:		blk.b	$fa0,0
s5:		blk.b	$7d0,0
s6:		blk.b	$26ac,0
s7:		blk.b	$2134,0
s8:		blk.b	0,0
s9:		blk.b	0,0
sa:		blk.b	0,0
sb:		blk.b	0,0
sc:		blk.b	0,0
sd:		blk.b	0,0
se:		blk.b	0,0
sf:		blk.b	0,0
