LOAD	equ	$4000

SCNBASE	equ	$0400
SCNLEN	equ	$0200

	org	LOAD
START	lda	#$ff	Setup DP register
	tfr	a,dp
	setdp	$ff

* Disable IRQ and FIRQ
	orcc	#$50		Disable interrupts

	ldb     $ff01		Disable hsync interrupt generation
	andb	#$fa
	stb     $ff01
	tst	$ff00

	lda     $ff03		Enable vsync interrupt generation
	ora     #$05
	sta     $ff03
	tst	$ff02

	jsr	CLRSCN

LOOP	ldx	#SCNBASE
	ldy	#FRAME1
	jsr	WRITELN

	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync

	ldx	#SCNBASE
	ldy	#FRAME2
	jsr	WRITELN

	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync

	ldx	#SCNBASE
	ldy	#FRAME3
	jsr	WRITELN

	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync

	ldx	#SCNBASE
	ldy	#FRAME4
	jsr	WRITELN

	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync

	ldx	#SCNBASE
	ldy	#FRAME5
	jsr	WRITELN

	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync
	tst	$ff02
	sync

	jmp	LOOP

* Clear the screen
CLRSCN	ldx	#SCNBASE
	ldd	#SCNLEN
	pshs	d
	lda	#$60
CLSLOOP	sta	,x+
	dec	1,s
	bne	CLSLOOP
	dec	,s
	bne	CLSLOOP
	leas	2,s

	rts

WRITELN	lda	,y+
	beq	WRLNEXT
	cmpa	#$0d
	beq	WRLNLF
	ora	#$40
	sta	,x+
	bra	WRITELN

WRLNLF	exg	x,d
	andb	#$e0
	exg	d,x
	leax	$20,x
	bra	WRITELN
	
WRLNEXT	rts

FRAME1	fcb	$20,$20,$20,$20,$20,$20,$20,$20,$69,$3B,$69,$27,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$27,$4D,$4D,$4D,$4D,$27,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$2E,$4D,$4D,$23,$3B,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$27,$23,$4D,$4D,$49,$27,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$20,$4F,$49,$4D,$4D,$4F,$49,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$60,$49,$4F,$49,$4D,$49,$4D,$27,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$3B,$4D,$3B,$23,$49,$4D,$49,$4F,$27,$60,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$4D,$4F,$4F,$4D,$4D,$4D,$23,$27,$27,$4F,$23,$27,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$4F,$49,$27,$49,$4D,$4D,$4D,$49,$4F,$20,$20,$20,$60,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$27,$27,$3B,$4D,$4D,$4D,$4F,$4D,$4D,$69,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$4D,$4D,$4D,$27,$69,$49,$4D,$49,$27,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$27,$4F,$4D,$4D,$27,$20,$20,$60,$49,$4D,$4F,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$60,$4F,$4D,$49,$69,$20,$60,$20,$20,$20,$4F,$4D,$4D,$20,$20,$20,$20,$20,$0D
	fcb	$20,$60,$49,$4F,$3B,$60,$20,$20,$20,$20,$20,$20,$27,$4D,$4D,$69,$20,$20,$20,$20,$0D
	fcb	$4F,$49,$4F,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$2E,$4D,$49,$60,$20,$20,$20,$0D
	fcb	$27,$4F,$49,$27,$27,$60,$20,$20,$20,$20,$20,$20,$20,$60,$4F,$4D,$49,$4F,$27,$60,0


FRAME2	fcb	$20,$20,$20,$20,$20,$20,$20,$20,$4F,$4F,$4F,$3B,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$60,$4D,$4D,$4D,$4D,$3B,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$20,$23,$4D,$4D,$3B,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$4F,$4D,$4D,$4D,$4F,$2E,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$60,$49,$4D,$4D,$4D,$4D,$4F,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$4F,$4D,$4D,$49,$4D,$49,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$27,$49,$23,$49,$4D,$49,$4F,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$27,$4F,$4D,$4D,$49,$4D,$49,$69,$27,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$4F,$3B,$4D,$4D,$4D,$49,$4D,$4F,$4F,$20,$60,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$60,$3B,$60,$27,$4D,$4D,$4D,$49,$27,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$20,$60,$49,$4D,$4D,$4F,$4F,$60,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$69,$4F,$4D,$4D,$23,$49,$4D,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$3B,$4D,$49,$23,$27,$60,$4F,$4D,$49,$60,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$27,$4F,$49,$4F,$27,$60,$20,$20,$20,$27,$4D,$4D,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$27,$49,$23,$20,$20,$20,$20,$20,$20,$20,$4F,$49,$27,$20,$20,$20,$20,$20,$0D
	fcb	$2E,$60,$27,$27,$3B,$60,$20,$60,$2E,$60,$27,$60,$4F,$4D,$4D,$4F,$3B,$27,$20,$20,0


