* Output Filename: E:\lp2k3\256b\matrix3.xex
d0	equ $e0
d1	equ $e2
d2	equ $e4
d3	equ $e6
dlist	equ $3000

	opt %100101
	org $2000
	lda #%00111110
	sta 559
	lda #3
	sta 53277
	lda #$30
	sta 580
	sta 54279
	sta 561
	lda #0
	sta 560
	ldx #8
t1	lda dpos-1,x
	sta 53247,x
	lda $d20a
	sta $0600-1,x
	lda data-1,x
	sta $8011,x
	lda cols-1,x
	sta 703,x
	lda #$60
	sta dlist-1,x
	sta dlist+7,x
	lda dl-1,x
	sta dlist+15,x
	dex
	bne t1
loop	equ *
	
	ldx #$f0
l1	lda $3700,x
	sta $3702,x
	lda $3600,x
	sta $3603,x
	lda $3500,x
	sta $3502,x
	lda $3400,x
	sta $3401,x
	lda $3300,x
	sta $3301,x
	dex
	bne l1
	inc d3
	lda d3
	and #7
	cmp #7
	bne loop
	ldx #0
l2	stx d1
	lda $0600,x
	beq l3
	dec $0600,x
	jmp lend
l3	cpx #4
	beq poc1
	cpx #5
	beq poc2
	txa
	clc
	adc #$34
	sta loo+2
	stx d1
	lda $d20a
	asl @
	asl @
	asl @
	tay
	ldx #1
l4	lda $e000,y
	and #%00011111
loo	sta $3400,x
	iny
	inx
	cpx #9
	bne l4
	beq lend
poc1	lda $d20a
	asl @
	asl @
	asl @
	tay
	ldx #1
l5	lda $e000,y
	and #%00001111
l5_0	sta $3300,x
	iny
	inx 
	cpx #9
	bne l5
	beq lend
poc2	equ *
	lda $d20a
	asl @
	asl @
	asl @
	tay
	ldx #1
l6	lda $e000,y
	and #%11110000
	ora $3300,x
	sta $3300,x
	iny
	inx
	cpx #9
	bne l6
lend	ldx d1
	inx
	cpx #6
	bne l2			
	jmp loop
	
dl	dta b($42),a($8000)			
dpos	dta b(65),b(90),b(165),b(140),b(117),b(115),b(192),b(190)
cols	dta a($c8c8),a($c8c8),b(14),b(14),b(0)
data	dta d'MATRIX'
	org $2e0
	dta a($2000)
	
