diff --git a/src/test/kc/examples/atarixl/conio-test.c b/src/test/kc/examples/atarixl/conio-test.c new file mode 100644 index 000000000..c16a552ce --- /dev/null +++ b/src/test/kc/examples/atarixl/conio-test.c @@ -0,0 +1,53 @@ +#pragma encoding(atascii) +#pragma zp_reserve(0x00..0x7f) + +#include +#include +#include + +void main() { + // hide the cursor + cursor(0); + + // change colors + bgcolor(DARK_ORANGE); + bordercolor(MEDIUM_BLUE); + textcolor(WHITE); + + // print some text at a location + cputsxy(0, 1, "Hello, World!\n"); + + // skip a line + gotoxy(0, 3); + + // set inverse text and use printf to output a string + revers(1); + char *name = "Mark"; + printf("Hello, %s - press a key!\n", name); + + // wait for user keypress + waitkey(); + + // clear screen + clrscr(); + + // reset reverse and do some scrolling lines. + revers(0); + for(int i: 0..50) { + printf("Scrolling lines ... %d\n", i); + } + waitkey(); + + // turn scroll off and do more lines + scroll(0); + for(int i: 51..200) { + printf("Some wrapping lines ... %d\n", i); + } + waitkey(); + +} + +void waitkey() { + while(!kbhit()) ; + clrkb(); +}