home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / MOGRAPH.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  3.3 KB  |  100 lines

  1. /**
  2. *
  3. * Name        mograph - Set mouse graphics-mode cursor.
  4. *
  5. * Synopsis    ercode = mograph(pmasks,hot_row,hot_col);
  6. *
  7. *        int ercode      Error return code:
  8. *                    MO_OK if successful;
  9. *                    MO_ABSENT if mouse not found.
  10. *        const unsigned *pmasks
  11. *                  Address of array of 32 words
  12. *                  indicating dot or color pattern of
  13. *                  cursor.
  14. *        int hot_row      Row location of cursor's hot spot,
  15. *                  specified in pixels relative to row 0
  16. *                  at the top row of the cursor pattern.
  17. *        int hot_col      Column location of cursor's hot spot,
  18. *                  specified in pixels relative to column
  19. *                  0 at the leftmost column of the
  20. *                  cursor pattern.  In screen modes 4 and
  21. *                  5, this value should be even.
  22. *
  23. * Description    This function defines the shape, color, and center ("hot
  24. *        spot") of the mouse cursor in graphics modes.
  25. *
  26. *        The first sixteen words pointed to by pmasks
  27. *        are the "screen mask", which indicates which
  28. *        bits of the existing screen data should be ignored.
  29. *        The next sixteen words are the "cursor mask",
  30. *        which indicates which bits of the screen
  31. *        data should be inverted.
  32. *
  33. * Example    Here is the default graphics cursor, which is
  34. *        automatically established when the mouse is reset.  The
  35. *        hot spot is at (-1,-1), which is just above and to the
  36. *        left of the upper left corner of the bits shown.
  37. *
  38. *            Screen mask:
  39. *
  40. *            pmasks[ 0] = 0x9fff;     1001111111111111
  41. *            pmasks[ 1] = 0x8fff;     1000111111111111
  42. *            pmasks[ 2] = 0x87ff;     1000011111111111
  43. *            pmasks[ 3] = 0x83ff;     1000001111111111
  44. *            pmasks[ 4] = 0x81ff;     1000000111111111
  45. *            pmasks[ 5] = 0x80ff;     1000000011111111
  46. *            pmasks[ 6] = 0x807f;     1000000001111111
  47. *            pmasks[ 7] = 0x803f;     1000000000111111
  48. *            pmasks[ 8] = 0x801f;     1000000000011111
  49. *            pmasks[ 9] = 0x800f;     1000000000001111
  50. *            pmasks[10] = 0x80ff;     1000000011111111
  51. *            pmasks[11] = 0x887f;     1000100001111111
  52. *            pmasks[12] = 0x987f;     1001100001111111
  53. *            pmasks[13] = 0xfc3f;     1111110000111111
  54. *            pmasks[14] = 0xfc3f;     1111110000111111
  55. *            pmasks[15] = 0xfeff;     1111111011111111
  56. *
  57. *            Cursor mask:
  58. *
  59. *            pmasks[16] = 0x0000;     0000000000000000
  60. *            pmasks[17] = 0x2000;     0010000000000000
  61. *            pmasks[18] = 0x3000;     0011000000000000
  62. *            pmasks[19] = 0x3800;     0011100000000000
  63. *            pmasks[20] = 0x3c00;     0011110000000000
  64. *            pmasks[21] = 0x3e00;     0011111000000000
  65. *            pmasks[22] = 0x3f00;     0011111100000000
  66. *            pmasks[23] = 0x3f80;     0011111110000000
  67. *            pmasks[24] = 0x3fc0;     0011111111000000
  68. *            pmasks[25] = 0x3fe0;     0011111111100000
  69. *            pmasks[26] = 0x3e00;     0011111000000000
  70. *            pmasks[27] = 0x2300;     0010001100000000
  71. *            pmasks[28] = 0x0300;     0000001100000000
  72. *            pmasks[29] = 0x0180;     0000000110000000
  73. *            pmasks[30] = 0x0180;     0000000110000000
  74. *            pmasks[31] = 0x0000;     0000000000000000
  75. *
  76. * Returns    ercode          Error return code:
  77. *                    MO_OK if successful;
  78. *                    MO_ABSENT if mouse driver not installed.
  79. *        b_mouse       Number of mouse buttons (0 if no driver).
  80. *
  81. * Version    6.00 (C)Copyright Blaise Computing Inc.  1989
  82. *
  83. **/
  84.  
  85. #include <bmouse.h>
  86.  
  87. int mograph(pmasks,hot_row,hot_col)
  88. const unsigned *pmasks;
  89. int        hot_row,hot_col;
  90. {
  91.     DOSREG regs;
  92.  
  93.     regs.ax = 9;
  94.     regs.bx = hot_col;
  95.     regs.cx = hot_row;
  96.     regs.dx = utoff(pmasks);
  97.     regs.es = utseg(pmasks);
  98.     return mogate(®s,®s);
  99. }
  100.