home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 499.lha / GamePortDeviceToolKit / gameport.lzh / src / DeviceToolKits / GamePort / test / test9.c < prev    next >
C/C++ Source or Header  |  1991-01-03  |  1KB  |  52 lines

  1. #include <stdio.h>
  2.  
  3. #include "DeviceToolKits/GamePort.h"
  4. #ifndef  TESTPROTO
  5. #define  NO_PRAGMAS  1
  6. #endif
  7. #include "DeviceToolKits/proto/GamePort.h"
  8. #include "DeviceToolKits/GamePortBase.h"
  9.  
  10. LONG  joy0dat;
  11. LONG  joy1dat;
  12. LONG  lbutton0;
  13. LONG  lbutton1;
  14. LONG  rbutton0;
  15. LONG  rbutton1;
  16. LONG  mbutton0;
  17. LONG  mbutton1;
  18.  
  19. main(argc,argv)
  20. int   argc;
  21. char  *argv[];
  22. {
  23.  
  24. #ifdef   TESTSHARED
  25. /*  Open the GamePort library  */
  26.  
  27.    DTGamePortOpen(DTGAMEPORTREV);
  28. #endif
  29.  
  30. /*  Read the joystick ports  */
  31.  
  32.    while (1) {
  33.       joy0dat = DTGamePortJoy0Dat();
  34.       joy1dat = DTGamePortJoy1Dat();
  35.       lbutton0 = DTGamePortLButton0();
  36.       lbutton1 = DTGamePortLButton1();
  37.       rbutton0 = DTGamePortRButton0();
  38.       rbutton1 = DTGamePortRButton1();
  39.       mbutton0 = DTGamePortMButton0();
  40.       mbutton1 = DTGamePortMButton1();
  41.       printf("Joy0: %x  Joy1: %x\n",joy0dat,joy1dat);
  42.       printf("Buttons: %x %x %x %x %x %x\n",lbutton0,lbutton1,
  43.                rbutton0,rbutton1,mbutton0,mbutton1);
  44.       Delay(25L);
  45.    }
  46.  
  47. #ifdef   TESTSHARED
  48.    DTGamePortClose();
  49. #endif
  50. }
  51.  
  52.