#: 12120 S10/OS9/6809 (CoCo)
07-Sep-91 21:27:50
Sb: #Mouse_Hlp
Fm: Brother Jeremy, CSJW 76477,142
To: Kevin Darling, 76703,4227 (X)
Dear Kevin:
I am working on a project and I need to show the x/y co-ordinates of the mouse
on the screen. The only code I could find in the Tandy OS-9 manual was for the
low or medium resolution joystick.
I used the sample from your Syscall Tutorial
PROCEDURE SS_Mouse
TYPE stack=CC,A,B,DP:BYTE; X,Y,U:INTEGER
DIM reg:stack
BASE 0
DIM I_GetStt,SS_Mouse,mouse(32):BYTE
I_GetStt=$8D
SS_Mouse=$89
LOOP
reg.A=0
reg.Y=0
reg.X=ADDR(mouse)
RUN Syscall(I_GetStt,reg)
PRINT "Mouse X = "; mouse(28)*256+mouse(29); " ";
PRINT "Mouse Y = "; mouse(30)*256+mouse(31)
EXITIF mouse(8)0 THEN
PRINT "Left button Hit"
ENDEXIT
ENDLOOP
I get the following:
PRINT "Mouse X = 31091 Mouse Y = 25441 Left button Hit
What I would like to be able to do is get numbers like x=(between 0 to 639)
y=(between 0 to 191)
Plus the numbers didn't change when I moved the mouse. What am I doing wrong?
Confusedly yours, Br. Jeremy, CSJW
There is 1 Reply.
|