mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
added input test
This commit is contained in:
parent
4949836d16
commit
f39337a6ec
@ -3,7 +3,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
static char grid[5][5] = {
|
static char grid[5][5] = {
|
||||||
{ CH_ULCORNER, CH_HLINE, CH_TTEE, CH_HLINE, CH_URCORNER },
|
{ CH_ULCORNER, CH_HLINE, CH_TTEE, CH_HLINE, CH_URCORNER },
|
||||||
{ CH_VLINE, ' ', CH_VLINE, ' ', CH_VLINE },
|
{ CH_VLINE, ' ', CH_VLINE, ' ', CH_VLINE },
|
||||||
@ -15,11 +14,11 @@ static char grid[5][5] = {
|
|||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
int i, j, n;
|
int i, j, n;
|
||||||
unsigned char xsize, ysize, tcol;
|
unsigned char xsize, ysize, tcol, inpos = 0;
|
||||||
|
|
||||||
clrscr();
|
clrscr();
|
||||||
screensize(&xsize, &ysize);
|
screensize(&xsize, &ysize);
|
||||||
cputs("cc65 conio test");
|
cputs("cc65 conio test\n\rInput:[ ]");
|
||||||
|
|
||||||
cputsxy(0, 2, "Colors:" );
|
cputsxy(0, 2, "Colors:" );
|
||||||
tcol = textcolor(0); /* remember original textcolor */
|
tcol = textcolor(0); /* remember original textcolor */
|
||||||
@ -70,15 +69,21 @@ void main(void)
|
|||||||
}
|
}
|
||||||
revers(0);
|
revers(0);
|
||||||
|
|
||||||
|
cursor(1);
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
|
||||||
gotoxy(8, 2);
|
gotoxy(8, 2);
|
||||||
j = (n >> 5) & 1;
|
j = n & 1;
|
||||||
revers(j);
|
revers(j);
|
||||||
cputc(j ? 'R' : ' ');
|
cputc(j ? 'R' : ' ');
|
||||||
|
revers(j ^ 1);
|
||||||
cputs(" revers");
|
cputs(" revers");
|
||||||
revers(0);
|
revers(0);
|
||||||
|
|
||||||
|
gotoxy(7 + inpos,1);
|
||||||
|
cputc(cgetc());
|
||||||
|
inpos = (inpos + 1) & 7;
|
||||||
|
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user