mirror of
https://github.com/RevCurtisP/C02.git
synced 2025-02-19 19:31:04 +00:00
Replaced test/testscrn.c02 with test/scrntst.c02
This commit is contained in:
parent
f83a5d1e71
commit
72eb1fff3d
72
test/scrntst.c02
Normal file
72
test/scrntst.c02
Normal file
@ -0,0 +1,72 @@
|
||||
/************************************
|
||||
* SCRNTST - Test C02 screen module *
|
||||
************************************/
|
||||
|
||||
//use -h amd -s options on command line
|
||||
#include <screen.h02>
|
||||
|
||||
char col, row, wdth, hght;
|
||||
char mode, modex;
|
||||
char a, c, f, i, m;
|
||||
char aa, yy;
|
||||
|
||||
const char modes = {#SMTEXT, #SMWIDE};
|
||||
|
||||
void prtaxy(aa,yy) {
|
||||
if (aa & $F0) prbyte(aa); else prhex(aa);
|
||||
putchr('X');
|
||||
if (yy & $F0) prbyte(yy); else prhex(yy);
|
||||
}
|
||||
|
||||
void putlin() {putstr(); newlin();}
|
||||
|
||||
main:
|
||||
|
||||
for (modex=0; modex<@modes; modex++) {
|
||||
|
||||
mode = modes[modex];
|
||||
putstr("MODE $"); prbyte(mode); newlin();
|
||||
if (mode == $FF) continue; //Unsupported Mode
|
||||
|
||||
if (setscr(mode)=$FF) putlin("ERROR IN SETSCR()");
|
||||
m = getscr();
|
||||
if (m <> mode) putlin("ERROR IN GETSCR()");
|
||||
putstr("MODE="); prbyte(m); newlin();
|
||||
|
||||
wdth, hght = getsiz(); //Get Screen Width & Height
|
||||
prtaxy(wdth,hght); newlin();
|
||||
|
||||
for (i=1; i<6; i++) putchr('.');
|
||||
col, row = getpos(); //Get Cursor Position
|
||||
prtaxy(col,row);
|
||||
crsrhm(); prtaxy(getpos());
|
||||
getchr(); newlin(); //Wait For keypress
|
||||
|
||||
clrscr(); //Clear Screen
|
||||
col, row = getpos(); //Get Cursor Position
|
||||
prtaxy(col, row);
|
||||
f = (col == 255) ? 0 : $FF;
|
||||
getchr();
|
||||
|
||||
if (f) clrscr(); else newlin();
|
||||
|
||||
if (wdth:- or hght:-) goto exit;
|
||||
for (c='@'; c<'`'; c++) {
|
||||
if (!f) newlin();
|
||||
for (row=hght-2; row; row--) {
|
||||
if (!f) putchr(' ');
|
||||
for (col=wdth-2; col; col--) {
|
||||
if (f) setpos(col,row);
|
||||
putchr(c);
|
||||
}
|
||||
if (!f) newlin();
|
||||
if (getkey() == #ESCKEY) goto exit;
|
||||
}
|
||||
if (!f) getchr();
|
||||
}
|
||||
if (f) getchr(); //Wait For keypress
|
||||
newlin();
|
||||
|
||||
} //for modex
|
||||
|
||||
goto exit;
|
@ -1,53 +0,0 @@
|
||||
/************************************
|
||||
* TESTHDR - Test C02 screen module *
|
||||
************************************/
|
||||
|
||||
//use -h amd -s options on command line
|
||||
#include <screen.h02>
|
||||
|
||||
char col, row, wdth, hght;
|
||||
char c, f, i, aa, yy;
|
||||
|
||||
void prtaxy(aa,yy) {
|
||||
if (aa & $F0) prbyte(aa); else prhex(aa);
|
||||
putchr('X');
|
||||
if (yy & $F0) prbyte(yy); else prhex(yy);
|
||||
}
|
||||
|
||||
main:
|
||||
|
||||
wdth, hght = getsiz(); //Get Screen Width & Height
|
||||
prtaxy(wdth,hght); newlin();
|
||||
|
||||
for (i=1; i<6; i++) putchr('.');
|
||||
col, row = getpos(); //Get Cursor Position
|
||||
prtaxy(col,row);
|
||||
crsrhm(); prtaxy(getpos());
|
||||
getchr(); newlin(); //Wait For keypress
|
||||
|
||||
clrscr(); //Clear Screen
|
||||
col, row = getpos(); //Get Cursor Position
|
||||
prtaxy(col, row);
|
||||
f = (col == 255) ? 0 : $FF;
|
||||
getchr();
|
||||
|
||||
if (f) clrscr(); else newlin();
|
||||
|
||||
if (wdth:- or hght:-) goto exit;
|
||||
for (c='@'; c<'`'; c++) {
|
||||
if (!f) newlin();
|
||||
for (row=hght-2; row; row--) {
|
||||
if (!f) putchr(' ');
|
||||
for (col=wdth-2; col; col--) {
|
||||
if (f) setpos(col,row);
|
||||
putchr(c);
|
||||
}
|
||||
if (!f) newlin();
|
||||
if (getkey() == #ESCKEY) goto exit;
|
||||
}
|
||||
if (!f) getchr();
|
||||
}
|
||||
if (f) getchr(); //Wait For keypress
|
||||
newlin();
|
||||
|
||||
goto exit;
|
Loading…
x
Reference in New Issue
Block a user