import "c64.kc"
import "string"

byte* SCREEN = $400;
byte* LOGO = $2000;

kickasm(resource "logo.png", pc LOGO, bytes 6*40*8 ) {{
    .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff))
    .for (var y=0; y<6	; y++)
        .for (var x=0;x<40; x++)
            .for(var cp=0; cp<8; cp++)
                .byte logoPic.getMulticolorByte(x,cp+y*8)
}}

void main() {
    *BORDERCOL = WHITE;
    *BGCOL = *BGCOL2 = DARK_GREY;
    *BGCOL3 = BLACK;
    *D018 = toD018(SCREEN, LOGO);
    *D016 = VIC_MCM | VIC_CSEL;
    memset(SCREEN, BLACK, 40*25);
    memset(COLS, WHITE|8, 40*25);
    for(byte ch: 0..239) {
        SCREEN[ch] = ch;
    }
    while(true) {
        (*(SCREEN+999))++;
        kickasm {{ inc $d020 }}
    }
}
