#: 3806 S3/Languages
26-May-90 01:02:01
Sb: #3804-#BASIC09 Help
Fm: Kevin Darling (UG Pres) 76703,4227
To: Colin Smith 73777,1360 (X)
Colin - here's a test program which maps in a buffer, and just Gets
a char at a location each time the mouse button is pressed, and Peeks
the mapped-in buffer. Study it and ask Q's.
PROCEDURE SpotTest
(* Gets a char from Text Screen:
BASE 0
TYPE registers=cc,a,b,dp:BYTE; x,y,u:INTEGER
DIM reg:registers
DIM Mouse(32):BYTE
DIM I_GetStt:BYTE \I_GetStt=$8D
DIM SS_Mouse:BYTE \SS_Mouse=$89
DIM F_ID:BYTE \F_ID=$0C
DIM X1,Y1,Group,BuffNum,BuffLoc:INTEGER
DIM oldx,oldy:INTEGER
GOSUB 100 \(* Find a Group to Use *)
RUN gfx2("Get",Group,BuffNum,1,1,2,1)
RUN MapBuff(Group,BuffNum,BuffLoc)
LOOP
GOSUB 200 \(* Get Mouse coord
IF X1oldx OR Y1oldy THEN
RUN gfx2("CurXY",X1,Y1)
oldx=X1 \oldy=Y1
ENDIF
IF Mouse(8)0 THEN
RUN gfx2("Get",Group,BuffNum,X1,Y1,2,1)
RUN gfx2("CurHome")
PRINT "Value is: ";
PRINT PEEK(BuffLoc);
PRINT " Character is: ";
PRINT CHR$(PEEK(BuffLoc));
PRINT " "
PRINT "--------------------------------";
RUN gfx2("CurXY",X1,Y1)
ENDIF
ENDLOOP
(* ******************************************
100 (* Find a Group via our ID
RUN Syscall(F_ID,reg) \Group=reg.a \BuffNum=1
ON ERROR GOTO 110
RUN gfx2("KillBuff",Group,0)
110 ON ERROR
RETURN
(* ******************************************
200 (* Get Mouse Coords:
reg.a=0
reg.b=SS_Mouse
reg.x=ADDR(Mouse)
reg.y=1
RUN Syscall(I_GetStt,reg)
X1=(Mouse($18)*256+Mouse($19))/8
Y1=Mouse($1B)/8
RETURN
There is 1 Reply.
|