home *** CD-ROM | disk | FTP | other *** search
/ Teach Yourself Game Programming in 21 Days / TYGAMES_R.ISO / source / gamelib / graph7j.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-16  |  1.7 KB  |  56 lines

  1.  
  2. // D E F I N E S  ////////////////////////////////////////////////////////////
  3.  
  4.  
  5. #define JOYPORT      0x201  // joyport is at 201 hex
  6.  
  7. #define BUTTON_1_1   0x10   // joystick 1, button 1
  8. #define BUTTON_1_2   0x20   // joystick 1, button 2
  9. #define BUTTON_2_1   0x40   // joystick 2, button 1
  10. #define BUTTON_2_2   0x80   // joystick 2, button 2
  11.  
  12. #define JOYSTICK_1   0x01   // joystick 1, in general
  13. #define JOYSTICK_2   0x02   // joystick 2, in general
  14.  
  15. #define JOYSTICK_1_X 0x01   // joystick 1, x axis
  16. #define JOYSTICK_1_Y 0x02   // joystick 1, y axis
  17. #define JOYSTICK_2_X 0x04   // joystick 2, x axis
  18. #define JOYSTICK_2_Y 0x08   // joystick 2, y axis
  19.  
  20.  
  21. #define JOY_1_CAL       1   // command to calibrate joystick #1
  22. #define JOY_2_CAL       2   // command to calibrate joystick #2
  23.  
  24.  
  25. // G L O B A L S  ////////////////////////////////////////////////////////////
  26.  
  27. extern unsigned int joy_1_max_x,   // global joystick calibration variables
  28.                     joy_1_max_y,
  29.                     joy_1_min_x,
  30.                     joy_1_min_y,
  31.                     joy_1_cx,
  32.                     joy_1_cy,
  33.                     joy_2_max_x,
  34.                     joy_2_max_y,
  35.                     joy_2_min_x,
  36.                     joy_2_min_y,
  37.                     joy_2_cx,
  38.                     joy_2_cy;
  39.  
  40.  
  41. // P R O T O T Y P E S ///////////////////////////////////////////////////////
  42.  
  43. unsigned char Buttons(unsigned char button);
  44.  
  45. unsigned int Joystick(unsigned char stick);
  46.  
  47. unsigned int Joystick_Bios(unsigned char stick);
  48.  
  49. unsigned char Buttons_Bios(unsigned char button);
  50.  
  51. void Joystick_Calibrate(int stick);
  52.  
  53. int Joystick_Available(int stick_num);
  54.  
  55.  
  56.