1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-10-31 10:14:09 +00:00
C02/test/lightpen.c02
2018-09-16 20:53:34 -04:00

40 lines
711 B
Plaintext

/************************************
* LIGHTPEN - Test lgtpen() function *
************************************/
//use -h option on command line
#include <screen.h02>
#include <lgtpen.h02>
char aa,xx,yy;
void prtlbl(aa,yy,xx) {
setpos(aa,yy);
putchr(xx); putchr(':');
}
void prtbyt(aa,yy,xx) {
setpos(aa,yy);
prbyte(xx);
}
char px,py,pt;
char lx,ly,lt;
main:
clrscr();
if (!#LGTPNS) goto exit;
prtlbl(1,1,'X');
prtlbl(1,2,'Y');
prtlbl(1,3,'T');
loop:
if (getkey() == #ESCKEY) goto exit;
px,py,pt = lgtpen();
if (px<>lx) {prtbyt(4,1,px); lx=px;}
if (py<>ly) {prtbyt(4,2,py); ly=py;}
if (pt<>lt) {prtbyt(4,3,pt); lt=pt;}
goto loop;