FRAME3	fcb	$20,$20,$20,$20,$20,$20,$20,$3B,$4D,$4D,$4D,$27,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$4F,$4D,$4D,$4D,$4F,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$60,$49,$4D,$49,$69,$20,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$4F,$4D,$4D,$4D,$49,$27,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$20,$69,$49,$4D,$49,$4D,$4F,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$27,$4D,$49,$4D,$4D,$23,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$27,$49,$4D,$49,$4D,$4F,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$60,$49,$4D,$49,$23,$49,$27,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$4F,$49,$4D,$49,$4D,$27,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$4F,$49,$23,$4D,$4F,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$27,$23,$49,$4D,$4D,$27,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$69,$49,$4D,$4D,$4F,$27,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$27,$23,$49,$4D,$49,$27,$20,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$4F,$49,$4F,$27,$27,$4D,$23,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$60,$27,$4D,$27,$20,$20,$4D,$4F,$60,$20,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$2E,$60,$20,$60,$27,$27,$20,$27,$4D,$4D,$49,$69,$27,$60,$2E,$20,$20,$20,$20,$20,0


FRAME4	fcb	$20,$20,$20,$20,$20,$20,$20,$2E,$4F,$4F,$4F,$3B,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$69,$4D,$4D,$4D,$4D,$27,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$60,$3B,$4D,$4D,$4F,$27,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$4F,$4D,$4D,$4D,$49,$60,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$20,$4D,$4D,$4D,$4D,$4D,$49,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$60,$4D,$4D,$49,$4D,$4D,$4D,$27,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$3B,$4D,$4F,$4D,$4D,$4D,$49,$23,$3B,$27,$2E,$60,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$4F,$4D,$4D,$4D,$4D,$4D,$27,$27,$27,$3B,$4F,$3B,$20,$20,$20,$0D
	fcb	$20,$20,$20,$2E,$23,$49,$4D,$4D,$4D,$4D,$4D,$49,$4F,$20,$20,$20,$60,$20,$20,$20,$0D
	fcb	$20,$20,$20,$60,$27,$27,$4D,$4D,$4D,$4F,$4D,$4D,$4D,$4F,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$27,$4D,$4D,$4F,$20,$60,$27,$4D,$4D,$23,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$4F,$4D,$4F,$2E,$20,$20,$20,$4F,$4D,$4D,$60,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$4F,$4D,$4D,$2E,$20,$20,$20,$20,$23,$4D,$4D,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$4F,$4D,$4F,$20,$20,$20,$20,$20,$27,$4D,$4F,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$4F,$4D,$69,$20,$20,$20,$20,$20,$60,$49,$4D,$27,$27,$20,$20,$20,$0D
	fcb	$2E,$60,$27,$27,$49,$23,$4F,$4F,$3B,$60,$20,$60,$27,$4F,$3B,$27,$27,$27,$20,$20,0


FRAME5	fcb	$20,$20,$20,$20,$20,$20,$20,$27,$23,$4F,$4F,$27,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$20,$4F,$4D,$4D,$4D,$4F,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$60,$3B,$4D,$49,$4F,$2E,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$20,$3B,$4D,$4D,$4D,$4F,$60,$20,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$2E,$4D,$49,$4D,$4D,$4D,$4F,$60,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$20,$4F,$4D,$4F,$4D,$4D,$4D,$4F,$27,$60,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$49,$4D,$49,$4D,$4D,$4D,$4F,$4F,$3B,$4F,$4F,$4F,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$4F,$4D,$4D,$4D,$4D,$4D,$49,$60,$20,$20,$20,$60,$27,$20,$20,$20,$0D
	fcb	$20,$20,$60,$3B,$4D,$3B,$4D,$49,$4D,$4D,$4D,$3B,$60,$20,$20,$20,$60,$20,$20,$20,$0D
	fcb	$20,$20,$20,$27,$27,$4F,$4D,$4D,$4D,$4D,$4D,$4D,$4F,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$20,$60,$49,$4D,$49,$27,$27,$4D,$4D,$4D,$20,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$60,$4F,$4D,$4D,$27,$20,$20,$27,$4D,$4D,$4F,$20,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$20,$4F,$4D,$49,$60,$20,$20,$20,$20,$3B,$4D,$4D,$4F,$20,$20,$20,$20,$20,$0D
	fcb	$20,$20,$27,$4D,$4D,$60,$20,$20,$20,$20,$20,$20,$27,$4D,$4D,$27,$20,$20,$20,$20,$0D
	fcb	$20,$20,$4F,$4D,$69,$20,$20,$20,$20,$20,$20,$20,$20,$20,$4F,$49,$4F,$3B,$69,$20,$0D
	fcb	$2E,$27,$4F,$4F,$49,$69,$27,$60,$2E,$60,$20,$20,$20,$60,$27,$4F,$3B,$27,$27,$20,0

	end	START
