jmp	run

;	(c) 1987 AMY PRODUCTIONS
;	Fruithoflaan 105 bus 42,
;	B-2600 Berchem,
;	Belgium.

linecol=	$fd3

AbsExecBase=	$04	; the only absolute address used !
DMACON=		$dff096

;----	exec.library
OpenLibrary=	-408
CloseLibrary=	-414

Forbid=		-132
Permit=		-138

;----	graphics.library
InitBitMap=	-390
InitRastPort=	-198
ClearScreen=	-48

ScrollRaster=	-396
Move=		-240
Text=		-60

;----
run:

movem.l	a0-a6/d0-d7,-(a7)

move.l	AbsExecBase,a6
lea	gfxname,a1
jsr	OpenLibrary(a6)
move.l	d0,gfxbase

move.w #$0020,DMACON	; disable Sprite DMA

move.l	gfxbase,a6
lea	bitmap,a0
move.l	#$01,d0			; depth
move.l	#336,d1			; width
move.l	#200,d2			; height
jsr	InitBitMap(a6)
move.l	#$50000,plane1
lea	rastport,a1
jsr	InitRastPort(a6)
move.l	#bitmap,r_bitmap
lea	rastport,a1
jsr	ClearScreen(a6)
move.l	#scrolltext,ptr
move.l	#coltabel,colptr

move.l	AbsExecBase,a6
jsr	Forbid(a6)

move.l	gfxbase,a0
move.l	$32(a0),oldclist	; pointer to LOFlist in GfxBase
move.l	#newclist,$32(a0)

move.l	$6c,oldirq+2
move.l	#newirq,$6c

;----
wait:

btst	#6,$bfe001
bne.s	wait

move.w #$8020,DMACON

move.l	gfxbase,a0
move.l	oldclist,$32(a0)

move.l	oldirq+2,$6c

move.l	AbsExecBase,a6
jsr	Permit(a6)

move.l	AbsExecBase,a6
move.l	gfxbase,a1
jsr	CloseLibrary(a6)


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

rts	; ----- END END END -----

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

add.w	#1,teller
cmp.w	#10,teller
bne	cont1
move.w	#0,teller

lea 	waitab,a0
move.l	#1,d0
move.w	#$3009,d1
waitablp:
move.w	d1,(a0)+
move.w	#$fffe,(a0)+
move.w	#$0182,(a0)+
move.l	colptr,a1
move.w	(a1),(a0)+
add.w	#$0200,d1
addq.l	#$02,colptr
dbra	d0,waitablp

cmp.l	#coltabelend,colptr
blt	cont1
move.l	#coltabel,colptr

cont1:

move.l	gfxbase,a6
lea	rastport,a1
move.l	#$02,d0
clr.l	d1
clr.l	d2
move.l	#45,d3
move.l	#336,d4
move.l	#193,d5
jsr	ScrollRaster(a6)

sub.b	#$02,rows
bne	exit
move.b	#$08,rows

move.l #4,d6
move.l #185,ypos

scrolllines:

lea	rastport,a1
move.l	#320,d0
move.l  ypos,d1
sub.l	#30,ypos
jsr	Move(a6)

lea	rastport,a1
move.l	ptr,a0
move.l	#$01,d0
jsr	Text(a6)

dbra	d6,scrolllines

addq.l	#$01,ptr
cmp.l	#end,ptr
blt.s	exit
move.l	#scrolltext,ptr

exit:

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

newclist:
dc.w	$008e,$2c81,$0090,$f4c1,$0092,$0038,$0094,$00d0
dc.w	$0102,$0000,$0108,$0002
dc.w	$0100,$1200,$0180,$0000

waitab:
dc.w	$3001,$fffe,$0180,$000	;initial values !
dc.w	$3101,$fffe,$0180,$000
dc.w	$3201,$fffe,$0180,$000

dc.w	$00e0,$0005,$00e2,$000
dc.w	$6301,$fffe,$0180,linecol
dc.w	$6501,$fffe,$0180,$860
dc.w	$7b01,$fffe,$0180,linecol
dc.w	$7d01,$fffe,$0180,$000
dc.w	$8101,$fffe,$0180,linecol
dc.w	$8301,$fffe,$0180,$a81
dc.w	$9901,$fffe,$0180,linecol
dc.w	$9b01,$fffe,$0180,$000
dc.w	$9f01,$fffe,$0180,linecol
dc.w	$a101,$fffe,$0180,$ca1
dc.w	$b701,$fffe,$0180,linecol
dc.w	$b901,$fffe,$0180,$000
dc.w	$bc01,$fffe,$0180,linecol
dc.w	$be01,$fffe,$0180,$a81
dc.w	$d501,$fffe,$0180,linecol
dc.w	$d701,$fffe,$0180,$000
dc.w	$da01,$fffe,$0180,linecol
dc.w	$dc01,$fffe,$0180,$860
dc.w	$f401,$fffe,$0180,linecol
dc.w	$f601,$fffe,$0180,$000

dc.w	$ffff,$fffe
scrolltext:
dc.b	"THIS IS ANOTHER LITTLE MC68000 ASSEMBLER HACK BY AMY "
dc.b    "PRODUCTIONS (C) 1987 ! IT'S CALLED 'BERTS DREAM' ... "
DC.B    " IF YOU COULD ONLY SEE THAT BIG SMILE "
DC.B	"ON MY FACE WRIGHT NOW ... ANY QUESTIONS BERT ??? WELL MAYBE "
DC.B	"ERIC RAAM WILL START PROGRAMMIMG THE AMIGA ONE DAY AND THEN "
DC.B	"BERTY'S PROGRAMMING PROBLEMS WILL DISAPPEAR AUTOMAGICALLY !"
DC.B	" REMEMBER THE "
DC.B	"GOOD OLD 64 DAYS BERTY ? .............. IN CASE ALL OF THIS "
DC.B	"ISN'T VERY IMPRESSING THEN PREPARE YOURSELF FOR THE "
DC.B	"100% BLITTER DRIVEN SCROLL-ROUTINE I'M WORKING ON WRIGHT "
DC.B	"NOW ! BY THE WAY : THIS PROGGY USES ONLY ONE ABSOLUTE "
DC.B	"ADDRESS !  AMAZING STUFF FOR SOME, ANCIENT HISTORY FOR "
DC.B	"OTHERS ! LIKE ALL GOOD THINGS THIS SCROLL MUST COME TO AN "
DC.B	"END AND THIS IS IT !                                    " 
end:
even
coltabel:
dc.w	$0f01,$0f02,$0f03,$0f04,$0f05,$0f06,$0f07,$0f08
;dc.w	$0888,$0999,$0aaa,$0bbb,$0ccc,$0bbb
;dc.w	$0aaa,$0999,$0888,$0777,
dc.w	$0f60,$0f50,$0f40,$0f30,$0f20,$0f10
coltabelend:
even
ptr:
dc.l	0
colptr:
dc.l	0
teller:
dc.w	0
oldclist:
dc.l	0
gfxbase:
dc.l	0
gfxname:
dc.b	"graphics.library",0
even
bitmap:
blk.w	4,0
plane1:
blk.l	20,0
rastport:
dc.l	0
r_bitmap:
blk.l	1,0
blk.b	96,0
ypos:
blk.l	1,0
rows:
dc.b	$02
