copyd800
        lda #25
        sta temp

        lda #<memd800colors
        sta low
        lda #>memd800colors
        sta high

        lda #<$d800
        sta low2
        lda #<$d800+20
        sta irqlow
        lda #>$d800
        sta high2
        sta irqhigh

cpd800loop
        ldy #19
        lda (low),y
        sta (low2),y
        tax
        lda swapnybble,x
        sta (irqlow),y
        dey
        bpl *-11

        lda low
        clc
        adc #20
        sta low
        bcc *+4
        inc high

        lda low2
        clc
        adc #40
        sta low2
        bcc *+4
        inc high2

        lda irqlow
        clc
        adc #40
        sta irqlow
        bcc *+4
        inc irqhigh

        dec temp

        bne cpd800loop
        rts
