2018-09-12 13:54:54 +00:00
|
|
|
/************************************
|
|
|
|
* LIGHTPEN - Test lgtpen() function *
|
|
|
|
************************************/
|
|
|
|
|
|
|
|
//use -h option on command line
|
2018-09-17 00:53:34 +00:00
|
|
|
#include <screen.h02>
|
2018-09-12 13:54:54 +00:00
|
|
|
#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;
|
2018-09-17 00:53:34 +00:00
|
|
|
char lx,ly,lt;
|
2018-09-12 13:54:54 +00:00
|
|
|
|
|
|
|
main:
|
|
|
|
clrscr();
|
|
|
|
|
|
|
|
if (!#LGTPNS) goto exit;
|
|
|
|
|
|
|
|
prtlbl(1,1,'X');
|
|
|
|
prtlbl(1,2,'Y');
|
|
|
|
prtlbl(1,3,'T');
|
2018-09-17 00:53:34 +00:00
|
|
|
|
2018-09-12 13:54:54 +00:00
|
|
|
loop:
|
|
|
|
if (getkey() == #ESCKEY) goto exit;
|
|
|
|
px,py,pt = lgtpen();
|
2018-09-17 00:53:34 +00:00
|
|
|
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;}
|
2018-09-12 13:54:54 +00:00
|
|
|
goto loop;
|