From: mrdudz Date: Fri, 9 Oct 2015 21:39:55 +0000 (+0200) Subject: updated conio test X-Git-Tag: V2.16~210^2~37 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=70ed96d06d948f0732f0379b8df9f9934c44ec3a;p=cc65 updated conio test --- diff --git a/testcode/lib/conio.c b/testcode/lib/conio.c index f998abeae..3e4b4539f 100644 --- a/testcode/lib/conio.c +++ b/testcode/lib/conio.c @@ -18,7 +18,7 @@ void main(void) clrscr(); screensize(&xsize, &ysize); - cputs("cc65 conio test\n\rInput:[ ]"); + cputs("cc65 conio test\n\rInput: [ ]"); cputsxy(0, 2, "Colors:" ); tcol = textcolor(0); /* remember original textcolor */ @@ -80,9 +80,18 @@ void main(void) cputs(" revers"); revers(0); - gotoxy(7 + inpos,1); - cputc(cgetc()); - inpos = (inpos + 1) & 7; + gotoxy(8 + inpos,1); + i = cgetc(); + if ((i >= '0') && (i<='9')) { + textcolor(i - '0'); + } else if (i == CH_CURS_LEFT) { + inpos = (inpos - 1) & 7; + } else if (i == CH_CURS_RIGHT) { + inpos = (inpos + 1) & 7; + } else { + cputc(i); + inpos = (inpos + 1) & 7; + } ++n; }