1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-08 06:25:17 +00:00

updated conio test

This commit is contained in:
mrdudz
2015-10-13 04:14:23 +02:00
parent 08d7eefdd7
commit ffda2a3603

View File

@@ -14,7 +14,7 @@ static char grid[5][5] = {
void main(void) void main(void)
{ {
int i, j, n; int i, j, n;
unsigned char xsize, ysize, tcol, inpos = 0; unsigned char xsize, ysize, tcol, bgcol, inpos = 0;
clrscr(); clrscr();
screensize(&xsize, &ysize); screensize(&xsize, &ysize);
@@ -22,6 +22,7 @@ void main(void)
cputsxy(0, 2, "Colors:" ); cputsxy(0, 2, "Colors:" );
tcol = textcolor(0); /* remember original textcolor */ tcol = textcolor(0); /* remember original textcolor */
bgcol = bgcolor(0); /* remember original background color */
for (i = 0; i < 3; ++i) { for (i = 0; i < 3; ++i) {
gotoxy(i,3 + i); gotoxy(i,3 + i);
for (j = 0; j < 16; ++j) { for (j = 0; j < 16; ++j) {
@@ -30,6 +31,7 @@ void main(void)
} }
} }
textcolor(tcol); textcolor(tcol);
bgcolor(bgcol);
cprintf("\n\n\r Screensize is: %dx%d", xsize, ysize ); cprintf("\n\n\r Screensize is: %dx%d", xsize, ysize );
@@ -90,6 +92,12 @@ void main(void)
inpos = (inpos - 1) & 7; inpos = (inpos - 1) & 7;
} else if (i == CH_CURS_RIGHT) { } else if (i == CH_CURS_RIGHT) {
inpos = (inpos + 1) & 7; inpos = (inpos + 1) & 7;
} else if (i == CH_F7) {
bgcol = (bgcol + 1) & 0x0f;
bgcolor(bgcol);
} else if (i == CH_F8) {
bgcol = (bgcol - 1) & 0x0f;
bgcolor(bgcol);
} else { } else {
cputc(i); cputc(i);
inpos = (inpos + 1) & 7; inpos = (inpos + 1) & 7;