Exemple #1
0
void joydefs_calibrate()
{

	int i;
	int temp_values[MAX_AXES];
	char title[50];
	char text[256];
//added/killed on 10/17/98 by Hans de Goede for joystick/mouse # fix
//-killed-        int nsticks = 0;
//end this section kill - Hans

	joydefs_calibrate_flag = 0;

	if (!joy_present)	{
		nm_messagebox( NULL, 1, TXT_OK, TXT_NO_JOYSTICK );
		return;
	}

	if (j_joystick[0].version) {
		joycal_message ("No Calibration", "calibration not required for\njoystick v1.x");
		return;
	}
	
	for (i = 0; i < j_num_axes; i += 2) {
		sprintf (title, "js%d Calibration", j_axis[i].joydev);

		sprintf (text, "center joystick %d", j_axis[i].joydev);
		joycal_message (title, text);
		joystick_read_raw_axis (JOY_ALL_AXIS, temp_values);
		j_axis[i].center_val = temp_values[i];
		j_axis[i + 1].center_val = temp_values[i + 1];

		sprintf (text, "move joystick %d to the upper left", j_axis[i].joydev);
		joycal_message (title, text);
		joystick_read_raw_axis (JOY_ALL_AXIS, temp_values);
		j_axis[i].min_val = temp_values[i];
		j_axis[i + 1].min_val = temp_values[i + 1];

		sprintf (text, "move joystick %d to the lower right", j_axis[i].joydev);
		joycal_message (title, text);
		joystick_read_raw_axis (JOY_ALL_AXIS, temp_values);
		j_axis[i].max_val = temp_values[i];
		j_axis[i + 1].max_val = temp_values[i + 1];

	}
	
	WriteConfigFile ();
}
Exemple #2
0
void JoyDefsCalibrate()
{
  joycal_message("No Calibration", "calibration should be performed\nthrough windows");
  return;
}