From 72eb1fff3d811b0cbde01efa6c6118cb554792d6 Mon Sep 17 00:00:00 2001 From: Curtis F Kaylor Date: Tue, 19 Nov 2019 18:54:12 -0500 Subject: [PATCH] Replaced test/testscrn.c02 with test/scrntst.c02 --- test/scrntst.c02 | 72 +++++++++++++++++++++++++++++++++++++++++++++++ test/testscrn.c02 | 53 ---------------------------------- 2 files changed, 72 insertions(+), 53 deletions(-) create mode 100644 test/scrntst.c02 delete mode 100644 test/testscrn.c02 diff --git a/test/scrntst.c02 b/test/scrntst.c02 new file mode 100644 index 0000000..9a5a8c0 --- /dev/null +++ b/test/scrntst.c02 @@ -0,0 +1,72 @@ +/************************************ + * SCRNTST - Test C02 screen module * + ************************************/ + +//use -h amd -s options on command line +#include + +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; diff --git a/test/testscrn.c02 b/test/testscrn.c02 deleted file mode 100644 index 5820dd2..0000000 --- a/test/testscrn.c02 +++ /dev/null @@ -1,53 +0,0 @@ -/************************************ - * TESTHDR - Test C02 screen module * - ************************************/ - -//use -h amd -s options on command line -#include - -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;