1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-08-09 20:25:17 +00:00
Files
kickc/src/test/kc/function-pointer-noarg-call-5.kc

24 lines
347 B
Plaintext

// Tests calling into arrays of pointers to non-args no-return functions
void()*[2] fns = { &fn1, &fn2};
void main() {
byte i = 0;
while(true) {
void()* f = fns[++i&1];
(*f)();
}
}
void fn1() {
const byte* BORDERCOL = $d020;
(*BORDERCOL)++;
}
void fn2() {
const byte* BGCOL = $d021;
(*BGCOL)++;
}