home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / glquake_src / psxport.h < prev    next >
C/C++ Source or Header  |  2000-01-20  |  2KB  |  85 lines

  1. #ifndef    PSXPORT_H
  2. #define    PSXPORT_H
  3.  
  4. /*
  5. **    $VER: psxport.h 1.2 (18.01.2000)
  6. **
  7. **    psxport.device definitions
  8. **
  9. **    (C) Copyright 1999-2000 Joseph Fenton. All rights reserved.
  10. */
  11.  
  12. #ifndef DEVICES_INPUTEVENT_H
  13. #include "devices/inputevent.h"
  14. #endif
  15.  
  16. /* extension command for psxport.device */
  17.  
  18. #define    GPD_COMMUNICATE    14
  19.  
  20. /* all controllers */
  21.  
  22. #define    PSX_CLASS(e)    e.ie_Class
  23. #define    PSX_SUBCLASS(e)    e.ie_SubClass
  24. #define    PSX_BUTTONS(e)    e.ie_Code
  25.  
  26. /* class/subclass */
  27.  
  28. #define    PSX_CLASS_MOUSE        0x12
  29. #define    PSX_CLASS_WHEEL        0x23
  30. #define    PSX_CLASS_JOYPAD    0x41
  31. #define    PSX_CLASS_ANALOG_MODE2    0x53
  32. #define    PSX_CLASS_ANALOG    0x73
  33. #define    PSX_CLASS_MULTITAP    0x80    /* will never be received */
  34. #define    PSX_CLASS_ANALOG2    0xF3    /* only Mad Catz Dual Shock returns this */
  35.  
  36. #define    PSX_SUBCLASS_PSX    0x5A    /* all PSX controllers and cards return this */
  37.  
  38. /* note: all buttons are active low */
  39.  
  40. /* joypad */
  41.  
  42. #define    PSX_LEFT    0x8000
  43. #define    PSX_DOWN    0x4000
  44. #define    PSX_RIGHT    0x2000
  45. #define    PSX_UP        0x1000
  46. #define    PSX_START    0x0800
  47. #define    PSX_R3        0x0400        /* R3 and L3 only if PSX_CLASS_ANALOG */
  48. #define    PSX_L3        0x0200        /* or PSX_CLASS_ANALOG2 */
  49. #define    PSX_SELECT    0x0100
  50. #define    PSX_SQUARE    0x0080
  51. #define    PSX_CROSS    0x0040
  52. #define    PSX_CIRCLE    0x0020
  53. #define    PSX_TRIANGLE    0x0010
  54. #define    PSX_R1        0x0008
  55. #define    PSX_L1        0x0004
  56. #define    PSX_R2        0x0002
  57. #define    PSX_L2        0x0001
  58.  
  59. #define    PSX_RIGHTX(e)    (e.ie_X>>8)&0xFF
  60. #define    PSX_RIGHTY(e)    (e.ie_X)&0xFF
  61.  
  62. #define    PSX_LEFTX(e)    (e.ie_Y>>8)&0xFF
  63. #define    PSX_LEFTY(e)    (e.ie_Y)&0xFF
  64.  
  65. /* mouse */
  66.  
  67. #define    PSX_LMB        PSX_R1
  68. #define    PSX_RMB        PSX_L1
  69.  
  70. #define    PSX_MOUSEDX(e)    e.ie_X
  71. #define    PSX_MOUSEDY(e)    e.ie_Y
  72.  
  73. /* wheel */
  74.  
  75. #define    PSX_A        PSX_CIRCLE
  76. #define    PSX_B        PSX_TRIANGLE
  77. #define    PSX_R        PSX_R1
  78.  
  79. #define    PSX_WHEEL(e)    (e.ie_X>>8)&0xFF
  80. #define    PSX_I(e)    (e.ie_X)&0xFF
  81. #define    PSX_II(e)    (e.ie_Y>>8)&0xFF
  82. #define    PSX_L(e)    (e.ie_Y)&0xFF
  83.  
  84. #endif
  85.