WSYNC .EQU $D40A

INITDLI
        LDA #DLI&255
        STA $200
        LDA #DLI/256
        STA $201
        LDA #128
        ORA 54286
        STA 54286
        RTS
DLI
        PHA
        LDA        couleur
        cmp        #0
        bne gris
        LDA        #10
        STA        couleur
        lda        #0
        JMP trtDLI 

gris:
        lda        #0
        sta        couleur
        lda        #10

trtDLI:
        STA WSYNC ;WAIT
        STA 53274
        PLA
        RTI

DESADLI
        LDA #127
        AND 54286
        STA 54286
        RTS

couleur db 10
