home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / volume_3.zip / MOUSE.CPP < prev    next >
C/C++ Source or Header  |  1995-10-08  |  19KB  |  656 lines

  1. #include <dos.h>
  2. #include <conio.h>
  3. #include <stdio.h>
  4.  
  5. #ifndef __MOUSE_H
  6.     #include "c:\tc\mouse.h"
  7. #endif
  8.  
  9.  
  10. union REGS MouseInRegister,MouseOutRegister;
  11. struct SREGS segregs;
  12.  
  13. int MousePresent = FALSE;
  14. int JoyStickPresent = FALSE;
  15.  
  16. //To change the default Hot_Spots
  17. //Mouse_Hot_Spot_Sw = TRUE;
  18. //Then just change the number X and Y
  19. //After that change Mouse_Hot_Spot_Sw back to FALSE
  20. //You will have to do this each time for the cursor slection
  21. //if you change it say a hourglass then change the hot spot,
  22. //then set switch back to false, then change to a arrow cursor using
  23. //the default hot spot. You then go back to the hourglass you
  24. //will have to set sw true and the change the number again or
  25. //it will use default settings.
  26. //These are global variables!
  27. int Mouse_Hot_Spot_X,Mouse_Hot_Spot_Y;
  28. int Mouse_Hot_Spot_Sw = FALSE;
  29.  
  30. ///////////////////////////////////////////////////////////////////////////
  31. //*************************************************************************
  32. //*************************************************************************
  33. //********************** Joystick Routines ********************************
  34. //*************************************************************************
  35. //*************************************************************************
  36. ///////////////////////////////////////////////////////////////////////////
  37.  
  38. //******************************************************
  39. //********* JoyStick Function XY ***********************
  40. //******************************************************
  41. int JoyStick_XY(int *A_X,int *A_Y,int *B_X,int *B_Y)
  42. {
  43. MouseInRegister.x.ax = JOYSTICK_RESET;
  44. MouseInRegister.x.dx = JOYSTICK_XY;
  45. int86(JOYSTICK_INTERRUPT, &MouseInRegister, &MouseOutRegister);
  46. if (MouseOutRegister.x.cflag)
  47.     {
  48.     return FALSE;
  49.     }
  50. *A_X = MouseOutRegister.x.ax;
  51. *A_Y = MouseOutRegister.x.bx;
  52. *B_X = MouseOutRegister.x.cx;
  53. *B_Y = MouseOutRegister.x.dx;
  54. return TRUE;
  55. }
  56.  
  57. //******************************************************
  58. //********* JoyStick Function Buttons ******************
  59. //******************************************************
  60. int JoyStick_Switches(int *switch_0,int *switch_1,int *switch_2,int *switch_3)
  61. {
  62. MouseInRegister.x.ax = JOYSTICK_RESET;
  63. MouseInRegister.x.dx = JOYSTICKBUTTONS;
  64. int86(JOYSTICK_INTERRUPT, &MouseInRegister, &MouseOutRegister);
  65. if (MouseOutRegister.x.cflag)
  66.     {
  67.      return FALSE;
  68.     }
  69. *switch_0 = BOOL(MouseOutRegister.h.al & 0x10);
  70. *switch_1 = BOOL(MouseOutRegister.h.al & 0x20);
  71. *switch_2 = BOOL(MouseOutRegister.h.al & 0x40);
  72. *switch_3 = BOOL(MouseOutRegister.h.al & 0x80);
  73. return TRUE;
  74. }
  75.  
  76.  
  77.  
  78.  
  79. ///////////////////////////////////////////////////////////////////////////
  80. //*************************************************************************
  81. //*************************************************************************
  82. //********************** Mouse Routines ***********************************
  83. //*************************************************************************
  84. //*************************************************************************
  85. ///////////////////////////////////////////////////////////////////////////
  86.  
  87.  
  88. //***********************************************************
  89. //********** Determine's rather a mouse is present **********
  90. //***********************************************************
  91. int Detect_Mouse(void)
  92. {
  93.  
  94. //Check to see if an interrupt is ready
  95. if(getvect(MOUSE_INTERRUPT))
  96.     {
  97.     MouseInRegister.x.ax = RESETMOUSE;  //assigns 0x0000 to variable
  98.                        //in ax register
  99.     //Turns on mouse and gets info
  100.     //sends reset into Register ax
  101.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  102.  
  103.  
  104.     if(MouseOutRegister.x.ax != FALSE)            //Mouse     present = -1
  105.         {                                 //Mouse not present = 0
  106.         MousePresent = TRUE;
  107.         return TRUE;
  108.         }
  109.     else
  110.         {
  111.         printf("MOUSE NOT INSTALLED");
  112.         while (!kbhit()) /* do nothing */ ;
  113.         return FALSE;
  114.         }
  115.  
  116.     }
  117. else
  118.     {
  119.     printf("No Mouse Present");
  120.     while (!kbhit()) /* do nothing */ ;
  121.     }
  122. return FALSE;
  123. }
  124.  
  125.  
  126. //****************************************************
  127. //******** Set's Mouse's Sensitivity *****************
  128. //****************************************************
  129. void Mouse_Sens(int Speed_X,int Speed_Y,int threshold)
  130. {
  131. if(MousePresent == FALSE)return;
  132. MouseInRegister.x.ax = SETMOUSESENSITIVITY;  //0x1A
  133. MouseInRegister.x.bx = Speed_X;
  134. MouseInRegister.x.cx = Speed_Y;
  135. MouseInRegister.x.dx = threshold;
  136.  
  137. if(getvect(MOUSE_INTERRUPT))
  138.     {
  139.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  140.     }
  141. return;
  142. }
  143.  
  144.  
  145.  
  146. //****************************************************
  147. //******** Get's Mouse's Sensitivity *****************
  148. //****************************************************
  149. void Mouse_Sens(int *Speed_X,int *Speed_Y,int *threshold)
  150. {
  151. if(MousePresent == FALSE)return;
  152. MouseInRegister.x.ax = GETMOUSESENSITIVITY;  //0x1B
  153.  
  154. if(getvect(MOUSE_INTERRUPT))
  155.     {
  156.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  157.     *Speed_X = MouseOutRegister.x.bx;
  158.     *Speed_Y = MouseOutRegister.x.cx;
  159.     *threshold = MouseOutRegister.x.dx;
  160.     }
  161. return;
  162. }
  163.  
  164.  
  165. //*********************************************************************
  166. //******** Mouse Movement since last Call to this function ************
  167. //*********************************************************************
  168. void Mouse_Motion(int *Mickeys_X,int *Mickeys_Y)
  169. {
  170. if(MousePresent == FALSE)return;
  171. MouseInRegister.x.ax = MOUSEMOTION; //0x0B
  172. if(getvect(MOUSE_INTERRUPT))
  173.     {
  174.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  175.     *Mickeys_X = MouseOutRegister.x.cx;
  176.     *Mickeys_Y = MouseOutRegister.x.dx;
  177.     }
  178. return;
  179. }
  180.  
  181. void Hide_Mouse_XY(int left_X,int right_X,int top_Y,int bottom_Y)
  182. {
  183. if(MousePresent == FALSE)return;
  184. MouseInRegister.x.ax = HIDEMOUSEXY; //0x10
  185. MouseInRegister.x.cx = left_X;
  186. MouseInRegister.x.si = right_X;
  187. MouseInRegister.x.dx = top_Y;
  188. MouseInRegister.x.di = bottom_Y;
  189. if(getvect(MOUSE_INTERRUPT))
  190.     {
  191.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  192.     }
  193. return;
  194. }
  195.  
  196.  
  197. //******************************************************
  198. //******* Moves Mouse to New Position ******************
  199. //******************************************************
  200. void Move_Mouse(int Mouse_X,int Mouse_Y)
  201. {
  202. if(MousePresent == FALSE)return;
  203. MouseInRegister.x.ax = MOVEMOUSE; //0x04
  204. MouseInRegister.x.cx = Mouse_X;
  205. MouseInRegister.x.dx = Mouse_Y;
  206. if(getvect(MOUSE_INTERRUPT))
  207.     {
  208.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  209.     }
  210. return;
  211. }
  212.  
  213.  
  214. //****************************************************
  215. //***** Sets Mouse Horiz min and max movement ********
  216. //****************************************************
  217.  
  218. void Horiz_Mouse_Limit(int Mouse_X_Min,int Mouse_X_Max)
  219. {
  220. if(MousePresent == FALSE)return;
  221. MouseInRegister.x.ax = MOUSELIMITX;  //0x07
  222. MouseInRegister.x.cx = Mouse_X_Min;
  223. MouseInRegister.x.dx = Mouse_X_Max;
  224.  
  225. if(getvect(MOUSE_INTERRUPT))
  226.     {
  227.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  228.     }
  229. return;
  230. }
  231.  
  232.  
  233. //****************************************************
  234. //***** Returns Mouse X & Y at Button Press   ********
  235. //****************************************************
  236.  
  237. int Button_Press_XY(int *Mouse_X,int *Mouse_Y,int Button_Check)
  238. {
  239. if(MousePresent == FALSE)return 0;
  240. MouseInRegister.x.ax = BUTTON_PRESS_XY; //0x05
  241. MouseInRegister.x.bx = Button_Check;
  242.  
  243. if(getvect(MOUSE_INTERRUPT))
  244.     {
  245.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  246.     *Mouse_X = MouseOutRegister.x.cx;
  247.     *Mouse_Y = MouseOutRegister.x.dx;
  248.     }
  249. return MouseOutRegister.x.ax;
  250. ;
  251. }
  252.  
  253.  
  254. //****************************************************
  255. //***** Returns Mouse X & Y at Button Release  ********
  256. //****************************************************
  257.  
  258. int Button_Release_XY(int *Mouse_X,int *Mouse_Y,int Button_Check)
  259. {
  260. if(MousePresent == FALSE)return 0;
  261. MouseInRegister.x.ax = BUTTON_RELEASE_XY;  //0x06
  262. MouseInRegister.x.bx = Button_Check;
  263.  
  264. if(getvect(MOUSE_INTERRUPT))
  265.     {
  266.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  267.     *Mouse_X = MouseOutRegister.x.cx;
  268.     *Mouse_Y = MouseOutRegister.x.dx;
  269.     }
  270. return MouseOutRegister.x.ax;
  271. ;
  272. }
  273.  
  274.  
  275.  
  276. //****************************************************
  277. //***** Sets Mouse Vert min and max movement ********
  278. //****************************************************
  279.  
  280. void Vert_Mouse_Limit(int Mouse_Y_Min,int Mouse_Y_Max)
  281. {
  282. if(MousePresent == FALSE)return;
  283. MouseInRegister.x.ax = MOUSELIMITY; //0x08
  284. MouseInRegister.x.cx = Mouse_Y_Min;
  285. MouseInRegister.x.dx = Mouse_Y_Max;
  286.  
  287. if(getvect(MOUSE_INTERRUPT))
  288.     {
  289.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  290.     }
  291. return;
  292. }
  293.  
  294. ////////////////////////////////////////////////////////////////////////
  295. //****************************************************
  296. //***** Returns the mouse X and Y position   *********
  297. //****************************************************
  298. int Mouse_Position(int *Mouse_X,int *Mouse_Y)
  299. {
  300. int Button;
  301. if(MousePresent == FALSE)return 0;
  302. MouseInRegister.x.ax = MOUSEPOSITION;   //0x03
  303. if(getvect(MOUSE_INTERRUPT))
  304.     {
  305.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  306.     Button   = MouseOutRegister.x.bx;
  307.     *Mouse_X = MouseOutRegister.x.cx;
  308.     *Mouse_Y = MouseOutRegister.x.dx;
  309.     }
  310. if(Button)
  311.     return Button;
  312. else
  313.     return FALSE;
  314. }
  315.  
  316.  
  317. ////////////////////////////////////////////////////////////
  318. //*************************************
  319. //* Loop till no buttons held down    *
  320. //*************************************
  321. void Button_Up(void)
  322. {
  323. if(MousePresent == FALSE)return;
  324. int Button = TRUE;
  325. while(Button)
  326.     {
  327.     MouseInRegister.x.ax = MOUSEPOSITION;
  328.     if(getvect(MOUSE_INTERRUPT))
  329.         {
  330.         int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  331.         Button   = MouseOutRegister.x.bx;
  332.         }
  333.     }
  334. return;
  335. }
  336.  
  337.  
  338.  
  339. //****************************************************
  340. //***** Returns the mouse button held down ************
  341. //****************************************************
  342. int Mouse_Status(void)
  343. {
  344. if(MousePresent == FALSE)return FALSE;
  345. MouseInRegister.x.ax = MOUSEPOSITION; //0x03
  346. if(getvect(MOUSE_INTERRUPT))
  347.     {
  348.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  349.     return MouseOutRegister.x.bx;
  350.     }
  351.  
  352. return FALSE;
  353. }
  354.  
  355.  
  356.  
  357.  
  358.  
  359. //////////////////////////////////
  360.  
  361. //***********************************************************
  362. //********** Determine's rather a mouse is present **********
  363. //********** & the number of buttons on mouse      **********
  364. //***********************************************************
  365. int Number_Of_Buttons(void)
  366. {
  367. if(MousePresent == FALSE)return FALSE;
  368. //Check to see if an interrupt is ready
  369. if(getvect(MOUSE_INTERRUPT))
  370.     {
  371.     MouseInRegister.x.ax = RESETMOUSE;  //assigns 0x0000 to variable
  372.                        //in ax register
  373.     //Turns on mouse and gets info
  374.     //sends reset into Register ax
  375.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  376.     return MouseOutRegister.x.bx;
  377.     }
  378. return FALSE;
  379. }
  380.  
  381.  
  382. //*********************************************************
  383. //********** Displays Mouse cursor arrow on screen ********
  384. //*********************************************************
  385. void Display_Mouse()
  386. {
  387. if(MousePresent == FALSE)return;
  388. MouseInRegister.x.ax = SHOWMOUSE;   //0x01
  389. if(getvect(MOUSE_INTERRUPT))
  390.         {
  391.         int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  392.         }
  393. return;
  394. }
  395. //*************************************************************
  396. //************* Hides mouse cursor ****************************
  397. //*************************************************************
  398. void Hide_Mouse()
  399. {
  400. if(MousePresent == FALSE)return;
  401. MouseInRegister.x.ax = HIDEMOUSE; //0x02
  402. if(getvect(MOUSE_INTERRUPT))
  403.     {
  404.     int86(MOUSE_INTERRUPT,&MouseInRegister,&MouseOutRegister);
  405.     }
  406. return;
  407. }
  408.  
  409.  
  410.  
  411. //***********************************************************
  412. //*********** Cursor Shape Change ***************************
  413. //***********************************************************
  414. void Cursor_Shape(int cursor_select)
  415. {
  416.  
  417. if(MousePresent == TRUE)
  418. {
  419.   switch(cursor_select)
  420.     {
  421.     case 1: //Space Ship
  422.         {
  423.           static int curs1[32] =  /* Screen Mask SPACE */
  424.                  {      0xfe7f, 0xfc3f, 0xfc3f, 0xe817,
  425.                      0xe817, 0xe817, 0xe817, 0xe007,
  426.                      0xe247, 0xe247, 0xc663, 0xc423,
  427.                      0x8ff1, 0x8001, 0x8db1, 0x07e0,
  428.                      /* Cursor Mask */
  429.                      0x0180, 0x03c0, 0x03c0, 0x17e8,
  430.                      0x17e8, 0x17e8, 0x17e8, 0x1ff8,
  431.                      0x1e78, 0x1db8, 0x399c, 0x3bdc,
  432.                      0x700e, 0x7ffe, 0x724e, 0xf81f       };
  433.                    //      }
  434.           /* Use the new cursor shape and attributes... */
  435.           MouseInRegister.x.ax = 9;
  436.           if(!Mouse_Hot_Spot_Sw)
  437.             {
  438.               Mouse_Hot_Spot_X = 8;
  439.               Mouse_Hot_Spot_Y = 10;
  440.              }
  441.           MouseInRegister.x.bx = Mouse_Hot_Spot_X;  /* X position hotspot */
  442.           MouseInRegister.x.cx = Mouse_Hot_Spot_Y;  /* Y position hotspot */
  443.           MouseInRegister.x.dx = (int)curs1;
  444.           segread(&segregs);
  445.           segregs.es = segregs.ds;
  446.           int86x(0x33,&MouseInRegister,&MouseOutRegister,&segregs);
  447.           break;
  448.         }
  449.  
  450.     case 2:  //Car
  451.         {
  452.           static int curs2[32] =  /* Screen Mask CAR */
  453.                  {      0xe007, 0x2004, 0x0000, 0x07e0,
  454.                      0x27e4, 0xe007, 0xe007, 0xe007,
  455.                      0xe007, 0xe007, 0xe007, 0x27e4,
  456.                      0x07e0, 0x0000, 0x2004, 0xe007,
  457.                      /* Cursor Mask */
  458.                      0x1ff8, 0xdffb, 0xffff, 0xf81f,
  459.                      0xd81b, 0x1ff8, 0x1ff8, 0x1ff8,
  460.                      0x1ff8, 0x1ff8, 0x1ff8, 0xd81b,
  461.                      0xf81f, 0xffff, 0xdffb, 0x1ff8
  462.                     };
  463.  
  464.             /* Use the new cursor shape and attributes... */
  465.           MouseInRegister.x.ax = 9;
  466.           if(!Mouse_Hot_Spot_Sw)
  467.             {
  468.               Mouse_Hot_Spot_X = 8;
  469.               Mouse_Hot_Spot_Y = 10;
  470.             }
  471.           MouseInRegister.x.bx = Mouse_Hot_Spot_X;  /* X position hotspot */
  472.           MouseInRegister.x.cx = Mouse_Hot_Spot_Y;  /* Y position hotspot */
  473.           MouseInRegister.x.dx = (int)curs2;
  474.           segread(&segregs);
  475.           segregs.es = segregs.ds;
  476.           int86x(0x33,&MouseInRegister,&MouseOutRegister,&segregs);
  477.           break;
  478.         }//end case
  479.  
  480.  
  481.  
  482.  
  483.     case 3:
  484.         {  //Hand Cursor
  485.           static int curs3[32] =
  486.             {0xE1FF, 0xE1FF, 0xE1FF, 0xE1FF,
  487.             0xE1FF, 0xE000, 0xE000, 0xE000,
  488.             0x0000, 0x0000, 0x0000, 0x0000,
  489.             0x0000, 0x0000, 0x0000, 0x0000,
  490.            /*  Define cursor mask  */
  491.             0x1E00, 0x1200, 0x1200, 0x1200,
  492.             0x1200, 0x13FF, 0x1249, 0x1249,
  493.             0xF249, 0x9001, 0x9001, 0x9001,
  494.             0x8001, 0x8001, 0x8001, 0xFFFF};
  495.             /* Use the new cursor shape and attributes... */
  496.           MouseInRegister.x.ax = 9;
  497.           if(!Mouse_Hot_Spot_Sw)
  498.             {
  499.               Mouse_Hot_Spot_X = 8;
  500.               Mouse_Hot_Spot_Y = 10;
  501.             }
  502.           MouseInRegister.x.bx = Mouse_Hot_Spot_X;  /* X position hotspot */
  503.           MouseInRegister.x.cx = Mouse_Hot_Spot_Y;  /* Y position hotspot */
  504.           MouseInRegister.x.dx = (int)curs3;
  505.           segread(&segregs);
  506.           segregs.es = segregs.ds;
  507.           int86x(0x33,&MouseInRegister,&MouseOutRegister,&segregs);
  508.           break;
  509.         }//end case
  510.  
  511.        case 4://Hour Glass
  512.         {
  513.            static int curs4[32] =  /* Screen Mask */
  514.              {      0x0000, 0x3ffc, 0x4002, 0xaff5,
  515.                  0xd00b, 0xe817, 0xf42f, 0xfa5f,
  516.                  0xf5af, 0xf5af, 0xebd7, 0xd66b,
  517.                  0xac35, 0x4002, 0x3ffc, 0x0000,
  518.                  /* Cursor Mask */
  519.                  0xffff, 0xc003, 0xbffd, 0x500a,
  520.                  0x2ff4, 0x17e8, 0x0bd0, 0x05a0,
  521.                  0x05a0, 0x0a50, 0x1428, 0x2994,
  522.                  0x53ca, 0xbffd, 0xc003, 0xffff       };
  523.  
  524.           /* Use the new cursor shape and attributes... */
  525.           MouseInRegister.x.ax = 9;
  526.           if(!Mouse_Hot_Spot_Sw)
  527.             {
  528.               Mouse_Hot_Spot_X = 7;
  529.               Mouse_Hot_Spot_Y = 7;
  530.             }
  531.           MouseInRegister.x.bx = Mouse_Hot_Spot_X;  /* X position hotspot */
  532.           MouseInRegister.x.cx = Mouse_Hot_Spot_Y;  /* Y position hotspot */
  533.           MouseInRegister.x.dx = (int)curs4;
  534.           segread(&segregs);
  535.           segregs.es = segregs.ds;
  536.           int86x(0x33,&MouseInRegister,&MouseOutRegister,&segregs);
  537.           break;
  538.         }
  539.  
  540.  
  541.  
  542.        case 5://Text
  543.         {
  544.           static int curs5[32] =  /* Screen Mask */
  545.              {      0xffff, 0xffff, 0xffff, 0xffff,
  546.                  0xffff, 0xffff, 0xffff, 0xffff,
  547.                  0x0000, 0x0000, 0xffff, 0x88a8,
  548.                  0xdbad, 0xd8dd, 0xdbad, 0xd8ad,
  549.                  /* Cursor Mask */
  550.                  0x0000, 0x0000, 0x0000, 0x0000,
  551.                  0x0000, 0x0000, 0x0000, 0x0000,
  552.                  0xffff, 0xffff, 0x0000, 0x7757,
  553.                  0x2452, 0x2722, 0x2452, 0x2752       };
  554.  
  555.           /* Use the new cursor shape and attributes... */
  556.           MouseInRegister.x.ax = 9;
  557.           if(!Mouse_Hot_Spot_Sw)
  558.             {
  559.               Mouse_Hot_Spot_X = 7;
  560.               Mouse_Hot_Spot_Y = 7;
  561.               }
  562.           MouseInRegister.x.bx = Mouse_Hot_Spot_X;  /* X position hotspot */
  563.           MouseInRegister.x.cx = Mouse_Hot_Spot_Y;  /* Y position hotspot */
  564.           MouseInRegister.x.dx = (int)curs5;
  565.           segread(&segregs);
  566.           segregs.es = segregs.ds;
  567.           int86x(0x33,&MouseInRegister,&MouseOutRegister,&segregs);
  568.           break;
  569.         }
  570.  
  571.        case 6://Pencil
  572.         {
  573.  
  574.           static int curs6[32] =  /* Screen Mask */
  575.              {      0xffff, 0xffff, 0xffff, 0xffff,
  576.                  0xff87, 0xff03, 0xfe21, 0xfc11,
  577.                  0xf087, 0xf087, 0xe10f, 0xc21f,
  578.                  0x843f, 0x807f, 0x80ff, 0x81ff,
  579.                  /* Cursor Mask */
  580.                  0x0000, 0x0000, 0x0000, 0x0000,
  581.                  0x0000, 0x0030, 0x0058, 0x00e8,
  582.                  0x01f0, 0x0360, 0x06c0, 0x0d80,
  583.                  0x1b00, 0x1e00, 0x1c00, 0x0000       };
  584.  
  585.           /* Use the new cursor shape and attributes... */
  586.           MouseInRegister.x.ax = 9;
  587.           if(!Mouse_Hot_Spot_Sw)
  588.             {
  589.               Mouse_Hot_Spot_X = 1;
  590.               Mouse_Hot_Spot_Y = 16;
  591.               }
  592.           MouseInRegister.x.bx = Mouse_Hot_Spot_X;  /* X position hotspot */
  593.           MouseInRegister.x.cx = Mouse_Hot_Spot_Y;  /* Y position hotspot */
  594.           MouseInRegister.x.dx = (int)curs6;
  595.           segread(&segregs);
  596.           segregs.es = segregs.ds;
  597.           int86x(0x33,&MouseInRegister,&MouseOutRegister,&segregs);
  598.           break;
  599.         }
  600.  
  601.  
  602.  
  603.  
  604.        default://Arrow
  605.         {
  606.  
  607.  
  608.           static int curs0[32] =  /* Screen Mask */
  609.              {      0x1fff, 0x0fff, 0x07ff, 0x03ff,
  610.                  0x01ff, 0x00ff, 0x007f, 0x003f,
  611.                  0x001f, 0x001f, 0x00ff, 0x10ff,
  612.                  0x387f, 0xf87f, 0xf87f, 0xffff,
  613.                  /* Cursor Mask */
  614.                  0x4000, 0x6000, 0x7000, 0x7800,
  615.                  0x7c00, 0x7e00, 0x7f00, 0x7f80,
  616.                  0x7fc0, 0x7e00, 0x6600, 0x4600,
  617.                  0x0300, 0x0300, 0x0000, 0x0000       };
  618.  
  619.  
  620.           /* Use the new cursor shape and attributes... */
  621.           MouseInRegister.x.ax = 9;
  622.           if(!Mouse_Hot_Spot_Sw)
  623.             {
  624.               Mouse_Hot_Spot_X = 7;
  625.               Mouse_Hot_Spot_Y = 7;
  626.               }
  627.           MouseInRegister.x.bx = Mouse_Hot_Spot_X;  /* X position hotspot */
  628.           MouseInRegister.x.cx = Mouse_Hot_Spot_Y;  /* Y position hotspot */
  629.           MouseInRegister.x.dx = (int)curs0;
  630.           segread(&segregs);
  631.           segregs.es = segregs.ds;
  632.           int86x(0x33,&MouseInRegister,&MouseOutRegister,&segregs);
  633.           break;
  634.         }
  635.  
  636.     }//end switch
  637. //Display_Mouse();
  638. }//end if
  639. return;
  640. }
  641.  
  642.  
  643.     /*   Function 9:  Set Graphics Cursor Block  */
  644. //    MouseInRegister.x.ax = CURSORSHAPE;  //0x09
  645. //    MouseInRegister.x.bx = X_Hot_Spot;
  646. //    MouseInRegister.x.cx = Y_Hot_Spot;
  647. //    MouseInRegister.x.dx = (unsigned short)*cursor;
  648. //    segread(&segregs);
  649. //    segregs.es = segregs.ds;
  650. //    int86x (MOUSE_INTERRUPT, &MouseInRegister, &MouseOutRegister, &segregs);
  651. //    segread(&segregs);
  652. //}
  653. //return;
  654. //}
  655.  
  656.