bool crc_ok = true; if (crc32_syspath("<DATA>/exult.flx") != EXULT_FLX_CRC32) { crc_ok = false; cerr << "exult.flx has a wrong checksum!" << endl; } if (U7exists("<DATA>/exult_bg.flx")) { if (crc32_syspath("<DATA>/exult_bg.flx") != EXULT_BG_FLX_CRC32) { crc_ok = false; cerr << "exult_bg.flx has a wrong checksum!" << endl; } } if (U7exists("<DATA>/exult_si.flx")) { if (crc32_syspath("<DATA>/exult_si.flx") != EXULT_SI_FLX_CRC32) { crc_ok = false; cerr << "exult_si.flx has a wrong checksum!" << endl; } }  bool config_ignore_crc; config->value("config/disk/no_crc",config_ignore_crc); ignore_crc |= config_ignore_crc;  if (!ignore_crc && !crc_ok) { cerr << "This usually means the file(s) mentioned above are" << "from a different version" << endl << "of Exult than this one. Please re-install Exult" << endl << endl << "(Note: if you modified the .flx files yourself, " << "you can skip this check" << endl << "by passing the -nocrc parameter.)" << endl;  return 1; }
int exult_main(const char *runpath){	string data_path;	//cout << "Exult V" << VERSION << "." << endl;	getVersionInfo(cout);	// Read in configuration file	config = new Configuration;	config->read_config_file(USER_CONFIGURATION_FILE);	// Setup virtual directories	config->value("config/disk/data_path",data_path,EXULT_DATADIR);	cout << "Data path = " << data_path << endl;	add_system_path("<DATA>", data_path);	if (!U7exists("<DATA>/exult.flx"))	{		add_system_path("<DATA>", EXULT_DATADIR);		if (!U7exists("<DATA>/exult.flx"))		{			add_system_path("<DATA>", "data");			if(!U7exists("<DATA>/exult.flx"))			{				char *sep = std::strrchr(runpath,'/');				int plen = sep-runpath;				char *dpath = new char[plen+10];				std::strncpy(dpath, runpath, plen+1);				dpath[plen+1] = 0;				std::strcat(dpath,"data");				cerr << "dpath = " << dpath << endl;				add_system_path("<DATA>",dpath);				if(!U7exists("<DATA>/exult.flx"))				{					// We've tried them all...					cerr << "Could not find 'exult.flx' anywhere." << endl;						cerr << "Please make sure Exult is correctly installed," << endl;					cerr << "and the Exult data path is specified in the configuration file." << endl;					cerr << "(See the README file for more information)" << endl;					exit(-1);				}			}		}	}	add_system_path("<STATIC>", "static");	add_system_path("<GAMEDAT>", "gamedat");//	add_system_path("<SAVEGAME>", "savegame");	add_system_path("<SAVEGAME>", ".");	// Convert from old format if needed	vector<string> vs=config->listkeys("config/disk/game",false);	if(vs.size()==0)	{		// Convert from the older format		string data_directory;		config->value("config/disk/u7path",data_directory,".");		config->set("config/disk/game/blackgate/path",data_directory,true);		const string	s("blackgate");		config->set("config/disk/game/blackgate/title",s,true);		vs.push_back(s);	}	// This is for Serpent Isle Paperdolls in Black Gate	string	serp_static;	config->value("config/disk/game/serpentisle/path",serp_static,".");	serp_static += "/static";	add_system_path("<SERPENT_STATIC>", serp_static.c_str());	// Enable tracing of intrinsics?	config->value("config/debug/trace/intrinsics",intrinsic_trace);	// Enable tracing of UC-instructions?	string uctrace;	config->value("config/debug/trace/usecode", uctrace, "no");	to_uppercase(uctrace);	if (uctrace == "YES")		usecode_trace = 1;	else if (uctrace == "VERBOSE")		usecode_trace = 2;	else		usecode_trace = 0;	// Save game compression level	config->value("config/disk/save_compression_level", save_compression, 1);	if (save_compression < 0 || save_compression > 2) save_compression = 1;	config->set("config/disk/save_compression_level", save_compression, true);#if USECODE_DEBUGGER	// Enable usecode debugger	config->value("config/debug/debugger/enable",usecode_debugging);	initialise_usecode_debugger();#endif	cheat.init();	Init();				// Create main window.	cheat.finish_init();	Mouse::mouse = new Mouse(gwin);	Mouse::mouse->set_shape(Mouse::hand);	int result = Play();		// start game	return result;}