;__________________________________________________________________________________________________ ; ; File: CrsrDevEqu.a ; ; Contains: equates for new mouse/trackball/etc. acceleration code ; ; Written by: Gary Rensberger ; ; Copyright: © 1992 by Apple Computer, Inc. All rights reserved. ; ; This file is used in these builds: ROM ; ; Change History (most recent first): ; ; 12/01/92 HY Defined 2 fields in CsrsDevGlobals, CrsrDevFlags and MoreCrsrDevFlags. ; Defined bit 0 of crsrDevFlags to SkipDraw. This flag indicates to skip ; drawing the cursor on the first VBL, and to only perform calculations. ; This fixes a bug which caused the cursor to flicker when it was at ; the top of the screen. (see CrsrDev.a) ; 8/26/92 kc Roll in Horror changes. ;

7/13/92 djw Added field in CrsrDataRec which indicates how often (in ; VBL ticks) the cursor should be blitted. Added two related ; vectors in CrsrDevGlobals. ;

7/13/92 djw Added equates for two new cursor vectors. ; 5/2/92 kc Roll in Horror. Comments follow: ;

2/17/92 SWC Changed CrsrDevRec.resolution to a long since it's a fixed point ; number, and slightly rearranged the record so everything stays ; long word aligned. ;

2/12/92 GMR first checked in ; --------- button operations --------- btnNoOp EQU 0 ; No action for this button btnSingleClick EQU 1 ; Normal mouse button btnDoubleClick EQU 2 ; Click-release-click when pressed btnClickLock EQU 3 ; Click on press, release on next press btnCharStroke EQU 4 ; A keystroke, data=(modifiers, char code) btnAppleScript EQU 5 ; An AppleScript btnCustom EQU 6 ; Custom behavior, data=proc pointer ; --------- Device Classes --------- classAbsolute EQU 0 ; a flat-response device classMouse EQU 1 ; mechanical or optical mouse classTrackball EQU 2 ; trackball classScratchPad EQU 3 ; (midas) classJoystick EQU 4 ; (homeRow) classRelTablet EQU 5 ; relative tablet CrsrDevSegment RECORD 0 devUnits ds.l 1 ; highest device speed for this segment slope ds.l 1 ; multiplier for device speed (crsr speed/dev speed) intercept ds.l 1 ; offset to produce cursor speed CrsrDevSegSize EQU * ENDR CrsrDevRec RECORD 0 nextCrsrDev ds.l 1 ; ptr to next record in linked list whichCursor ds.l 1 ; ptr to data for target cursor refCon ds.l 1 ; Application defined unused ds.l 1 ; reserved for future devID ds.l 1 ; device identifier (from ADB reg 1) resolution ds.l 1 ; units/inch (orig. from ADB reg 1) devClass ds.b 1 ; device class (from ADB reg 1) cntButtons ds.b 1 ; # of buttons (from ADB reg 1) ds.b 1 ; align buttons ds.b 1 ; state of all buttons buttonOp ds.b 8 ; action performed per button buttonTicks ds.l 8 ; ticks when button last went up (for debounce) buttonData ds.l 8 ; data for the button operation doubleClickTime ds.l 1 ; device-specific double click speed acceleration ds.l 1 ; current acceleration accelPoints ds.l 1 ; Private: Ptr to array of (dev_delta, slope, intercept) deltaX ds.l 1 ; Private: accumulated deltas deltaY ds.l 1 ; Private: " errorX ds.l 1 ; Private: accumulated errors errorY ds.l 1 ; Private: " denom ds.w 1 ; Private: fraction of the errors to use next time spread ds.w 1 ; Private: Number of samples to spread errors over newData ds.b 1 ; Private: set when deltas are new ds.b 1 ; align ds.b 4 ; new CrsrDevSize EQU * ENDR CrsrDataRec RECORD 0 nextCrsrData ds.l 1 ; next in global list displayInfo ds.l 1 ; unused (FUTURE: display info for this cursor) whereX ds.l 1 ; horizontal position whereY ds.l 1 ; vertical position where ds.w 2 ; the pixel position isAbs ds.b 1 ; has been stuffed with absolute coords buttonCount ds.b 1 ; number of buttons currently pressed screenRes ds.l 1 ; Pixels per inch on the current display screenDelay ds.w 1 ; minimum number of VBLs between subsequent crsr redraws

reserved ds.w 1 ; future expansion

scrnDelayPtr ds.l 1 ; ptr to table of screen delay values

alsoreserved ds.l 1 ; future expansion

scrnDelayTbl ds.l 8 ; default tbl for pairs

CrsrDataSize EQU * ENDR CrsrDevGlobals RECORD 0 firstCrsrDev ds.l 1 ; head of the cursor device list firstCrsrData ds.l 1 ; points to THE ONLY cursor data record SetCrsrDelayVector ds.l 1 ; points to routine that updates screen crsr delay

DrawCrsrVBLVector ds.l 1 ; vectors final drawing stage of CrsrDevHandleVBL

CrsrDevFlags ds.b 1 ; Flags MoreCrsrDevFlags ds.b 1 ; reserved ds.l 1 ; future expansion

CrsrGlobSize EQU * ENDR ; ; CrsrDevFlags bit definitions ; SkipDraw equ 0 ; Skip Draw flag forces the CrsrDevHandleVBL routine ; to skip drawing the cursor. DrawCrsrVector EQU $1FB8 ; jump entry for DrawCursor

EraseCrsrVector EQU $1FBC ; jump entry for EraseCursor

;--------------------- ; Misc. equates ;--------------------- ;mouseAddr EQU 3 ; default address of mice extDevHand EQU 04 ; handler 04 = extended type mouse device ;v EQU 0 ; point offsets ;h EQU 2 frameRate EQU 67 ; 67 frames/sec