2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
16 * Joystick Settings Stuff
56 int joydefs_calibrate_flag = 0;
59 ubyte joydefs_calibrating = 0; // stupid hack all because of silly mouse cursor emulation
66 //delay(250); // changed by allender because 1) more portable
67 // 2) was totally broken on PC
73 int joycal_message( char * title, char * text )
77 MAC(joydefs_calibrating = 1;)
78 m[0].type = NM_TYPE_TEXT; m[0].text = text;
79 m[1].type = NM_TYPE_MENU; m[1].text = TXT_OK;
80 i = newmenu_do( title, NULL, 2, m, NULL );
81 MAC(joydefs_calibrating = 0;)
87 extern int WriteConfigFile();
89 void joydefs_calibrate(void)
92 if ( (Config_control_type!=CONTROL_JOYSTICK) && (Config_control_type!=CONTROL_FLIGHTSTICK_PRO) && (Config_control_type!=CONTROL_THRUSTMASTER_FCS) )
95 if ( (Config_control_type == CONTROL_NONE) || (Config_control_type == CONTROL_MOUSE) )
100 apply_modified_palette();
103 gr_palette_load(gr_palette);
105 joydefs_calibrate2();
116 void joydefs_calibrate2()
120 int org_axis_center[4];
123 int axis_min[4] = { 0, 0, 0, 0 };
124 int axis_cen[4] = { 0, 0, 0, 0 };
125 int axis_max[4] = { 0, 0, 0, 0 };
132 joydefs_calibrate_flag = 0;
134 joy_get_cal_vals(org_axis_min, org_axis_center, org_axis_max);
137 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
140 nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK );
144 masks = joy_get_present_mask();
146 if ( masks == JOY_ALL_AXIS )
151 if (Config_control_type == CONTROL_THRUSTMASTER_FCS)
152 nsticks = 1; //ignore for now the Sidewinder Pro X2 axis
154 if ( nsticks == 2 ) {
155 sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT);
156 sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_UL);
158 sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT);
159 sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_UL);
162 if (joycal_message( title, text )) {
163 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
166 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
167 axis_min[0] = temp_values[0];
168 axis_min[1] = temp_values[1];
171 if ( nsticks == 2 ) {
172 sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT);
173 sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_LR);
175 sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT);
176 sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_LR);
178 if (joycal_message( title, text)) {
179 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
182 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
183 axis_max[0] = temp_values[0];
184 axis_max[1] = temp_values[1];
187 if ( nsticks == 2 ) {
188 sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_CENTER);
189 sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_C);
191 sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_CENTER);
192 sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_C);
194 if (joycal_message( title, text)) {
195 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
198 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
199 axis_cen[0] = temp_values[0];
200 axis_cen[1] = temp_values[1];
201 axis_cen[2] = temp_values[2];
204 // The fcs uses axes 3 for hat, so don't calibrate it.
205 if ( Config_control_type == CONTROL_THRUSTMASTER_FCS ) {
206 //set Y2 axis, which is hat
208 axis_cen[3] = temp_values[3]/2;
209 axis_max[3] = temp_values[3];
212 //if X2 exists, calibrate it (for Sidewinder Pro)
213 if ( kconfig_is_axes_used(2) && (masks & JOY_2_X_AXIS) ) {
214 sprintf( title, "Joystick X2 axis\nLEFT");
215 sprintf( text, "Move joystick X2 axis\nall the way left");
216 if (joycal_message( title, text )) {
217 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
220 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
221 axis_min[2] = temp_values[2];
222 axis_min[3] = temp_values[3];
225 sprintf( title, "Joystick X2 axis\nRIGHT");
226 sprintf( text, "Move joystick X2 axis\nall the way right");
227 if (joycal_message( title, text )) {
228 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
231 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
232 axis_max[2] = temp_values[2];
233 axis_max[3] = temp_values[3];
237 masks = joy_get_present_mask();
239 if ( nsticks == 2 ) {
240 if ( kconfig_is_axes_used(2) || kconfig_is_axes_used(3) ) {
241 sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT);
242 sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_UL);
243 if (joycal_message( title, text )) {
244 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
247 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
248 axis_min[2] = temp_values[2];
249 axis_min[3] = temp_values[3];
252 sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT);
253 sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_LR);
254 if (joycal_message( title, text )) {
255 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
258 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
259 axis_max[2] = temp_values[2];
260 axis_max[3] = temp_values[3];
263 sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_CENTER);
264 sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_C);
265 if (joycal_message( title, text )) {
266 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
269 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
270 axis_cen[2] = temp_values[2];
271 axis_cen[3] = temp_values[3];
275 else if ( (!(masks & JOY_2_X_AXIS)) && (masks & JOY_2_Y_AXIS) ) {
276 if ( kconfig_is_axes_used(3) ) {
277 // A throttle axis!!!!!
278 sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_FORWARD);
279 if (joycal_message( title, TXT_MOVE_THROTTLE_F)) {
280 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
283 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
284 axis_min[3] = temp_values[3];
287 sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_REVERSE);
288 if (joycal_message( title, TXT_MOVE_THROTTLE_R)) {
289 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
292 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
293 axis_max[3] = temp_values[3];
296 sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_CENTER);
297 if (joycal_message( title, TXT_MOVE_THROTTLE_C)) {
298 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
301 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
302 axis_cen[3] = temp_values[3];
307 joy_set_cal_vals(axis_min, axis_cen, axis_max);
312 void joydefs_calibrate2()
316 int org_axis_center[4];
319 int axis_min[4] = { 0, 0, 0, 0 };
320 int axis_cen[4] = { 0, 0, 0, 0 };
321 int axis_max[4] = { 0, 0, 0, 0 };
328 joydefs_calibrate_flag = 0;
330 if ( Config_control_type == CONTROL_THRUSTMASTER_FCS ) {
331 axis_cen[0] = axis_cen[1] = axis_cen[2] = 0;
332 axis_min[0] = axis_min[1] = axis_min[2] = -127;
333 axis_max[0] = axis_max[1] = axis_max[2] = 127;
337 joy_set_cal_vals(axis_min, axis_cen, axis_max);
341 if ( Config_control_type == CONTROL_FLIGHTSTICK_PRO ) // no calibration needed
344 joy_get_cal_vals(org_axis_min, org_axis_center, org_axis_max);
347 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
350 nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK );
354 masks = joy_get_present_mask();
356 if ( masks == JOY_ALL_AXIS )
361 if ( (Config_control_type == CONTROL_THRUSTMASTER_FCS) || (Config_control_type == CONTROL_FLIGHTSTICK_PRO) )
362 nsticks = 1; //ignore for now the Sidewinder Pro X2 axis
364 if ( nsticks == 2 ) {
365 sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT);
366 sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_UL);
368 sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT);
369 sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_UL);
372 if (joycal_message( title, text )) {
373 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
376 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
377 axis_min[0] = temp_values[0];
378 axis_min[1] = temp_values[1];
381 if ( nsticks == 2 ) {
382 sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT);
383 sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_LR);
385 sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT);
386 sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_LR);
388 if (joycal_message( title, text)) {
389 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
392 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
393 axis_max[0] = temp_values[0];
394 axis_max[1] = temp_values[1];
397 if ( nsticks == 2 ) {
398 sprintf( title, "%s #1\n%s", TXT_JOYSTICK, TXT_CENTER);
399 sprintf( text, "%s #1 %s", TXT_MOVE_JOYSTICK, TXT_TO_C);
401 sprintf( title, "%s\n%s", TXT_JOYSTICK, TXT_CENTER);
402 sprintf( text, "%s %s", TXT_MOVE_JOYSTICK, TXT_TO_C);
404 if (joycal_message( title, text)) {
405 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
408 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
409 axis_cen[0] = temp_values[0];
410 axis_cen[1] = temp_values[1];
411 axis_cen[2] = temp_values[2];
414 masks = joy_get_present_mask();
416 if ( nsticks == 2 ) {
417 if ( kconfig_is_axes_used(2) || kconfig_is_axes_used(3) ) {
418 sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_UPPER_LEFT);
419 sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_UL);
420 if (joycal_message( title, text )) {
421 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
424 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
425 axis_min[2] = temp_values[2];
426 axis_min[3] = temp_values[3];
429 sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_LOWER_RIGHT);
430 sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_LR);
431 if (joycal_message( title, text )) {
432 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
435 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
436 axis_max[2] = temp_values[2];
437 axis_max[3] = temp_values[3];
440 sprintf( title, "%s #2\n%s", TXT_JOYSTICK, TXT_CENTER);
441 sprintf( text, "%s #2 %s", TXT_MOVE_JOYSTICK, TXT_TO_C);
442 if (joycal_message( title, text )) {
443 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
446 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
447 axis_cen[2] = temp_values[2];
448 axis_cen[3] = temp_values[3];
452 if ( kconfig_is_axes_used(3) ) {
453 // A throttle axis!!!!!
454 sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_FORWARD);
455 if (joycal_message( title, TXT_MOVE_THROTTLE_F)) {
456 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
459 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
460 axis_min[3] = temp_values[3];
463 sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_REVERSE);
464 if (joycal_message( title, TXT_MOVE_THROTTLE_R)) {
465 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
468 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
469 axis_max[3] = temp_values[3];
472 sprintf( title, "%s\n%s", TXT_THROTTLE, TXT_CENTER);
473 if (joycal_message( title, TXT_MOVE_THROTTLE_C)) {
474 joy_set_cal_vals(org_axis_min, org_axis_center, org_axis_max);
477 joystick_read_raw_axis( JOY_ALL_AXIS, temp_values );
478 axis_cen[3] = temp_values[3];
482 joy_set_cal_vals(axis_min, axis_cen, axis_max);
489 //char *control_text[CONTROL_MAX_TYPES] = { "Keyboard only", "Joystick", "Flightstick Pro", "Thrustmaster FCS", "Gravis Gamepad", "Mouse", "Cyberman" };
491 #ifndef MACINTOSH // mac will have own verion of this function
493 #define CONTROL_MAX_TYPES_DOS (CONTROL_MAX_TYPES-1) //last item is windows only
495 void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem )
498 int oc_type = Config_control_type;
504 for (i=0; i<CONTROL_MAX_TYPES_DOS; i++ )
505 if (items[i].value) Config_control_type = i;
507 if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_THRUSTMASTER_FCS ) ) {
508 nm_messagebox( TXT_IMPORTANT_NOTE, 1, TXT_OK, TXT_FCS );
511 if (oc_type != Config_control_type) {
512 switch (Config_control_type) {
513 // case CONTROL_NONE:
514 case CONTROL_JOYSTICK:
515 case CONTROL_FLIGHTSTICK_PRO:
516 case CONTROL_THRUSTMASTER_FCS:
517 // case CONTROL_GRAVIS_GAMEPAD:
518 // case CONTROL_MOUSE:
519 // case CONTROL_CYBERMAN:
520 joydefs_calibrate_flag = 1;
527 #else // ifndef MACINTOSH
529 #define MAX_MAC_CONTROL_TYPES 6
531 char *ch_warning = "Choosing this option will\noverride any settings for Descent II\nin the CH control panels. This\noption provides direct programming\nonly. See the readme for details.";
532 char *tm_warning = "Choosing this option might\ncause settings in the Thrustmaster\ncontrol panels to be overridden\ndepending on the direct inhibition\nsetting in that panel.\nSee the readme for details.";
533 char *ms_warning = "When using a Mousestick II,\nbe sure that there is not a stick\nset active for Descent II.\nHaving a stick set active might cause\nundesirable joystick and\nkeyboard behavior. See\nthe readme for detals.";
534 char *joy_warning = "Please use your joystick's\ncontrol panel to customize the\nbuttons and axis for Descent II.\nSee the joystick's manual for\ninstructions.";
536 void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem )
539 int oc_type = Config_control_type;
540 char *warning_text = NULL;
546 for (i=0; i<MAX_MAC_CONTROL_TYPES; i++ )
547 if (items[i].value) Config_control_type = i;
549 if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_FLIGHTSTICK_PRO ) ) {
550 warning_text = ch_warning;
553 if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_THRUSTMASTER_FCS ) ) {
554 warning_text = tm_warning;
557 if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_GRAVIS_GAMEPAD ) ) {
558 warning_text = ms_warning;
563 nm_messagebox( TXT_IMPORTANT_NOTE, 1, TXT_OK, warning_text );
567 if (oc_type != Config_control_type) {
568 switch (Config_control_type) {
569 case CONTROL_JOYSTICK:
570 case CONTROL_FLIGHTSTICK_PRO:
571 case CONTROL_THRUSTMASTER_FCS:
572 case CONTROL_GRAVIS_GAMEPAD: // this really means a firebird or mousestick
573 joydefs_calibrate_flag = 1;
576 joydefs_set_type( Config_control_type );
583 extern ubyte kc_use_external_control;
584 extern ubyte kc_enable_external_control;
585 extern ubyte *kc_external_name;
591 void joydefs_config()
593 int i, old_masks, masks,nitems;
599 m[0].type = NM_TYPE_RADIO; m[0].text = CONTROL_TEXT(0); m[0].value = 0; m[0].group = 0;
600 m[1].type = NM_TYPE_RADIO; m[1].text = CONTROL_TEXT(1); m[1].value = 0; m[1].group = 0;
601 m[2].type = NM_TYPE_RADIO; m[2].text = CONTROL_TEXT(2); m[2].value = 0; m[2].group = 0;
602 m[3].type = NM_TYPE_RADIO; m[3].text = CONTROL_TEXT(3); m[3].value = 0; m[3].group = 0;
603 // change the text for the thrustmaster
604 m[3].text = "Thrustmaster";
605 m[4].type = NM_TYPE_RADIO; m[4].text = CONTROL_TEXT(4); m[4].value = 0; m[4].group = 0;
606 // change the text of the gravis gamepad to be the mac gravis sticks
607 m[4].text = "Gravis Firebird/MouseStick II";
608 m[5].type = NM_TYPE_RADIO; m[5].text = CONTROL_TEXT(5); m[5].value = 0; m[5].group = 0;
610 m[6].type = NM_TYPE_MENU; m[6].text=TXT_CUST_ABOVE;
611 m[7].type = NM_TYPE_TEXT; m[7].text="";
612 m[8].type = NM_TYPE_SLIDER; m[8].text=TXT_JOYS_SENSITIVITY; m[8].value=Config_joystick_sensitivity; m[8].min_value =0; m[8].max_value = 8;
613 m[9].type = NM_TYPE_TEXT; m[9].text="";
614 m[10].type = NM_TYPE_MENU; m[10].text=TXT_CUST_KEYBOARD;
617 m[Config_control_type].value = 1;
619 i1 = newmenu_do1( NULL, TXT_CONTROLS, nitems, m, joydef_menuset_1, i1 );
620 Config_joystick_sensitivity = m[8].value;
625 for (i=0; i<4; i++ ) {
626 if (kconfig_is_axes_used(i))
629 if ( Config_control_type==0 )
631 Config_control_type=0;
632 else if ( Config_control_type == 1) // this is just a joystick
633 nm_messagebox( TXT_IMPORTANT_NOTE, 1, TXT_OK, joy_warning );
634 else if ( Config_control_type<5 ) {
637 if (Config_control_type == 3)
638 strcpy(title, "Thrustmaster");
639 else if (Config_control_type == 4)
640 strcpy(title, "Gravis Firebird/Mousestick II");
642 strcpy(title, CONTROL_TEXT(Config_control_type) );
647 kconfig(2, CONTROL_TEXT(Config_control_type) );
650 for (i=0; i<4; i++ ) {
651 if (kconfig_is_axes_used(i))
655 switch (Config_control_type) {
656 case CONTROL_JOYSTICK:
657 case CONTROL_FLIGHTSTICK_PRO:
658 case CONTROL_THRUSTMASTER_FCS:
659 case CONTROL_GRAVIS_GAMEPAD:
661 for (i=0; i<4; i++ ) {
662 if ( (masks&(1<<i)) && (!(old_masks&(1<<i))))
663 joydefs_calibrate_flag = 1;
671 kconfig(0, TXT_KEYBOARD);
677 switch (Config_control_type) {
678 case CONTROL_JOYSTICK:
679 // case CONTROL_FLIGHTSTICK_PRO:
680 case CONTROL_THRUSTMASTER_FCS:
681 case CONTROL_GRAVIS_GAMEPAD:
682 if ( joydefs_calibrate_flag )
689 // silly routine to tell the joystick handler which type of control
691 void joydefs_set_type(ubyte type)
697 case CONTROL_NONE: joy_type = JOY_AS_NONE; break;
698 case CONTROL_JOYSTICK: joy_type = JOY_AS_MOUSE; break;
699 case CONTROL_FLIGHTSTICK_PRO: joy_type = JOY_AS_JOYMANAGER; break;
700 case CONTROL_THRUSTMASTER_FCS: joy_type = JOY_AS_THRUSTMASTER; break;
701 case CONTROL_GRAVIS_GAMEPAD: joy_type = JOY_AS_MOUSESTICK; break;
702 case CONTROL_MOUSE: joy_type = JOY_AS_MOUSE; break;
704 joy_set_type(joy_type);
707 #else // #ifdef MACINTOSH
709 //NOTE: UNIX/DOS VERSION
710 void joydefs_config()
712 int i, old_masks, masks,nitems;
719 m[0].type = NM_TYPE_RADIO; m[0].text = CONTROL_TEXT(0); m[0].value = 0; m[0].group = 0;
720 m[1].type = NM_TYPE_RADIO; m[1].text = CONTROL_TEXT(1); m[1].value = 0; m[1].group = 0;
721 m[2].type = NM_TYPE_RADIO; m[2].text = CONTROL_TEXT(2); m[2].value = 0; m[2].group = 0;
722 m[3].type = NM_TYPE_RADIO; m[3].text = CONTROL_TEXT(3); m[3].value = 0; m[3].group = 0;
723 m[4].type = NM_TYPE_RADIO; m[4].text = CONTROL_TEXT(4); m[4].value = 0; m[4].group = 0;
724 m[5].type = NM_TYPE_RADIO; m[5].text = CONTROL_TEXT(5); m[5].value = 0; m[5].group = 0;
725 m[6].type = NM_TYPE_RADIO; m[6].text = CONTROL_TEXT(6); m[6].value = 0; m[6].group = 0;
727 m[ 7].type = NM_TYPE_MENU; m[ 7].text=TXT_CUST_ABOVE;
728 m[ 8].type = NM_TYPE_TEXT; m[ 8].text="";
729 m[ 9].type = NM_TYPE_SLIDER; m[ 9].text=TXT_JOYS_SENSITIVITY; m[9].value=Config_joystick_sensitivity; m[9].min_value =0; m[9].max_value = 8;
730 m[10].type = NM_TYPE_TEXT; m[10].text="";
731 m[11].type = NM_TYPE_MENU; m[11].text=TXT_CUST_KEYBOARD;
733 m[Config_control_type].value = 1;
735 if ( kc_use_external_control ) {
736 sprintf( xtext, "Enable %s", kc_external_name );
737 m[12].type = NM_TYPE_CHECK; m[12].text = xtext; m[12].value = kc_enable_external_control;
741 m[nitems].type = NM_TYPE_MENU; m[nitems].text="CUSTOMIZE D2X KEYS"; nitems++;
743 i1 = newmenu_do1( NULL, TXT_CONTROLS, nitems, m, joydef_menuset_1, i1 );
744 Config_joystick_sensitivity = m[9].value;
749 for (i=0; i<4; i++ ) {
750 if (kconfig_is_axes_used(i))
753 if ( Config_control_type==0 )
754 kconfig(0, TXT_KEYBOARD);
755 else if ( Config_control_type<5 )
756 kconfig(1, CONTROL_TEXT(Config_control_type) );
758 kconfig(2, CONTROL_TEXT(Config_control_type) );
761 for (i=0; i<4; i++ ) {
762 if (kconfig_is_axes_used(i))
766 switch (Config_control_type) {
767 case CONTROL_JOYSTICK:
768 case CONTROL_FLIGHTSTICK_PRO:
769 case CONTROL_THRUSTMASTER_FCS:
771 for (i=0; i<4; i++ ) {
772 if ( (masks&(1<<i)) && (!(old_masks&(1<<i))))
773 joydefs_calibrate_flag = 1;
781 kconfig(0, TXT_KEYBOARD);
784 kconfig(4, "D2X KEYS");
788 if ( kc_use_external_control ) {
789 kc_enable_external_control = m[12].value;
794 switch (Config_control_type) {
795 case CONTROL_JOYSTICK:
796 case CONTROL_FLIGHTSTICK_PRO:
797 case CONTROL_THRUSTMASTER_FCS:
798 if ( joydefs_calibrate_flag )
805 #endif // ifdef MACINTOSH