QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools


Table of Contents


This trap reads the pointer.

Call ParametersReturn Parameters
D0.B $71 D0.L Error return
D1.L x,y coordinates D1.L x,y coordinates
D2.L Termination vector D2.L Preserved.
D3.W Timeout D3.L Preserved.
A0.L Channel ID A0.L Preserved.
A1.L Pointer to pointer record. A1.L Preserved.


ERR_NOChannel not open
ERR_NCNot Complete


  • All registers not listed above are preserved.
  • Both the call and return parameters in D1.L are in absolute coordinates.
  • The LSB of D2 determines which pointer event will cause the routine to return as follows:
    • Bit 0 Key or button stroke in window.
    • Bit 1 Key or button pressed (subject to auto repeat).
    • Bit 2 Key or button up in window.
    • Bit 3 Pointer moved from position in D1.L
    • Bit 4 Pointer out of window.
    • Bit 5 Pointer in window.
    • Bit 6 Pointer sprite has hit the edge of the screen.
    • Bit 7 Window request - see next Note
  • Bit 7 is set to request a pointer "hit" regardless of whether the pointer is inside or outside the window. This call must be made with D3.W = -1. While 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 1. If bit 0 is set then the move sprite will be used: if bit 1 is set then the change sprite will be used: otherwise the empty window sprite will be used. If bit 7 is set, all other bits except 0 and 1 must be zero.
  • The MSB of D2 determines which Job Events should cause a return. A Job Event is a number from 1 to 8 and corresponds to bits 24 to 31 of D2.L.


The following example shows how to find where the pointer is. It 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.txt · Last modified: 2015/09/21 10:42 by george.gwilt