]> icculus.org git repositories - btb/d2x.git/blob - main/kconfig.h
fix a bug introduced with change of 2004-06-26
[btb/d2x.git] / main / kconfig.h
1 /* $Id: kconfig.h,v 1.4 2004-05-21 02:46:07 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Prototypes for reading controls
18  *
19  * Old Log:
20  * Revision 1.1  1995/05/16  15:58:27  allender
21  * Initial revision
22  *
23  * Revision 2.0  1995/02/27  11:29:38  john
24  * New version 2.0, which has no anonymous unions, builds with
25  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
26  *
27  * Revision 1.23  1995/01/12  11:41:44  john
28  * Added external control reading.
29  *
30  * Revision 1.22  1994/12/07  16:15:30  john
31  * Added command to check to see if a joystick axes has been used.
32  *
33  * Revision 1.21  1994/11/29  03:46:29  john
34  * Added joystick sensitivity; Added sound channels to detail menu.  Removed -maxchannels
35  * command line arg.
36  *
37  * Revision 1.20  1994/11/22  16:54:45  mike
38  * autorepeat on missiles.
39  *
40  * Revision 1.19  1994/11/07  14:01:27  john
41  * Changed the gamma correction sequencing.
42  *
43  * Revision 1.18  1994/11/01  16:40:02  john
44  * Added Gamma correction.
45  *
46  * Revision 1.17  1994/10/25  23:09:24  john
47  * Made the automap key configurable.
48  *
49  * Revision 1.16  1994/10/24  19:56:51  john
50  * Made the new user setup prompt for config options.
51  *
52  * Revision 1.15  1994/10/24  17:44:18  john
53  * Added stereo channel reversing.
54  *
55  * Revision 1.14  1994/10/22  13:19:33  john
56  * Took out toggle primary/secondary weapons.  Fixed black
57  * background for 'axes' and 'buttons' text.
58  *
59  * Revision 1.13  1994/10/17  13:06:51  john
60  * Moved the descent.cfg info into the player config file.
61  *
62  * Revision 1.12  1994/10/14  12:14:47  john
63  * Changed code so that by doing DEL+F12 saves the current kconfig
64  * values as default. Added support for drop_bomb key.  Took out
65  * unused slots for keyboard.  Made keyboard use control_type of 0
66  * save slots.
67  *
68  * Revision 1.11  1994/10/13  19:21:33  john
69  * Added separate config saves for different devices.
70  * Made all the devices work together better, such as mice won't
71  * get read when you're playing with the joystick.
72  *
73  * Revision 1.10  1994/10/13  15:18:41  john
74  * Started ripping out old afterburner, show message, show automap
75  * keys in the keyboard config stuff.
76  *
77  * Revision 1.9  1994/10/13  11:35:27  john
78  * Made Thrustmaster FCS Hat work.  Put a background behind the
79  * keyboard configure.  Took out turn_sensitivity.  Changed sound/config
80  * menu to new menu. Made F6 be calibrate joystick.
81  *
82  * Revision 1.8  1994/10/06  14:10:50  matt
83  * New function reset_cruise()
84  *
85  * Revision 1.7  1994/10/03  14:58:25  john
86  * Added rear_view_down_state so that the rear view can
87  * work like the automap.
88  *
89  * Revision 1.6  1994/09/30  12:37:25  john
90  * Added midi,digi volume to configuration.
91  *
92  * Revision 1.5  1994/09/19  18:49:59  john
93  * Added switch to disable joystick.
94  *
95  * Revision 1.4  1994/09/15  16:11:21  john
96  * Added support for VFX1 head tracking. Fixed bug with memory over-
97  * write when using stereo mode.
98  *
99  * Revision 1.3  1994/09/12  11:47:38  john
100  * Made stupid cruise work better.  Make kconfig values get
101  * read/written to disk.
102  *
103  * Revision 1.2  1994/09/10  15:46:55  john
104  * First version of new keyboard configuration.
105  *
106  * Revision 1.1  1994/09/10  13:51:40  john
107  * Initial revision
108  *
109  *
110  */
111
112
113 #ifndef _KCONFIG_H
114 #define _KCONFIG_H
115
116 #include "config.h"
117 #include "gamestat.h"
118
119 typedef struct _control_info {
120         fix pitch_time;
121         fix vertical_thrust_time;
122         fix heading_time;
123         fix sideways_thrust_time;
124         fix bank_time;
125         fix forward_thrust_time;
126
127         ubyte rear_view_down_count;
128         ubyte rear_view_down_state;
129
130         ubyte fire_primary_down_count;
131         ubyte fire_primary_state;
132         ubyte fire_secondary_state;
133         ubyte fire_secondary_down_count;
134         ubyte fire_flare_down_count;
135
136         ubyte drop_bomb_down_count;
137
138         ubyte automap_down_count;
139         ubyte automap_state;
140
141         //vms_angvec heading;
142         //char oem_message[64];
143
144         ubyte afterburner_state;
145         ubyte cycle_primary_count;
146         ubyte cycle_secondary_count;
147         ubyte headlight_count;
148 } control_info;
149
150 typedef struct ext_control_info {
151         fix pitch_time;
152         fix vertical_thrust_time;
153         fix heading_time;
154         fix sideways_thrust_time;
155         fix bank_time;
156         fix forward_thrust_time;
157
158         ubyte rear_view_down_count;
159         ubyte rear_view_down_state;
160
161         ubyte fire_primary_down_count;
162         ubyte fire_primary_state;
163         ubyte fire_secondary_state;
164         ubyte fire_secondary_down_count;
165         ubyte fire_flare_down_count;
166
167         ubyte drop_bomb_down_count;
168
169         ubyte automap_down_count;
170         ubyte automap_state;
171
172         //vms_angvec heading;               // for version >=1.0
173         //char oem_message[64];         // for version >=1.0
174
175         //vms_vector ship_pos           // for version >=2.0
176         //vms_matrix ship_orient        // for version >=2.0
177
178         //ubyte cycle_primary_count     // for version >=3.0
179         //ubyte cycle_secondary_count   // for version >=3.0
180         //ubyte afterburner_state       // for version >=3.0
181         //ubyte headlight_count         // for version >=3.0
182
183         // everything below this line is for version >=4.0
184
185         //ubyte headlight_state
186
187         //int primary_weapon_flags
188         //int secondary_weapon_flags
189         //ubyte Primary_weapon_selected
190         //ubyte Secondary_weapon_selected
191
192         //vms_vector force_vector
193         //vms_matrix force_matrix
194         //int joltinfo[3]
195         //int x_vibrate_info[2]
196         //int y_vibrate_info[2]
197
198         //int x_vibrate_clear
199         //int y_vibrate_clear
200
201         //ubyte game_status;
202
203         //ubyte keyboard[128];          // scan code array, not ascii
204         //ubyte current_guidebot_command;
205
206         //ubyte Reactor_blown
207
208 } ext_control_info;
209
210 typedef struct advanced_ext_control_info {
211         fix pitch_time;
212         fix vertical_thrust_time;
213         fix heading_time;
214         fix sideways_thrust_time;
215         fix bank_time;
216         fix forward_thrust_time;
217
218         ubyte rear_view_down_count;
219         ubyte rear_view_down_state;
220
221         ubyte fire_primary_down_count;
222         ubyte fire_primary_state;
223         ubyte fire_secondary_state;
224         ubyte fire_secondary_down_count;
225         ubyte fire_flare_down_count;
226
227         ubyte drop_bomb_down_count;
228
229         ubyte automap_down_count;
230         ubyte automap_state;
231
232         // everything below this line is for version >=1.0
233
234         vms_angvec heading;
235         char oem_message[64];
236
237         // everything below this line is for version >=2.0
238
239         vms_vector ship_pos;
240         vms_matrix ship_orient;
241
242         // everything below this line is for version >=3.0
243
244         ubyte cycle_primary_count;
245         ubyte cycle_secondary_count;
246         ubyte afterburner_state;
247         ubyte headlight_count;
248
249         // everything below this line is for version >=4.0
250
251         int primary_weapon_flags;
252         int secondary_weapon_flags;
253         ubyte current_primary_weapon;
254         ubyte current_secondary_weapon;
255
256         vms_vector force_vector;
257         vms_matrix force_matrix;
258         int joltinfo[3];
259         int x_vibrate_info[2];
260         int y_vibrate_info[2];
261
262         int x_vibrate_clear;
263         int y_vibrate_clear;
264
265         ubyte game_status;
266
267         ubyte headlight_state;
268         ubyte current_guidebot_command;
269
270         ubyte keyboard[128];    // scan code array, not ascii
271
272         ubyte Reactor_blown;
273
274 } advanced_ext_control_info;
275
276 extern ubyte ExtGameStatus;
277 extern control_info Controls;
278 extern void controls_read_all();
279 extern void kconfig(int n, char *title);
280
281 // added on 2/4/99 by Victor Rachels to add new keys menu
282 #define NUM_D2X_CONTROLS    20
283 #define MAX_D2X_CONTROLS    40
284
285 extern ubyte kconfig_d2x_settings[MAX_D2X_CONTROLS];
286 extern ubyte default_kconfig_d2x_settings[MAX_D2X_CONTROLS];
287 // end this section addition - VR
288
289 #define NUM_KEY_CONTROLS    57
290 #define NUM_OTHER_CONTROLS  31
291 #define MAX_CONTROLS        60          // there are actually 48, so this leaves room for more
292
293 extern ubyte kconfig_settings[CONTROL_MAX_TYPES][MAX_CONTROLS];
294 extern ubyte default_kconfig_settings[CONTROL_MAX_TYPES][MAX_CONTROLS];
295
296 extern char *control_text[CONTROL_MAX_TYPES];
297
298 extern void kc_set_controls();
299
300 // Tries to use vfx1 head tracking.
301 void kconfig_sense_init();
302
303 //set the cruise speed to zero
304 extern void reset_cruise(void);
305
306 extern int kconfig_is_axes_used(int axis);
307
308 extern void kconfig_init_external_controls(int intno, int address);
309
310 // the following methods added by WraithX, 4/17/00
311 extern int isJoyRotationKey(int test_key);       //tells if "test_key" is setup for rotation on the joy
312 extern int isMouseRotationKey(int test_key);     //tells if "test_key" is setup for rotation on the mouse
313 extern int isKeyboardRotationKey(int test_key);  //tells if "test_key" is setup for rotation on the keyboard
314 // end addition - WraithX
315
316 #endif /* _KCONFIG_H */