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-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
43 int joydefs_calibrate_flag = 0;
45 //added 9/6/98 Matt Mueller - not needed at all in linux code but bunches
46 int Joy_is_Sidewinder=0;// of main/* stuff uses it
51 //int t1 = TICKER + 19/4; // Wait 1/4 second...
53 //while( TICKER < t1 );
59 int joycal_message( char * title, char * text )
63 m[0].type = NM_TYPE_TEXT; m[0].text = text;
64 m[1].type = NM_TYPE_MENU; m[1].text = TXT_OK;
65 i = newmenu_do( title, NULL, 2, m, NULL );
71 extern int WriteConfigFile();
73 extern joystick_device j_joystick[4];
74 extern joystick_axis j_axis[MAX_AXES];
75 extern joystick_button j_button[MAX_BUTTONS];
77 void joydefs_calibrate()
81 int temp_values[MAX_AXES];
84 //added/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix
85 //-killed- int nsticks = 0;
86 //end this section kill - Hans
88 joydefs_calibrate_flag = 0;
91 nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK );
95 if (j_joystick[0].version) {
96 joycal_message ("No Calibration", "calibration not required for\njoystick v1.x");
100 for (i = 0; i < j_num_axes; i += 2) {
101 sprintf (title, "js%d Calibration", j_axis[i].joydev);
103 sprintf (text, "center joystick %d", j_axis[i].joydev);
104 joycal_message (title, text);
105 joystick_read_raw_axis (JOY_ALL_AXIS, temp_values);
106 j_axis[i].center_val = temp_values[i];
107 j_axis[i + 1].center_val = temp_values[i + 1];
109 sprintf (text, "move joystick %d to the upper left", j_axis[i].joydev);
110 joycal_message (title, text);
111 joystick_read_raw_axis (JOY_ALL_AXIS, temp_values);
112 j_axis[i].min_val = temp_values[i];
113 j_axis[i + 1].min_val = temp_values[i + 1];
115 sprintf (text, "move joystick %d to the lower right", j_axis[i].joydev);
116 joycal_message (title, text);
117 joystick_read_raw_axis (JOY_ALL_AXIS, temp_values);
118 j_axis[i].max_val = temp_values[i];
119 j_axis[i + 1].max_val = temp_values[i + 1];
127 //char *control_text[CONTROL_MAX_TYPES] = { "Keyboard only", "Joystick", "Flightstick Pro", "Thrustmaster FCS", "Gravis Gamepad", "Mouse", "Cyberman" };
129 void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem )
132 int oc_type = Config_control_type;
139 if (items[i].value) Config_control_type = i;
141 //added on 10/17/98 by Hans de Goede for joystick/mouse # fix
142 // remap mouse, since "Flightstick Pro", "Thrustmaster FCS"
143 // and "Gravis Gamepad" where removed from the options
144 if (Config_control_type == 2) Config_control_type = CONTROL_MOUSE;
145 //end this section addition - Hans
147 if ( (oc_type != Config_control_type) && (Config_control_type == CONTROL_THRUSTMASTER_FCS ) ) {
148 nm_messagebox( TXT_IMPORTANT_NOTE, 1, TXT_OK, TXT_FCS );
151 if (oc_type != Config_control_type) {
152 switch (Config_control_type) {
153 // case CONTROL_NONE:
154 case CONTROL_JOYSTICK:
155 case CONTROL_FLIGHTSTICK_PRO:
156 case CONTROL_THRUSTMASTER_FCS:
157 case CONTROL_GRAVIS_GAMEPAD:
158 // case CONTROL_MOUSE:
159 // case CONTROL_CYBERMAN:
160 joydefs_calibrate_flag = 1;
167 extern ubyte kc_use_external_control;
168 extern ubyte kc_enable_external_control;
169 extern ubyte *kc_external_name;
171 void joydefs_config()
173 //added/changed/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix
174 //-killed- char xtext[128];
175 //-killed- int i, old_masks, masks;
178 //-killed- int nitems;
181 //-killed- nitems = 6;
182 int i, i1=5, j, nitems=7;
183 //end this section kill/change - Hans
185 m[0].type = NM_TYPE_RADIO; m[0].text = "KEYBOARD"; m[0].value = 0; m[0].group = 0;
186 m[1].type = NM_TYPE_RADIO; m[1].text = "JOYSTICK"; m[1].value = 0; m[1].group = 0;
187 m[2].type = NM_TYPE_RADIO; m[2].text = "MOUSE"; m[2].value = 0; m[2].group = 0;
188 m[3].type = NM_TYPE_TEXT; m[3].text="";
189 m[4].type = NM_TYPE_MENU; m[4].text="CUSTOMIZE ABOVE";
190 m[5].type = NM_TYPE_MENU; m[5].text="CUSTOMIZE KEYBOARD";
191 //added on 2/5/99 by Victor Rachels for D1X keys menu
192 m[6].type = NM_TYPE_MENU; m[6].text="CUSTOMIZE D1X KEYS";
193 //end this section addition - VR
195 //added/changed/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix
196 //-killed- m[Config_control_type].value = 1;
201 i = Config_control_type;
202 if(i==CONTROL_MOUSE) i = 2;
205 //end this section change/addition - Hans
207 i1 = newmenu_do1( NULL, TXT_CONTROLS, nitems, m, joydef_menuset_1, i1 );
209 //added 6-15-99 Owen Evans
210 for (j = 0; j <= 2; j++)
212 Config_control_type = j;
213 i = Config_control_type;
214 if (Config_control_type == 2)
215 Config_control_type = CONTROL_MOUSE;
220 //added/changed on 10/17/98 by Hans de Goede for joystick/mouse # fix
221 //-killed- kconfig(Config_control_type, m[Config_control_type].text);
222 kconfig (i, m[i].text);
223 //end this section change - Hans
226 kconfig(0, "KEYBOARD");
228 //added on 2/5/99 by Victor Rachels for D1X keys menu
230 kconfig(3, "D1X KEYS");
232 //end this section addition - VR