* Coder V0.8, by TIP of TNM in 1988
*
* Recoded Bootblock routine V1.0

* EXEC
start:
p:
	movem.l	d0-d7/a0-a6,-(sp)

	lea	$dff000,a4
	move.l	4.w,a6

	move.w	$1c(a4),-(sp)		;Interrupts verbieten
	move.w	#$7fff,$9a(a4)

	lea	GraphicsName(pc),a1
	jsr	-408(a6)
	move.l	d0,a6

	lea	TextAttribute(pc),a0
	lea	Font(pc),a1
	move.l	a1,(a0)
	jsr	-72(a6)			;Open Font
	move.l	d0,a0
	move.l	34(a0),a2

	lea	$50000,a3		;Memory Clearen
	move.w	#$1000,d0
CMem:	clr.l	(a3)+
	dbf	d0,CMem

	lea	Gelaber(pc),a0

	lea	$50000,a3		;Text in Grafik Printen
	moveq	#Gelaber2-Gelaber-1,d0
	bsr.L	PrintText
	lea	$50180,a3
	moveq	#Gelaber2End-Gelaber2-1,d0
	bsr.L	PrintText

	lea	NewCopperSabbel(pc),a0
	move.l	a0,$80(a4)		;Neue Copperliste setzen
	clr.w	$88(a4)
	move.w	#$8100,$96(a4)

	moveq	#14,d1
Dunkel:
	bsr.s	WaitTop
	sub.w	#$111,6(a0)
	sub.w	#$10,10(a0)
	dbf	d1,Dunkel

	move.l	#$60000,d0		;Auf Maus warten oder weiter
WartFick:
	btst	#6,$bfe001
	beq.s	Endi
	subq.l	#1,d0
	bne.s	WartFick
Endi:
	moveq	#14,d1
Hell:
	bsr.s	WaitTop
	add.w	#$111,6(a0)
	add.w	#$10,10(a0)
	dbf	d1,Hell

	move.w	#$100,$96(a4)
	move.l	38(a6),$80(a4)		;Copperliste ausschalten
	clr.w	$88(a4)

	move.l	a6,a1			;Graphicslib schliessen
	move.l	4.w,a6
	jsr	-414(a6)

	move.w	(a7)+,d0		;Interrupts erlauben
	bset	#15,d0
	move.w	d0,$9a(a4)

	movem.l	(a7)+,a0-a6/d0-d7	;Alles zurueckholen

	lea	DosName(pc),a1		;Normale Dos-Routine
	jsr	-96(a6)
	move.l	d0,a0
	move.l	22(a0),a0
	clr.l	d0
	rts

WaitTop:
	moveq	#2,d2
WT_1:
	move.l	4(a4),d0
	lsr.l	#8,d0
	cmp.b	#1,d0
	bne.s	WT_1
WT_2:
	cmp.b	#2,6(a4)
	bne.s	WT_2
	dbf	d2,WT_1
	rts

NewCopperSabbel:
	dc.l	$01000000
	dc.l	$01800fff
	dc.l	$01820fff
	dc.l	$00e00005
	dc.l	$00e20000
	dc.l	$00920070
	dc.l	$009400a8
	dc.l	$8007fffe
	dc.l	$01001000
	dc.l	$c807fffe
	dc.l	$01000000
	dc.l	$fffffffe

TextAttribute:
	dc.l	0
	dc.w	8
	dc.b	0,0
PrintText:
	clr.l	d1
	move.b	(a0)+,d1
	sub.b	#32,d1
	add.l	a2,d1
	move.l	d1,a1
	moveq	#7,d2
PT_Luuple:
	move.b	(a1),(a3)
	move.b	(a1),16(a3)
	add.l	#32,a3
	add.l	#$c0,a1
	dbf	d2,PT_Luuple
	sub.l	#255,a3
	dbf	d0,PrintText
	rts

DosName:	dc.b	'dos.library',0
GraphicsName:	dc.b	'graphics.library',0
Gelaber:	dc.b	'DISK DECODED BY'
Gelaber2:	dc.b	'THE NEW MASTERS'
Gelaber2End:
Font:		dc.b	'topaz.font',0
End:
