home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / sphinx / cyberman.h__ < prev    next >
Text File  |  1994-06-24  |  3KB  |  80 lines

  1. /*
  2.     SPHINX Programming (C) 1994.
  3.     NAME:  CYBERMAN.H--
  4.     DESCRIPTION:  This file supplies complete access to a Logitech CyberMan
  5.                   device via the SWIFT (SenseWare InterFace Technology)
  6.                   device interface standard.  SWIFT functions are provided
  7.                   by Logitech mouse drivers version 6.31 or later.
  8.     LAST MODIFIED:  25 June 1994
  9.     PROCEDURES DEFINED IN THIS FILE:
  10.     : void CYBERMAN_FEEDBACK(byte motor_on_time,byte motor_off_time,
  11.                                  byte duration)
  12.     : byte cyberman_installed()
  13.         : void GET_CYBERMAN()
  14. */
  15.  
  16. // these variables are filled by calling GET_CYBERMAN();
  17. int cyberman_xpos=0;  /* x position:  254 values from -8128 to +8064 in
  18.                                     increments of 64 */
  19. int cyberman_ypos=0;  /* y position:  254 values from -8128 to +8064 in
  20.                                     increments of 64 */
  21. int cyberman_zpos=0;        /*  z position:  -8192, 0 or +8191 */
  22. int cyberman_pitchvalue=0;  /* pitch value:  -8192, 0 or +8191 */
  23. int cyberman_rollvalue=0;   /*  roll value:  -8192, 0 or +8191 */
  24. int cyberman_yawvalue=0;    /*   yaw value:  -8192, 0 or +8191 */
  25. word cyberman_buttons=0;  /* bit 0 == Right Button (1 = pressed)
  26.                              bit 1 == Middle Button (1 = pressed)
  27.                              bit 2 == Left Button (1 = pressed)
  28.                              bit 3 == Button 4
  29.                              bit 4 == Button 5
  30.                              bit 5 == Button 6
  31.                              bit 6 == Button 7
  32.                              bits 7-15 == Reserved */
  33.  
  34.  
  35.  
  36. : byte cyberman_installed ()
  37. /* Returns TRUE if a CyberMan and Driver is installed, otherwise it returns
  38.    FALSE.
  39. */
  40. byte cyber_buf[10];
  41. {
  42. ES = SS;
  43. DX = #cyber_buf;
  44. AX = 0x53C1;
  45. $INT 0x33
  46. IF( AX != 1 )
  47.     return(FALSE);
  48. IF( cyber_buf[0] != 1 )
  49.     return(FALSE);
  50. return(TRUE);
  51. }
  52.  
  53.  
  54. : void CYBERMAN_FEEDBACK () /* (byte motor_on_time,byte motor_off_time,
  55.                                    byte duration) */
  56. /*
  57. motor_on_time is motor on time in 5 ms units.
  58. motor_off_time is motor on time in 5 ms units.
  59. duration is length of time of feedback in units of 40 ms.
  60. */
  61. {
  62. BH = AL;
  63. AX = 0x5330;
  64. $INT 0x33
  65. }
  66.  
  67.  
  68. : void GET_CYBERMAN ()
  69. /* Obtains button and location status info of the Cyberman from the driver.
  70.    The results are stored in the 'cyber_' variables.
  71. */
  72. {
  73. ES = CS;
  74. DX = #cyberman_xpos;
  75. AX = 0x5301;
  76. $INT 0x33
  77. }
  78.  
  79.  
  80. /* end of CYBERMAN.H-- */