; CPU to VRAM test

        opt     l-
        icl     'atarihw.ah'
        icl     'atarios.ah'
        icl     'vbxefx.ah'
        opt     l+

;-------------------------------------------------------

ptr1    equ     0x90
ptr2    equ     0x92

        org     0x3000

Start

        lda     20
        cmp     20
        req
        lda     #0
        sta     DMACTLS
        sta     DMACTL

l0      lda     RANDOM
        and     #0x1F
        ora     #$80
        sta     MB_CPU

        lda     #0
        sta     COLBAKS
        sta     COLBAK

        mwa     #0x4000 ptr1
        mwa     #0x8000 ptr2

        ldy     #0

        lda     RANDOM
l1      sta     (ptr1),y
        sta     (ptr2),y
        iny
        bne     l1
        inc     ptr2+1
        inc     ptr1+1
        bpl     l1

        mwa     #0x4000 ptr1
        mwa     #0x8000 ptr2

        lda     #0xc4
        sta     COLBAKS
        sta     COLBAK

l2      lda     (ptr1),y
        cmp     (ptr2),y
        bne     red
        iny
        bne     l2
        inc     ptr2+1
        inc     ptr1+1
        bpl     l2
        jmp     l0

red     lda     #0x34
        sta     COLBAKS
        sta     COLBAK
        jmp     *





        run     Start

        end

