; CPU to VRAM test

        opt     l-
        icl     'atarihw.ah'
        icl     'atarios.ah'
        icl     'vbxefx.asm'
        opt     l+

;-------------------------------------------------------

        .zpvar ptr1 .word
        .zpvar ptr2 .word

        org     0x3000

Start
        DetectCore
        seq
        rts

        lda     20
        cmp     20
        req
        lda     #0
        sta     DMACTLS
        sta     DMACTL

l0      lda     RANDOM
        and     #0x1F
        ora     #$80
        fxsa    FX_MEMB

        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

