comparison src/joystick/os2/joyos2.h @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 173c063d4f55
children
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
11 /*****************************************************************************/ 11 /*****************************************************************************/
12 #ifndef JOYOS2_H 12 #ifndef JOYOS2_H
13 #define JOYOS2_H 13 #define JOYOS2_H
14 14
15 /****** GAMEPORT.SYS joystick definitions, start *****************************/ 15 /****** GAMEPORT.SYS joystick definitions, start *****************************/
16 #define GAME_VERSION 0x20 /* 2.0 First IBM version */ 16 #define GAME_VERSION 0x20 /* 2.0 First IBM version */
17 #define GAMEPDDNAME "GAME$ " 17 #define GAMEPDDNAME "GAME$ "
18 #define IOCTL_CAT_USER 0x80 18 #define IOCTL_CAT_USER 0x80
19 #define GAME_PORT_GET 0x20 /* read GAMEPORT.SYS values */ 19 #define GAME_PORT_GET 0x20 /* read GAMEPORT.SYS values */
20 #define GAME_PORT_RESET 0x60 /* reset joystick mask with given value */ 20 #define GAME_PORT_RESET 0x60 /* reset joystick mask with given value */
21 21
22 #pragma pack(1) /* pack structure size is 1 byte */ 22 #pragma pack(1) /* pack structure size is 1 byte */
23 typedef struct { /* GAMEPORT.SYS structure */ 23 typedef struct
24 USHORT usJs_AxCnt; /* Joystick_A X position */ 24 { /* GAMEPORT.SYS structure */
25 USHORT usJs_AyCnt; /* Joystick_A Y position */ 25 USHORT usJs_AxCnt; /* Joystick_A X position */
26 USHORT usJs_BxCnt; /* Joystick_B X position */ 26 USHORT usJs_AyCnt; /* Joystick_A Y position */
27 USHORT usJs_ByCnt; /* Joystick_B Y position */ 27 USHORT usJs_BxCnt; /* Joystick_B X position */
28 USHORT usJs_ButtonA1Cnt; /* button A1 press count */ 28 USHORT usJs_ByCnt; /* Joystick_B Y position */
29 USHORT usJs_ButtonA2Cnt; /* button A2 press count */ 29 USHORT usJs_ButtonA1Cnt; /* button A1 press count */
30 USHORT usJs_ButtonB1Cnt; /* button B1 press count */ 30 USHORT usJs_ButtonA2Cnt; /* button A2 press count */
31 USHORT usJs_ButtonB2Cnt; /* button B2 press count */ 31 USHORT usJs_ButtonB1Cnt; /* button B1 press count */
32 UCHAR ucJs_JoyStickMask; /* mask of connected joystick pots */ 32 USHORT usJs_ButtonB2Cnt; /* button B2 press count */
33 UCHAR ucJs_ButtonStatus; /* bits of switches down */ 33 UCHAR ucJs_JoyStickMask; /* mask of connected joystick pots */
34 ULONG ulJs_Ticks; /* joystick clock ticks */ 34 UCHAR ucJs_ButtonStatus; /* bits of switches down */
35 ULONG ulJs_Ticks; /* joystick clock ticks */
35 } GAME_PORT_STRUCT; 36 } GAME_PORT_STRUCT;
36 #pragma pack() /*reset to normal pack size */ 37 #pragma pack() /*reset to normal pack size */
37 /****** GAMEPORT.SYS joystick definitions, end *******************************/ 38 /****** GAMEPORT.SYS joystick definitions, end *******************************/
38 39
39 40
40 /****************************************************************************/ 41 /****************************************************************************/
41 #define GAME_GET_VERSION 0x01 42 #define GAME_GET_VERSION 0x01
68 #define JOY_ALL_BUTS (JOY_BUT1_BIT|JOY_BUT2_BIT|JOY_BUT3_BIT|JOY_BUT4_BIT) 69 #define JOY_ALL_BUTS (JOY_BUT1_BIT|JOY_BUT2_BIT|JOY_BUT3_BIT|JOY_BUT4_BIT)
69 /****************************************************************************/ 70 /****************************************************************************/
70 71
71 /****************************************************************************/ 72 /****************************************************************************/
72 // 1-D position struct used for each axis 73 // 1-D position struct used for each axis
73 typedef SHORT GAME_POS; /* some data formats require signed values */ 74 typedef SHORT GAME_POS; /* some data formats require signed values */
74 75
75 // simple 2-D position for each joystick 76 // simple 2-D position for each joystick
76 typedef struct 77 typedef struct
77 { 78 {
78 GAME_POS x; 79 GAME_POS x;
79 GAME_POS y; 80 GAME_POS y;
80 } 81 }
81 GAME_2DPOS_STRUCT; 82 GAME_2DPOS_STRUCT;
82 83
83 // struct defining the instantaneous state of both sticks and all buttons 84 // struct defining the instantaneous state of both sticks and all buttons
84 typedef struct 85 typedef struct
85 { 86 {
86 GAME_2DPOS_STRUCT A; 87 GAME_2DPOS_STRUCT A;
87 GAME_2DPOS_STRUCT B; 88 GAME_2DPOS_STRUCT B;
88 USHORT butMask; 89 USHORT butMask;
89 } 90 }
90 GAME_DATA_STRUCT; 91 GAME_DATA_STRUCT;
91 92
92 // struct to be used for calibration and digital response on each axis 93 // struct to be used for calibration and digital response on each axis
93 typedef struct 94 typedef struct
94 { 95 {
95 GAME_POS lower; 96 GAME_POS lower;
96 GAME_POS centre; 97 GAME_POS centre;
97 GAME_POS upper; 98 GAME_POS upper;
98 } 99 }
99 GAME_3POS_STRUCT; 100 GAME_3POS_STRUCT;
100 /****************************************************************************/ 101 /****************************************************************************/
101 102
102 /****************************************************************************/ 103 /****************************************************************************/
103 // status struct returned to OS/2 applications: 104 // status struct returned to OS/2 applications:
104 // current data for all sticks as well as button counts since last read 105 // current data for all sticks as well as button counts since last read
105 typedef struct 106 typedef struct
106 { 107 {
107 GAME_DATA_STRUCT curdata; 108 GAME_DATA_STRUCT curdata;
108 USHORT b1cnt; 109 USHORT b1cnt;
109 USHORT b2cnt; 110 USHORT b2cnt;
110 USHORT b3cnt; 111 USHORT b3cnt;
111 USHORT b4cnt; 112 USHORT b4cnt;
112 } 113 }
113 GAME_STATUS_STRUCT; 114 GAME_STATUS_STRUCT;
114 /****************************************************************************/ 115 /****************************************************************************/
115 116
116 /****************************************************************************/ 117 /****************************************************************************/
133 #define GAME_DATA_FORMAT_SCALED 4 /* [-10,+10] */ 134 #define GAME_DATA_FORMAT_SCALED 4 /* [-10,+10] */
134 135
135 // parameters defining the operation of the driver 136 // parameters defining the operation of the driver
136 typedef struct 137 typedef struct
137 { 138 {
138 USHORT useA; /* new bitmasks: see above */ 139 USHORT useA; /* new bitmasks: see above */
139 USHORT useB; 140 USHORT useB;
140 USHORT mode; /* see consts above */ 141 USHORT mode; /* see consts above */
141 USHORT format; /* see consts above */ 142 USHORT format; /* see consts above */
142 USHORT sampDiv; /* samp freq = 32 / n */ 143 USHORT sampDiv; /* samp freq = 32 / n */
143 USHORT scale; /* scaling factor */ 144 USHORT scale; /* scaling factor */
144 USHORT res1; /* must be 0 */ 145 USHORT res1; /* must be 0 */
145 USHORT res2; /* must be 0 */ 146 USHORT res2; /* must be 0 */
146 } 147 }
147 GAME_PARM_STRUCT; 148 GAME_PARM_STRUCT;
148 /****************************************************************************/ 149 /****************************************************************************/
149 150
150 /****************************************************************************/ 151 /****************************************************************************/
152 // - upper limit on value to be considered in lower range 153 // - upper limit on value to be considered in lower range
153 // - centre value 154 // - centre value
154 // - lower limit on value to be considered in upper range 155 // - lower limit on value to be considered in upper range
155 typedef struct 156 typedef struct
156 { 157 {
157 GAME_3POS_STRUCT Ax; 158 GAME_3POS_STRUCT Ax;
158 GAME_3POS_STRUCT Ay; 159 GAME_3POS_STRUCT Ay;
159 GAME_3POS_STRUCT Bx; 160 GAME_3POS_STRUCT Bx;
160 GAME_3POS_STRUCT By; 161 GAME_3POS_STRUCT By;
161 } 162 }
162 GAME_CALIB_STRUCT; 163 GAME_CALIB_STRUCT;
163 /****************************************************************************/ 164 /****************************************************************************/
164 165
165 /****************************************************************************/ 166 /****************************************************************************/
166 // struct defining the digital response values for all axes 167 // struct defining the digital response values for all axes
167 typedef struct 168 typedef struct
168 { 169 {
169 GAME_3POS_STRUCT Ax; 170 GAME_3POS_STRUCT Ax;
170 GAME_3POS_STRUCT Ay; 171 GAME_3POS_STRUCT Ay;
171 GAME_3POS_STRUCT Bx; 172 GAME_3POS_STRUCT Bx;
172 GAME_3POS_STRUCT By; 173 GAME_3POS_STRUCT By;
173 } 174 }
174 GAME_DIGSET_STRUCT; 175 GAME_DIGSET_STRUCT;
175 /****************************************************************************/ 176 /****************************************************************************/
176 177
177 #endif 178 #endif
179 /* vi: set ts=4 sw=4 expandtab: */