fix conio test to work on vic20 screen
This commit is contained in:
@@ -3,6 +3,15 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
static char grid[5][5] = {
|
||||||
|
{ CH_ULCORNER, CH_HLINE, CH_TTEE, CH_HLINE, CH_URCORNER },
|
||||||
|
{ CH_VLINE, ' ', CH_VLINE, ' ', CH_VLINE },
|
||||||
|
{ CH_LTEE, CH_HLINE, CH_CROSS, CH_HLINE, CH_RTEE },
|
||||||
|
{ CH_VLINE, ' ', CH_VLINE, ' ', CH_VLINE },
|
||||||
|
{ CH_LLCORNER, CH_HLINE, CH_BTEE, CH_HLINE, CH_LRCORNER },
|
||||||
|
};
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
int i, j, n;
|
int i, j, n;
|
||||||
@@ -12,10 +21,10 @@ void main(void)
|
|||||||
screensize(&xsize, &ysize);
|
screensize(&xsize, &ysize);
|
||||||
cputs("cc65 conio test");
|
cputs("cc65 conio test");
|
||||||
|
|
||||||
tcol = textcolor(1);
|
cputsxy(0, 2, "Colors:" );
|
||||||
cputsxy(0, 2, "colors:" );
|
tcol = textcolor(0); /* remember original textcolor */
|
||||||
for (i = 3; i < 6; ++i) {
|
for (i = 0; i < 3; ++i) {
|
||||||
gotoxy(i,i);
|
gotoxy(i,3 + i);
|
||||||
for (j = 0; j < 16; ++j) {
|
for (j = 0; j < 16; ++j) {
|
||||||
textcolor(j);
|
textcolor(j);
|
||||||
cputc('X');
|
cputc('X');
|
||||||
@@ -23,21 +32,30 @@ void main(void)
|
|||||||
}
|
}
|
||||||
textcolor(tcol);
|
textcolor(tcol);
|
||||||
|
|
||||||
cprintf("\n\n\rscreensize is: %dx%d", xsize, ysize );
|
cprintf("\n\n\r Screensize is: %dx%d", xsize, ysize );
|
||||||
|
|
||||||
chlinexy(0,10,xsize);
|
chlinexy(0,6,xsize);
|
||||||
cvlinexy(0,10,3);
|
cvlinexy(0,6,3);
|
||||||
chlinexy(0,12,xsize);
|
chlinexy(0,8,xsize);
|
||||||
cvlinexy(xsize-1,10,3);
|
cvlinexy(xsize-1,6,3);
|
||||||
cputcxy(0,10,CH_ULCORNER);
|
cputcxy(0,6,CH_ULCORNER);
|
||||||
cputcxy(xsize-1,10,CH_URCORNER);
|
cputcxy(xsize-1,6,CH_URCORNER);
|
||||||
cputcxy(0,12,CH_LLCORNER);
|
cputcxy(0,8,CH_LLCORNER);
|
||||||
cputcxy(xsize-1,12,CH_LRCORNER);
|
cputcxy(xsize-1,8,CH_LRCORNER);
|
||||||
|
|
||||||
|
for (i = 0; i < 5; ++i) {
|
||||||
|
gotoxy(xsize - 5,i);
|
||||||
|
for (j = 0; j < 5; ++j) {
|
||||||
|
cputc(grid[i][j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gotoxy(0,ysize - 2 - ((256 + xsize) / xsize));
|
gotoxy(0,ysize - 2 - ((256 + xsize) / xsize));
|
||||||
|
revers(1);
|
||||||
for (i = 0; i < xsize; ++i) {
|
for (i = 0; i < xsize; ++i) {
|
||||||
cputc('0' + i % 10);
|
cputc('0' + i % 10);
|
||||||
}
|
}
|
||||||
|
revers(0);
|
||||||
for (i = 0; i < 256; ++i) {
|
for (i = 0; i < 256; ++i) {
|
||||||
if ((i != '\n') && (i != '\r')) {
|
if ((i != '\n') && (i != '\r')) {
|
||||||
cputc(i);
|
cputc(i);
|
||||||
@@ -46,13 +64,15 @@ void main(void)
|
|||||||
while(wherex() > 0) {
|
while(wherex() > 0) {
|
||||||
cputc('#');
|
cputc('#');
|
||||||
}
|
}
|
||||||
|
revers(1);
|
||||||
for (i = 0; i < xsize; ++i) {
|
for (i = 0; i < xsize; ++i) {
|
||||||
cputc('0' + i % 10);
|
cputc('0' + i % 10);
|
||||||
}
|
}
|
||||||
|
revers(0);
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
|
||||||
gotoxy(xsize - 10, 3);
|
gotoxy(8, 2);
|
||||||
j = (n >> 5) & 1;
|
j = (n >> 5) & 1;
|
||||||
revers(j);
|
revers(j);
|
||||||
cputc(j ? 'R' : ' ');
|
cputc(j ? 'R' : ' ');
|
||||||
|
|||||||
Reference in New Issue
Block a user