🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #19405

Re: Cursor Control

#19405
From: HP AI User
Date: Wed, 23 Sep 1987 01:47
56 lines
3942 bytes
I haven't played with this stuff recently, but as I remember...
There is a set of low-memory globals that control the cursor on the screen.

Name        Location    Description
--------    --------    ----------------------------------------------------
MTemp       $828        A point that describes the cursor's immediately
                        previous position on the screen.
RawMouse    $82C        A point that describes the cursor's current position
                        on the screen.  The difference between MTemp and
                        RawMouse determines the velocity of the cursor.
CrsrPin     $834        A pinning rectangle for the cursor.  The cursor must
                        stay within CrsrPin.
CrsrRect    $83C        Cursor hit rectangle.  I've never played with this.
TheCrsr     $844        The current cursor's data, mask, and hot spot.
CrsrAddr    $888        A pointer to the screen memory address covered by the
                        cursor (at least, this is what it is on a Mac Plus and
                        probably an SE.  This doesn't make sense on a Mac II).
CrsrSave    $88C        64 bytes of screen data covered by the cursor -- what's
                        under the cursor.
CrsrVis     $8CC        Boolean: is the cursor visible?
CrsrBusy    $8CD        Boolean: is the cursor locked out?
CrsrNew     $8CE        Boolean: has the cursor changed?
CrsrCouple  $8CF        Boolean: is the cursor coupled to the mouse?
CrsrState   $8D0        Cursor nesting level, used by HideCursor and
                        ShowCursor, I think.
CrsrObscure $8D2        Boolean: is the cursor obscured?
CrsrScale   $8D3        Boolean: is the cursor scaled?
MouseMask   $8D6        A point that is ANDed with cursor coordinates.
MouseOffset $8DA        A point that is added to the cursor coordinates.  Like
                        an upper left-hand corner for the cursor's movement.
CrsrThresh  $8EC        Velocity threshhold used for mouse scaling.
JCrsrTask   $8EE        The address of the routine that controls the movement
                        of the mouse.  When I last checked, this was $401E86
                        (Mac Plus, pre-System 4.1 days).

Probably more than you wanted to know.  Anyway, about program-controlled
cursor movement.  First, store some non-zero value in CrsrBusy.  This "locks
out" the cursor and should prevent the JCursTask proc from moving the cursor.
Next, store the point at which you want the cursor in MTemp and RawMouse.  And
finally, clear CrsrBusy.  The cursor should appear where you want it.

This makes for a good April Fool's joke.  Another good one is to write an INIT
that stores $00140000 in MouseOffset.  I did this once... my coworker still
won't let me near his hard disk :-).

As I said, it has been a while since I've looked at the cursor handling stuff.
I wouldn't be surprised if System 4.1 installs its own JCrsrTask for the
variable-speed mouse scaling, and only Apple knows what a Mac II does.  But I
hope this information is at least interesting, if not entirely useful.

Credit where credit is due: Most of the information in this article came from
Scott Knaster's great book, "How to Write Macintosh Software."

-----
Eric Eide
UUCC Consultant
Technical Details
Message-ID: <4992@utah-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ut-sally!utah-cs!mindblow!hpai
References: <sVJ1zsy00UgLwe00=B@andrew.cmu.edu> <4991@utah-cs.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!ut-sally!utah-cs!mindblow!hpai
From: hpai%mindblow.uucp@utah-cs.UUCP (HP AI User)
Newsgroups: comp.sys.mac
Subject: Re: Cursor Control
Message-ID: <4992@utah-cs.UUCP>
Date: Tue, 22-Sep-87 21:47:03 EDT
Article-I.D.: utah-cs.4992
Posted: Tue Sep 22 21:47:03 1987
Date-Received: Fri, 25-Sep-87 01:29:36 EDT
References: <sVJ1zsy00UgLwe00=B@andrew.cmu.edu> <4991@utah-cs.UUCP>
Sender: news@utah-cs.UUCP
Reply-To: u-eeide%ug.utah.edu@utah-cs.UUCP (Eric Eide)
Distribution: na
Organization: University of Utah Computer Center
Lines: 56