Function 9 - Set Graphics Cursor
PSS ID Number: Q19850
Article last modified on 05-14-1993
PSS database name: H_Mouse

3.x 4.x 5.x 6.x 7.x 8.x 9.00

MS-DOS


------------------------------------------------------------------
The information in this article applies to:

- Microsoft Mouse Driver for MS-DOS, versions 3.x, 4.x, 5.x, 6.x, 
  7.x, 8.x, and 9.0
-------------------------------------------------------------------  

Summary:

This article explains Function 9, which is used to define the mouse 
graphics cursor.

   FUNCTION 09: - SET GRAPHICS CURSOR BLOCK
      Inputs:
         AX = 9
         BX = cursor hot spot (horizontal) (range -16 to 16)
         CX = cursor hot spot (vertical) (range -16 to 16)
         DX = offset of cursor array
         ES = segment of cursor array
      Outputs: none

The hot spot is the point in the cursor block to the cursor
coordinates that the mouse driver uses. ES:DX must point at the first
element in the cursor array. The cursor array may be regarded as a
64-bit wide block (or a 32-word-wide block). The first 16 words in the
block are the screen mask, and the second are the cursor mask. The
cursor is arranged on screen in the following way: 

       bit:     0 1 2 3 4 5 6 7 8 9 A B C D E F
      word: 1   . . . . . . . . . . . . . . . . (top right)
            2   . . . . . . . . . . . . . . . .
            3   . . . . . . . . . . . . . . . .
            4   . . . . . . . . . . . . . . . .
            5   . . . . . . . . . . . . . . . .
            6   . . . . . . . . . . . . . . . .
            7   . . . . . . . . . . . . . . . .
            8   . . . . . . . . . . . . . . . .
            9   . . . . . . . . . . . . . . . .
           10   . . . . . . . . . . . . . . . .
           11   . . . . . . . . . . . . . . . .
           12   . . . . . . . . . . . . . . . .
           13   . . . . . . . . . . . . . . . .
           14   . . . . . . . . . . . . . . . .
           15   . . . . . . . . . . . . . . . .
           16   . . . . . . . . . . . . . . . . (bottom right)

To draw the cursor, the screen mask is logically ANDed with the screen
data; the result then is ORed with the CURSOR mask. The following is a
table that yields the cursor conditions: 

      if the SCREEN      if the CURSOR         the resulting
      mask bit is:       mask bit is:          screen bit is:
      -------------------------------------------------------
      0                  0                     0
      0                  1                     1
      1                  0                     unchanged
      1                  1                     inverted

Additional reference words: 7.00 7.04 7.05 8.00 8.10 8.20 9.00

Copyright Microsoft Corporation 1993.