home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
pocketbk
/
utilsm
/
mouse
/
MAUS3A.OPL
< prev
next >
Wrap
Text File
|
1993-12-12
|
2KB
|
60 lines
PROC maus:
rem ** MAUS ** ein beispielprg. zur Verwendung von einer seriellen
rem PC-Maus am Psion Serie3a
global bit$(6,128),sp%
global a%,b&,p%(5),x%,y%,a$(5),k%,b%,w2%,xx%,yy%
a%=ioopen(k%,"TTY:A",$0300)
rsset:(8,0,8,1,4) :rem 1200 8n1
sp%=createsprite
usesprite sp%
bit$(3)="M:\pic\sprites\kreuz.pic" : rem <<<<<<<<<<<<<<<<<<<<<
appendsprite 8,bit$()
drawsprite 240,80
x%=240 :y%=80
xx%=x% :yy%=y%
do
possprite xx%,yy%
if p%(1)=131 :gat xx%+3,yy%+3 :glineto x%+3,y%+3 :endif
xx%=x% :yy%=y%
mouse:
rem giprint num$(x%,-3)+","+num$(y%,-3)
until key$="x"
giprint "end" :pause 0 :stop
endp
proc rsset:(ba%,pa%,da%,st%,ha%)
local frame%,srchar%(6),du%,er%
frame%=da%-5
srchar%(1)=ba% or (ba%*256)
srchar%(2)=frame% or (pa%*256)
srchar%(3)=(ha% and 255) or $1100
srchar%(4)=$13
er%=iow(k%,7,srchar%(1),du%)
if er% :raise er% :endif
endp
proc mouse:
a$=rept$(chr$(0),5)
key
b%=addr(a$)+1
a%=ioread(k%,b%,5)
p%(1)=peekb(b%)
p%(2)=peekb(b%+1)
p%(3)=peekb(b%+2)
p%(4)=peekb(b%+3)
p%(5)=peekb(b%+4)
rem print num$(p%(1),-3),num$(p%(2),-3),num$(p%(3),-3),num$(p%(4),-3),num$(p%(5),-3)
if (p%(2)>0 and p%(2)<128) :x%=x%+p%(2) :endif
if (p%(4)>0 and p%(4)<128) :x%=x%+p%(4) :endif
if p%(2)>128 :x%=x%-(256-p%(2)) :endif
if p%(4)>128 :x%=x%-(256-p%(4)) :endif
if (p%(3)>0 and p%(3)<128) :y%=y%-p%(3) :endif
if (p%(5)>0 and p%(5)<128) :y%=y%-p%(5) :endif
if p%(3)>128 :y%=y%+(256-p%(3)) :endif
if p%(5)>128 :y%=y%+(256-p%(5)) :endif
if p%(1)=135 :gat x%,y% :endif
if x%>477 :x%=476 :endif
if x%<-3 :x%=-3 :endif
if y%>157 :y%=156 :endif
if y%<-3 :y%=-3 :endif
endp