// Test memcpy - copy charset and screen using memcpy() from stdlib string

import "c64"
import "string"

const byte* CHARSET = 0x2000;
const byte* SCREEN = 0x0400;
const byte* SCREEN_COPY = 0x2400;

void main() {
    *D018 = toD018(SCREEN_COPY, CHARSET);
    memcpy(SCREEN_COPY, SCREEN, 0x0400);
    asm { sei }
    *PROCPORT = PROCPORT_RAM_CHARROM;
    memcpy(CHARSET, CHARGEN, 0x0800);
    *PROCPORT = PROCPORT_BASIC_KERNEL_IO;
    asm { cli }
}