From: cpg Date: Sun, 3 Nov 2002 22:52:39 +0000 (+0000) Subject: initial check-in X-Git-Tag: V2.12.0~2150 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b304f04cc0a947d723446971edce3dc657250ed2;p=cc65 initial check-in git-svn-id: svn://svn.cc65.org/cc65/trunk@1482 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/testcode/lib/cursor.c b/testcode/lib/cursor.c new file mode 100644 index 000000000..2d3504cb4 --- /dev/null +++ b/testcode/lib/cursor.c @@ -0,0 +1,49 @@ +/* + * test for conio cursor() function + * CPG 2002 + * + * the cursor should be in the same state as mentioned in the printfs + */ + +#include + +#if 1 +#define NEWLINE cprintf("\r\n") +#define PRINTF cprintf +#else +#include +#define NEWLINE printf("\n") +#define PRINTF printf +#endif + +int main(void) +{ + char c; + NEWLINE; + + cursor (1); + PRINTF("enter key (cursor on): "); + c = cgetc(); + NEWLINE; + + cursor (0); + PRINTF("enter key (cursor off): "); + c = cgetc(); + NEWLINE; + + PRINTF("enter key (cursor on): "); + cursor (1); + c = cgetc(); + NEWLINE; + + PRINTF("enter key (cursor off): "); + cursor (0); + c = cgetc(); + NEWLINE; + + PRINTF("hit any key to exit..."); + c = cgetc(); + NEWLINE; + + return(0); +}