This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
qdosmsq:pe:traps:rptr [2009/01/30 09:49]
norman created
qdosmsq:pe:traps:rptr [2015/09/21 11:42] (current)
george.gwilt Adding 'sprite' to definition of Bit 6 of D2.B
Line 1: Line 1:
-====== ​WM.RPTR/RPTRT - Vectors $30/​$78 ​====== +====== ​IOP.RPTR ====== 
- +This trap reads the pointer.
-These read the pointer. ​In addition RPTRT will return on a job event or timeout. +
 ^Call Parameters^^Return Parameters^^ ^Call Parameters^^Return Parameters^^
- D2.B  |job events (RPTRT) D2  |preserved+D0.B | $71 | D0.L | Error return | 
- D3.W  |timeout (RPTRT) D3  |preserved+| D1.L | x,y coordinates | D1.L | x,y coordinates| 
- | |  A0  |channel ID+| D2.L Termination vector | D2.L | Preserved.
- ​A4  ​|pointer ​to working definition ​A4  ​|preserved|+| D3.W | Timeout ​| D3.L Preserved.
 +A0.L Channel ID | A0.L Preserved.
 +A1.L Pointer ​to pointer record. ​A1.L Preserved.|
 ==== Errors ==== ==== Errors ====
- +|ERR_NO|Channel not open| 
-  *Any I/O sub system errors +|ERR_NC|Not Complete ​   |
-  *Any error returned by action or hit routine+
 ==== Notes ==== ==== Notes ====
- +  ​All registers ​not listed above are preserved
-  ​*No other registers are used+  * Both the call and return parameters in D1.L are in absolute coordinates
-  *[[qdosmsq:​pe:​actions:​start|Action or hit routines]] are called as needed. Unless these cause a return, ​the pointer continues to be read+  * The LSB of D2 determines which pointer event will cause the routine to return as follows
-  * The contents ​of D2 and D3 are ignored by WM.RPTR. For RPTRT+    * Bit  Key or button stroke in window
-    *D2.B sets the job events to return on. The events are any combination of to 7, depending on the bit set+    * Bit 1  Key or button pressed (subject ​to auto repeat)
-    *D3.W sets the timeout after which RPTRT returns +    * Bit 2  Key or button up in window
-  *If an action ​or hit routine sets either D4 or D0 to be non zero, the routines will return+    * Bit 3  Pointer moved from position in D1.L 
-  ​*The routines return if an event key is pressed and this does not lead to an action ​or hit routine+    ​Bit 4  Pointer out of window
-  *The routines can call four types of action or hit routine+    * Bit 5  Pointer in window. 
-    *An application ​window ​hit routine. This will normally be dealt with by WM.MHIT+    * Bit 6  Pointer sprite has hit the edge of the screen
-    *An application window control routine. This will normally be dealt with by WM.PANSC+    * Bit 7  Window request - see next Note 
-    *An action routine for menu item in an application ​window. This requires coding by the userWhen this is called certain registers ​are set, as shown under "Call Parameters". The registers noted under "​Return Parameters"​ must be set as shown on exitSee [[qdosmsq:pe:actions:​start#​standard_menu_action_routine|Standard Menu Action Routine]]+  * Bit 7 is set to request ​pointer "​hit"​ regardless of whether the pointer is inside or outside the window. This call must be made with D3.W = -1While this request ​is pending in the top window all windows ​are locked and only the top window gets the "hit". The pointer sprite will be set according to the contents of bits 0 and 1If bit 0 is set then the move sprite will be usedif bit 1 is set then the change sprite will be usedotherwise the empty window sprite will be used. If bit 7 is set, all other bits except 0 and 1 must be zero
-    *An action routine for loose itemThis requires coding by the userWhen this is called certain registers are setas shown under "Call Parameters"​The registers noted under "​Return Parameters"​ must be set as as shown on exitSee [[qdosmsq:​pe:​actions:​start#loose_item_action_routine|Loose Item Action Routine]]+  The MSB of D2 determines which Job Events should cause returnA Job Event is a number from 1 to 8 and corresponds to bits 24 to 31 of D2.L. 
 +==== Example ==== 
 +The following example shows how to find where the pointer isIt is assumed that A4 points to the working definition. 
 +        movea.l ​   ww_wstat(a4),a1      ; Status area (ww_wstat = 0) 
 +        addq.l     #​8,​a1 ​               ; Point to pointer record 
 +        movea.l    ww_chid(a4),​a0 ​      ; Channel ID (ww_chid = 8) 
 +        moveq      ​#0,d1                ; Initial position (not needed) 
 +        moveq      #​48,​d2 ​              ; Return if in or out of window 
 +        moveq      #​-1,​d3 ​              ; Timeout 
 +        trap       #3 
 +        tst.l      d0                   ; OK? . . 
 +        bne        err ----> ​           ; . . no! 
 +; We now have the pointer position in D1 in absolute coordinates 
  • qdosmsq/pe/traps/rptr.1233308988.txt.gz
  • Last modified: 2009/01/30 09:49
  • by norman