2015-09-27 18:12:25 +02:00
|
|
|
|
|
|
|
#include <conio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2015-09-27 18:36:53 +02:00
|
|
|
int i, j, n;
|
|
|
|
unsigned char xsize, ysize, tcol;
|
2015-09-27 18:12:25 +02:00
|
|
|
|
|
|
|
clrscr();
|
|
|
|
screensize(&xsize, &ysize);
|
|
|
|
cputs("cc65 conio test");
|
2015-09-27 18:36:53 +02:00
|
|
|
|
|
|
|
tcol = textcolor(1);
|
2015-09-27 18:12:25 +02:00
|
|
|
cputsxy(0, 2, "colors:" );
|
|
|
|
for (i = 3; i < 6; ++i) {
|
|
|
|
gotoxy(i,i);
|
|
|
|
for (j = 0; j < 16; ++j) {
|
|
|
|
textcolor(j);
|
|
|
|
cputc('X');
|
|
|
|
}
|
|
|
|
}
|
2015-09-27 18:36:53 +02:00
|
|
|
textcolor(tcol);
|
2015-09-27 18:12:25 +02:00
|
|
|
|
|
|
|
cprintf("\n\n\rscreensize is: %dx%d", xsize, ysize );
|
|
|
|
|
|
|
|
chlinexy(0,10,xsize);
|
|
|
|
cvlinexy(0,10,3);
|
|
|
|
chlinexy(0,12,xsize);
|
|
|
|
cvlinexy(xsize-1,10,3);
|
|
|
|
cputcxy(0,10,CH_ULCORNER);
|
|
|
|
cputcxy(xsize-1,10,CH_URCORNER);
|
|
|
|
cputcxy(0,12,CH_LLCORNER);
|
|
|
|
cputcxy(xsize-1,12,CH_LRCORNER);
|
|
|
|
|
|
|
|
gotoxy(0,ysize - 2 - ((256 + xsize) / xsize));
|
|
|
|
for (i = 0; i < xsize; ++i) {
|
|
|
|
cputc('0' + i % 10);
|
|
|
|
}
|
|
|
|
for (i = 0; i < 256; ++i) {
|
|
|
|
if ((i != '\n') && (i != '\r')) {
|
|
|
|
cputc(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while(wherex() > 0) {
|
|
|
|
cputc('#');
|
|
|
|
}
|
|
|
|
for (i = 0; i < xsize; ++i) {
|
|
|
|
cputc('0' + i % 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
for(;;) {
|
|
|
|
|
|
|
|
gotoxy(xsize - 10, 3);
|
|
|
|
j = (n >> 5) & 1;
|
|
|
|
revers(j);
|
|
|
|
cputc(j ? 'R' : ' ');
|
|
|
|
cputs(" revers");
|
|
|
|
revers(0);
|
|
|
|
|
|
|
|
++n;
|
|
|
|
}
|
|
|
|
|
|
|
|
for(;;);
|
|
|
|
}
|