Exemplo n.º 1
0
// Note that it's easy to add other defaults if desired.
void RestoreDefault() {
	g_controllerMap.clear();
#if defined(_WIN32)
	SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
	SetDefaultKeyMap(DEFAULT_MAPPING_X360, false);
	SetDefaultKeyMap(DEFAULT_MAPPING_PAD, false);
#elif defined(ANDROID)
	// Autodetect a few common devices
	std::string name = System_GetProperty(SYSPROP_NAME);
	if (IsNvidiaShield(name)) {
		SetDefaultKeyMap(DEFAULT_MAPPING_SHIELD, true);
	} else if (IsOuya(name)) {  // TODO: check!
		SetDefaultKeyMap(DEFAULT_MAPPING_OUYA, true);
	} else if (IsXperiaPlay(name)) {
		SetDefaultKeyMap(DEFAULT_MAPPING_XPERIA_PLAY, true);
	} else {
		SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
	}
#elif defined(BLACKBERRY)
	std::string name = System_GetProperty(SYSPROP_NAME);
	if (IsBlackberryQWERTY(name)) {
		SetDefaultKeyMap(DEFAULT_MAPPING_BLACKBERRY_QWERTY, true);
	} else {
		SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
	}
#else
	SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
	SetDefaultKeyMap(DEFAULT_MAPPING_PAD, false);
#endif
}
Exemplo n.º 2
0
const char *DefaultLangRegion() {
	// Unfortunate default.  There's no need to use bFirstRun, since this is only a default.
	static std::string defaultLangRegion = "en_US";
	std::string langRegion = System_GetProperty(SYSPROP_LANGREGION);
	if (i18nrepo.IniExists(langRegion)) {
		defaultLangRegion = langRegion;
	} else if (langRegion.length() >= 3) {
		// Don't give up.  Let's try a fuzzy match - so nl_BE can match nl_NL.
		IniFile mapping;
		mapping.LoadFromVFS("langregion.ini");
		std::vector<std::string> keys;
		mapping.GetKeys("LangRegionNames", keys);

		for (std::string key : keys) {
			if (startsWithNoCase(key, langRegion)) {
				// Exact submatch, or different case.  Let's use it.
				defaultLangRegion = key;
				break;
			} else if (startsWithNoCase(key, langRegion.substr(0, 3))) {
				// Best so far.
				defaultLangRegion = key;
			}
		}
	}

	return defaultLangRegion.c_str();
}
Exemplo n.º 3
0
void ProcessGPUFeatures() {
	gl_extensions.bugs = 0;
	// Should be table driven instead, this is a quick hack for Galaxy Y
	if (System_GetProperty(SYSPROP_NAME) == "samsung:GT-S5360") {
		gl_extensions.bugs |= BUG_FBO_UNUSABLE;
	}
}
Exemplo n.º 4
0
static int DefaultRenderingMode() {
	// Workaround for ancient device. Can probably be removed now as we do no longer
	// support Froyo (Android 2.2)...
	if (System_GetProperty(SYSPROP_NAME) == "samsung:GT-S5360") {
		return 0;  // Non-buffered
	}
	return 1;
}
Exemplo n.º 5
0
const char *DefaultLangRegion() {
	static std::string defaultLangRegion = "en_US";
	if (g_Config.bFirstRun) {
		std::string langRegion = System_GetProperty(SYSPROP_LANGREGION);
		if (i18nrepo.IniExists(langRegion))
			defaultLangRegion = langRegion;
	}

	return defaultLangRegion.c_str();
}
Exemplo n.º 6
0
static bool DefaultShowTouchControls() {
#if defined(MOBILE_DEVICE)
	std::string name = System_GetProperty(SYSPROP_NAME);
	if (KeyMap::HasBuiltinController(name)) {
		return false;
	} else {
		return true;
	}
#else
	return false;
#endif
}
Exemplo n.º 7
0
static bool DefaultShowTouchControls() {
	int deviceType = System_GetPropertyInt(SYSPROP_DEVICE_TYPE);
	if (deviceType == DEVICE_TYPE_MOBILE) {
		std::string name = System_GetProperty(SYSPROP_NAME);
		if (KeyMap::HasBuiltinController(name)) {
			return false;
		} else {
			return true;
		}
	} else if (deviceType == DEVICE_TYPE_TV) {
		return false;
	} else if (deviceType == DEVICE_TYPE_DESKTOP) {
		return false;
	} else {
		return false;
	}
}
Exemplo n.º 8
0
void ProcessGPUFeatures() {
	gl_extensions.bugs = 0;

	ILOG("Checking for GL driver bugs... vendor=%i model='%s'", (int)gl_extensions.gpuVendor, gl_extensions.model);
	// Should be table driven instead, this is a quick hack for Galaxy Y
	if (System_GetProperty(SYSPROP_NAME) == "samsung:GT-S5360") {
		gl_extensions.bugs |= BUG_FBO_UNUSABLE;
	}

	if (gl_extensions.gpuVendor == GPU_VENDOR_POWERVR) {
		if (!strcmp(gl_extensions.model, "PowerVR SGX 543") ||
			  !strcmp(gl_extensions.model, "PowerVR SGX 540") ||
			  !strcmp(gl_extensions.model, "PowerVR SGX 530") ||
				!strcmp(gl_extensions.model, "PowerVR SGX 520") ) {
			WLOG("GL DRIVER BUG: PVR with bad and terrible precision");
			gl_extensions.bugs |= BUG_PVR_SHADER_PRECISION_TERRIBLE | BUG_PVR_SHADER_PRECISION_BAD;
		} else {
			WLOG("GL DRIVER BUG: PVR with bad precision");
			gl_extensions.bugs |= BUG_PVR_SHADER_PRECISION_BAD;
		}
		gl_extensions.bugs |= BUG_PVR_GENMIPMAP_HEIGHT_GREATER;
	}
}
Exemplo n.º 9
0
static int DefaultRenderingMode() {
	if (System_GetProperty(SYSPROP_NAME) == "samsung:GT-S5360") {
		return 0;  // Non-buffered
	}
	return 1;
}
Exemplo n.º 10
0
void NativeInit(int argc, const char *argv[],
								const char *savegame_directory, const char *external_directory, const char *installID) {
#ifdef ANDROID_NDK_PROFILER
	setenv("CPUPROFILE_FREQUENCY", "500", 1);
	setenv("CPUPROFILE", "/sdcard/gmon.out", 1);
	monstartup("ppsspp_jni.so");
#endif

	bool skipLogo = false;
	EnableFZ();
	setlocale( LC_ALL, "C" );
	std::string user_data_path = savegame_directory;
	isMessagePending = false;

#ifdef IOS
	user_data_path += "/";
#elif defined(__APPLE__)
	if (File::Exists(File::GetExeDirectory() + "assets"))
		VFSRegister("", new DirectoryAssetReader((File::GetExeDirectory() + "assets/").c_str()));
	// It's common to be in a build-xyz/ directory.
	else
		VFSRegister("", new DirectoryAssetReader((File::GetExeDirectory() + "../assets/").c_str()));
	VFSRegister("", new DirectoryAssetReader((File::GetExeDirectory()).c_str()));
#endif

	// We want this to be FIRST.
#ifdef USING_QT_UI
	VFSRegister("", new AssetsAssetReader());
#elif defined(BLACKBERRY) || defined(IOS)
	// Packed assets are included in app
	VFSRegister("", new DirectoryAssetReader(external_directory));
#else
	VFSRegister("", new DirectoryAssetReader("assets/"));
#endif
	VFSRegister("", new DirectoryAssetReader(savegame_directory));

	host = new NativeHost();

#if defined(ANDROID)
	g_Config.internalDataDirectory = savegame_directory;
	// Maybe there should be an option to use internal memory instead, but I think
	// that for most people, using external memory (SDCard/USB Storage) makes the
	// most sense.
	g_Config.memCardDirectory = std::string(external_directory) + "/";
	g_Config.flash0Directory = std::string(external_directory) + "/flash0/";
#elif defined(BLACKBERRY) || defined(__SYMBIAN32__) || defined(MEEGO_EDITION_HARMATTAN) || defined(IOS)
	g_Config.memCardDirectory = user_data_path;
	g_Config.flash0Directory = std::string(external_directory) + "/flash0/";
#elif !defined(_WIN32)
	char* config = getenv("XDG_CONFIG_HOME");
	if (!config) {
		config = getenv("HOME");
		strcat(config, "/.config");
	}
	g_Config.memCardDirectory = std::string(config) + "/ppsspp/";
	std::string program_path = File::GetExeDirectory();
	if (program_path.empty())
		g_Config.flash0Directory = g_Config.memCardDirectory + "/flash0/";
	else if (File::Exists(program_path + "flash0"))
		g_Config.flash0Directory = program_path + "flash0/";
	// It's common to be in a build-xyz/ directory.
	else
		g_Config.flash0Directory = program_path + "../flash0/";
#endif

#ifndef _WIN32
	logger = new AndroidLogger();

	LogManager::Init();
	LogManager *logman = LogManager::GetInstance();
	ILOG("Logman: %p", logman);

	g_Config.AddSearchPath(user_data_path);
	g_Config.AddSearchPath(g_Config.memCardDirectory + "PSP/SYSTEM/");
	g_Config.SetDefaultPath(g_Config.memCardDirectory + "PSP/SYSTEM/");
	g_Config.Load();
	g_Config.externalDirectory = external_directory;
#endif

#ifdef ANDROID
	// On Android, create a PSP directory tree in the external_directory,
	// to hopefully reduce confusion a bit. 
	ILOG("Creating %s", (g_Config.memCardDirectory + "PSP").c_str());
	mkDir((g_Config.memCardDirectory + "PSP").c_str());
	mkDir((g_Config.memCardDirectory + "PSP/SAVEDATA").c_str());
	mkDir((g_Config.memCardDirectory + "PSP/GAME").c_str());
#endif

	const char *fileToLog = 0;
	const char *stateToLoad = 0;

	bool gfxLog = false;
	// Parse command line
	LogTypes::LOG_LEVELS logLevel = LogTypes::LINFO;
	for (int i = 1; i < argc; i++) {
		if (argv[i][0] == '-') {
			switch (argv[i][1]) {
			case 'd':
				// Enable debug logging
				// Note that you must also change the max log level in Log.h.
				logLevel = LogTypes::LDEBUG;
				break;
			case 'g':
				gfxLog = true;
				break;
			case 'j':
				g_Config.bJit = true;
				g_Config.bSaveSettings = false;
				break;
			case 'i':
				g_Config.bJit = false;
				g_Config.bSaveSettings = false;
				break;
			case '-':
				if (!strncmp(argv[i], "--log=", strlen("--log=")) && strlen(argv[i]) > strlen("--log="))
					fileToLog = argv[i] + strlen("--log=");
				if (!strncmp(argv[i], "--state=", strlen("--state=")) && strlen(argv[i]) > strlen("--state="))
					stateToLoad = argv[i] + strlen("--state=");
				break;
			}
		} else {
			if (boot_filename.empty()) {
				boot_filename = argv[i];
				skipLogo = true;

				FileInfo info;
				if (!getFileInfo(boot_filename.c_str(), &info) || info.exists == false) {
					fprintf(stderr, "File not found: %s\n", boot_filename.c_str());
					exit(1);
				}
			} else {
				fprintf(stderr, "Can only boot one file");
				exit(1);
			}
		}
	}

	if (fileToLog != NULL)
		LogManager::GetInstance()->ChangeFileLog(fileToLog);

#ifndef _WIN32
	if (g_Config.currentDirectory == "") {
#if defined(ANDROID)
		g_Config.currentDirectory = external_directory;
#elif defined(BLACKBERRY) || defined(__SYMBIAN32__) || defined(MEEGO_EDITION_HARMATTAN) || defined(IOS) || defined(_WIN32)
		g_Config.currentDirectory = savegame_directory;
#else
		g_Config.currentDirectory = getenv("HOME");
#endif
	}

	for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
	{
		LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
		logman->SetEnable(type, true);
		logman->SetLogLevel(type, gfxLog && i == LogTypes::G3D ? LogTypes::LDEBUG : logLevel);
#ifdef ANDROID
		logman->AddListener(type, logger);
#endif
	}
	// Special hack for G3D as it's very spammy. Need to make a flag for this.
	if (!gfxLog)
		logman->SetLogLevel(LogTypes::G3D, LogTypes::LERROR);
	INFO_LOG(BOOT, "Logger inited.");
#endif	

	i18nrepo.LoadIni(g_Config.sLanguageIni);
	I18NCategory *d = GetI18NCategory("DesktopUI");
	// Note to translators: do not translate this/add this to PPSSPP-lang's files. 
	// It's intended to be custom for every user. 
	// Only add it to your own personal copies of PPSSPP.
#ifdef _WIN32
	// TODO: Could allow a setting to specify a font file to load?
	// TODO: Make this a constant if we can sanely load the font on other systems?
	AddFontResourceEx(L"assets/Roboto-Condensed.ttf", FR_PRIVATE, NULL);
	g_Config.sFont = d->T("Font", "Roboto");
#endif

	if (!boot_filename.empty() && stateToLoad != NULL)
		SaveState::Load(stateToLoad);

	g_gameInfoCache.Init();


	screenManager = new ScreenManager();

	if (skipLogo) {
		screenManager->switchScreen(new EmuScreen(boot_filename));
	} else {
		screenManager->switchScreen(new LogoScreen());
	}

	std::string sysName = System_GetProperty(SYSPROP_NAME);
	isOuya = KeyMap::IsOuya(sysName);
}
Exemplo n.º 11
0
void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
	iniFilename_ = FindConfigFile(iniFileName != NULL ? iniFileName : "ppsspp.ini");
	controllerIniFilename_ = FindConfigFile(controllerIniFilename != NULL ? controllerIniFilename : "controls.ini");

	INFO_LOG(LOADER, "Loading config: %s", iniFilename_.c_str());
	bSaveSettings = true;

	IniFile iniFile;
	if (!iniFile.Load(iniFilename_)) {
		ERROR_LOG(LOADER, "Failed to read %s. Setting config to default.", iniFilename_.c_str());
		// Continue anyway to initialize the config.
	}

	IniFile::Section *general = iniFile.GetOrCreateSection("General");

	general->Get("FirstRun", &bFirstRun, true);
	general->Get("RunCount", &iRunCount, 0);
	iRunCount++;
	general->Get("Enable Logging", &bEnableLogging, true);
	general->Get("AutoRun", &bAutoRun, true);
	general->Get("Browse", &bBrowse, false);
	general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true);
	general->Get("CurrentDirectory", &currentDirectory, "");
	general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);
	general->Get("HomebrewStore", &bHomebrewStore, false);

	if (!File::Exists(currentDirectory))
		currentDirectory = "";

	std::string defaultLangRegion = "en_US";
	if (bFirstRun) {
		std::string langRegion = System_GetProperty(SYSPROP_LANGREGION);
		if (i18nrepo.IniExists(langRegion))
			defaultLangRegion = langRegion;
		// TODO: Be smart about same language, different country
	}

	general->Get("Language", &sLanguageIni, defaultLangRegion.c_str());
	general->Get("NumWorkerThreads", &iNumWorkerThreads, cpu_info.num_cores);
	general->Get("EnableAutoLoad", &bEnableAutoLoad, false);
	general->Get("EnableCheats", &bEnableCheats, false);
	general->Get("ScreenshotsAsPNG", &bScreenshotsAsPNG, false);
	general->Get("StateSlot", &iCurrentStateSlot, 0);
	general->Get("RewindFlipFrequency", &iRewindFlipFrequency, 0);
	general->Get("GridView1", &bGridView1, true);
	general->Get("GridView2", &bGridView2, true);
	general->Get("GridView3", &bGridView3, false);

	// "default" means let emulator decide, "" means disable.
	general->Get("ReportingHost", &sReportHost, "default");
	general->Get("Recent", recentIsos);
	general->Get("AutoSaveSymbolMap", &bAutoSaveSymbolMap, false);
#ifdef _WIN32
	general->Get("TopMost", &bTopMost);
	general->Get("WindowX", &iWindowX, -1); // -1 tells us to center the window.
	general->Get("WindowY", &iWindowY, -1);
	general->Get("WindowWidth", &iWindowWidth, 0);   // 0 will be automatically reset later (need to do the AdjustWindowRect dance).
	general->Get("WindowHeight", &iWindowHeight, 0);
	general->Get("PauseOnLostFocus", &bPauseOnLostFocus, false);
#endif

	IniFile::Section *recent = iniFile.GetOrCreateSection("Recent");
	recent->Get("MaxRecent", &iMaxRecent, 30);

	// Fix issue from switching from uint (hex in .ini) to int (dec)
	if (iMaxRecent == 0)
		iMaxRecent = 30;

	recentIsos.clear();
	for (int i = 0; i < iMaxRecent; i++)
	{
		char keyName[64];
		std::string fileName;

		sprintf(keyName,"FileName%d",i);
		if (!recent->Get(keyName,&fileName,"") || fileName.length() == 0) {
			// just skip it to get the next key
		}
		else {
			recentIsos.push_back(fileName);
		}
	}

	IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
#ifdef IOS
	cpu->Get("Jit", &bJit, iosCanUseJit);
#else
	cpu->Get("Jit", &bJit, true);
#endif
	cpu->Get("SeparateCPUThread", &bSeparateCPUThread, false);
	cpu->Get("AtomicAudioLocks", &bAtomicAudioLocks, false);

	cpu->Get("SeparateIOThread", &bSeparateIOThread, true);
	cpu->Get("FastMemoryAccess", &bFastMemory, true);
	cpu->Get("CPUSpeed", &iLockedCPUSpeed, 0);

	IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics");
	graphics->Get("ShowFPSCounter", &iShowFPSCounter, false);

	int renderingModeDefault = 1;  // Buffered
	if (System_GetProperty(SYSPROP_NAME) == "samsung:GT-S5360") {
		renderingModeDefault = 0;  // Non-buffered
	}

	graphics->Get("RenderingMode", &iRenderingMode, renderingModeDefault);
	graphics->Get("SoftwareRendering", &bSoftwareRendering, false);
	graphics->Get("HardwareTransform", &bHardwareTransform, true);
	graphics->Get("SoftwareSkinning", &bSoftwareSkinning, true);
	graphics->Get("TextureFiltering", &iTexFiltering, 1);
	// Auto on Windows, 2x on large screens, 1x elsewhere.
#if defined(_WIN32) && !defined(USING_QT_UI)
	graphics->Get("InternalResolution", &iInternalResolution, 0);
#else
	graphics->Get("InternalResolution", &iInternalResolution, pixel_xres >= 1024 ? 2 : 1);
#endif

	graphics->Get("FrameSkip", &iFrameSkip, 0);
	graphics->Get("FrameRate", &iFpsLimit, 0);
#ifdef _WIN32
	graphics->Get("FrameSkipUnthrottle", &bFrameSkipUnthrottle, false);
#else
	graphics->Get("FrameSkipUnthrottle", &bFrameSkipUnthrottle, true);
#endif
	graphics->Get("ForceMaxEmulatedFPS", &iForceMaxEmulatedFPS, 60);
#ifdef USING_GLES2
	graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 0);
#else
	graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 8);
#endif
	if (iAnisotropyLevel > 4) {
		iAnisotropyLevel = 4;
	}
	graphics->Get("VertexCache", &bVertexCache, true);
#ifdef IOS
	graphics->Get("VertexDecJit", &bVertexDecoderJit, iosCanUseJit);
#else
	graphics->Get("VertexDecJit", &bVertexDecoderJit, true);
#endif

#ifdef _WIN32
	graphics->Get("FullScreen", &bFullScreen, false);
#endif
	bool partialStretchDefault = false;
#ifdef BLACKBERRY
	partialStretchDefault = pixel_xres < 1.3 * pixel_yres;
#endif
	graphics->Get("PartialStretch", &bPartialStretch, partialStretchDefault);
	graphics->Get("StretchToDisplay", &bStretchToDisplay, false);
	graphics->Get("TrueColor", &bTrueColor, true);

	graphics->Get("MipMap", &bMipMap, false);

	graphics->Get("TexScalingLevel", &iTexScalingLevel, 1);
	graphics->Get("TexScalingType", &iTexScalingType, 0);
	graphics->Get("TexDeposterize", &bTexDeposterize, false);
	graphics->Get("VSyncInterval", &bVSync, false);
	graphics->Get("DisableStencilTest", &bDisableStencilTest, false);
	graphics->Get("AlwaysDepthWrite", &bAlwaysDepthWrite, false);
// Has been in use on Symbian since v0.7. Preferred option.
#ifdef __SYMBIAN32__
	graphics->Get("TimerHack", &bTimerHack, true);
#else
	graphics->Get("TimerHack", &bTimerHack, false);
#endif
	graphics->Get("LowQualitySplineBezier", &bLowQualitySplineBezier, false);
	graphics->Get("PostShader", &sPostShaderName, "Off");

	IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
	sound->Get("Enable", &bEnableSound, true);
	sound->Get("VolumeBGM", &iBGMVolume, 7);
	sound->Get("VolumeSFX", &iSFXVolume, 7);
	sound->Get("LowLatency", &bLowLatencyAudio, false);

	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	control->Get("HapticFeedback", &bHapticFeedback, true);
	control->Get("ShowAnalogStick", &bShowTouchAnalogStick, true);
	control->Get("ShowTouchCross", &bShowTouchCross, true);
	control->Get("ShowTouchCircle", &bShowTouchCircle, true);
	control->Get("ShowTouchSquare", &bShowTouchSquare, true);
	control->Get("ShowTouchTriangle", &bShowTouchTriangle, true);
	control->Get("ShowTouchStart", &bShowTouchStart, true);
	control->Get("ShowTouchSelect", &bShowTouchSelect, true);
	control->Get("ShowTouchLTrigger", &bShowTouchLTrigger, true);
	control->Get("ShowTouchRTrigger", &bShowTouchRTrigger, true);
	control->Get("ShowAnalogStick", &bShowTouchAnalogStick, true);
	control->Get("ShowTouchDpad", &bShowTouchDpad, true);
	control->Get("ShowTouchUnthrottle", &bShowTouchUnthrottle, true);

#if defined(USING_GLES2)
	std::string name = System_GetProperty(SYSPROP_NAME);
	if (KeyMap::HasBuiltinController(name)) {
		control->Get("ShowTouchControls", &bShowTouchControls, false);
	} else {
		control->Get("ShowTouchControls", &bShowTouchControls, true);
	}
#else
	control->Get("ShowTouchControls", &bShowTouchControls, false);
#endif
	// control->Get("KeyMapping",iMappingMap);
#ifdef USING_GLES2
	control->Get("AccelerometerToAnalogHoriz", &bAccelerometerToAnalogHoriz, false);

	control->Get("TiltBaseX", &fTiltBaseX, 0);
	control->Get("TiltBaseY", &fTiltBaseY, 0);
	control->Get("InvertTiltX", &bInvertTiltX, false);
	control->Get("InvertTiltY", &bInvertTiltY, true);
	control->Get("TiltSensitivityX", &iTiltSensitivityX, 100);
	control->Get("TiltSensitivityY", &iTiltSensitivityY, 100);
	control->Get("DeadzoneRadius", &fDeadzoneRadius, 0.35);

#endif
	control->Get("DisableDpadDiagonals", &bDisableDpadDiagonals, false);
	control->Get("TouchButtonOpacity", &iTouchButtonOpacity, 65);
	//set these to -1 if not initialized. initializing these
	//requires pixel coordinates which is not known right now.
	//will be initialized in GamepadEmu::CreatePadLayout
	float defaultScale = 1.15f;
	control->Get("ActionButtonSpacing2", &fActionButtonSpacing, 1.0f);
	control->Get("ActionButtonCenterX", &fActionButtonCenterX, -1.0);
	control->Get("ActionButtonCenterY", &fActionButtonCenterY, -1.0);
	control->Get("ActionButtonScale", &fActionButtonScale, defaultScale);
	control->Get("DPadX", &fDpadX, -1.0);
	control->Get("DPadY", &fDpadY, -1.0);
	control->Get("DPadScale", &fDpadScale, defaultScale);
	control->Get("DPadSpacing", &fDpadSpacing, 1.0f);
	control->Get("StartKeyX", &fStartKeyX, -1.0);
	control->Get("StartKeyY", &fStartKeyY, -1.0);
	control->Get("StartKeyScale", &fStartKeyScale, defaultScale);
	control->Get("SelectKeyX", &fSelectKeyX, -1.0);
	control->Get("SelectKeyY", &fSelectKeyY, -1.0);
	control->Get("SelectKeyScale", &fSelectKeyScale, defaultScale);
	control->Get("UnthrottleKeyX", &fUnthrottleKeyX, -1.0);
	control->Get("UnthrottleKeyY", &fUnthrottleKeyY, -1.0);
	control->Get("UnthrottleKeyScale", &fUnthrottleKeyScale, defaultScale);
	control->Get("LKeyX", &fLKeyX, -1.0);
	control->Get("LKeyY", &fLKeyY, -1.0);
	control->Get("LKeyScale", &fLKeyScale, defaultScale);
	control->Get("RKeyX", &fRKeyX, -1.0);
	control->Get("RKeyY", &fRKeyY, -1.0);
	control->Get("RKeyScale", &fRKeyScale, defaultScale);
	control->Get("AnalogStickX", &fAnalogStickX, -1.0);
	control->Get("AnalogStickY", &fAnalogStickY, -1.0);
	control->Get("AnalogStickScale", &fAnalogStickScale, defaultScale);

	// MIGRATION: For users who had the old static touch layout, aren't I nice?
	if (fDpadX > 1.0 || fDpadY > 1.0) // Likely the rest are too!
	{
		fActionButtonCenterX /= dp_xres;
		fActionButtonCenterY /= dp_yres;
		fDpadX /= dp_xres;
		fDpadY /= dp_yres;
		fStartKeyX /= dp_xres;
		fStartKeyY /= dp_yres;
		fSelectKeyX /= dp_xres;
		fSelectKeyY /= dp_yres;
		fUnthrottleKeyX /= dp_xres;
		fUnthrottleKeyY /= dp_yres;
		fLKeyX /= dp_xres;
		fLKeyY /= dp_yres;
		fRKeyX /= dp_xres;
		fRKeyY /= dp_yres;
		fAnalogStickX /= dp_xres;
		fAnalogStickY /= dp_yres;
	}

	IniFile::Section *network = iniFile.GetOrCreateSection("Network");
	network->Get("EnableWlan", &bEnableWlan, false);
	
	IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam");
#ifndef ANDROID
	pspConfig->Get("PSPModel", &iPSPModel, PSP_MODEL_SLIM);
#else
	pspConfig->Get("PSPModel", &iPSPModel, PSP_MODEL_FAT);
#endif
	pspConfig->Get("NickName", &sNickName, "PPSSPP");
	pspConfig->Get("proAdhocServer", &proAdhocServer, "localhost");
	pspConfig->Get("MacAddress", &localMacAddress, "01:02:03:04:05:06");
	pspConfig->Get("Language", &iLanguage, PSP_SYSTEMPARAM_LANGUAGE_ENGLISH);
	pspConfig->Get("TimeFormat", &iTimeFormat, PSP_SYSTEMPARAM_TIME_FORMAT_24HR);
	pspConfig->Get("DateFormat", &iDateFormat, PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD);
	pspConfig->Get("TimeZone", &iTimeZone, 0);
	pspConfig->Get("DayLightSavings", &bDayLightSavings, PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_STD);
	pspConfig->Get("ButtonPreference", &iButtonPreference, PSP_SYSTEMPARAM_BUTTON_CROSS);
	pspConfig->Get("LockParentalLevel", &iLockParentalLevel, 0);
	pspConfig->Get("WlanAdhocChannel", &iWlanAdhocChannel, PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC);
#ifdef _WIN32
	pspConfig->Get("BypassOSKWithKeyboard", &bBypassOSKWithKeyboard, false);
#endif
	pspConfig->Get("WlanPowerSave", &bWlanPowerSave, PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF);
	pspConfig->Get("EncryptSave", &bEncryptSave, true);

	IniFile::Section *debugConfig = iniFile.GetOrCreateSection("Debugger");
	debugConfig->Get("DisasmWindowX", &iDisasmWindowX, -1);
	debugConfig->Get("DisasmWindowY", &iDisasmWindowY, -1);
	debugConfig->Get("DisasmWindowW", &iDisasmWindowW, -1);
	debugConfig->Get("DisasmWindowH", &iDisasmWindowH, -1);
	debugConfig->Get("GEWindowX", &iGEWindowX, -1);
	debugConfig->Get("GEWindowY", &iGEWindowY, -1);
	debugConfig->Get("GEWindowW", &iGEWindowW, -1);
	debugConfig->Get("GEWindowH", &iGEWindowH, -1);
	debugConfig->Get("ConsoleWindowX", &iConsoleWindowX, -1);
	debugConfig->Get("ConsoleWindowY", &iConsoleWindowY, -1);
	debugConfig->Get("FontWidth", &iFontWidth, 8);
	debugConfig->Get("FontHeight", &iFontHeight, 12);
	debugConfig->Get("DisplayStatusBar", &bDisplayStatusBar, true);
	debugConfig->Get("ShowBottomTabTitles",&bShowBottomTabTitles,true);
	debugConfig->Get("ShowDeveloperMenu", &bShowDeveloperMenu, false);
	debugConfig->Get("SkipDeadbeefFilling", &bSkipDeadbeefFilling, false);

	IniFile::Section *speedhacks = iniFile.GetOrCreateSection("SpeedHacks");
	speedhacks->Get("PrescaleUV", &bPrescaleUV, false);
	speedhacks->Get("DisableAlphaTest", &bDisableAlphaTest, false);

	IniFile::Section *jitConfig = iniFile.GetOrCreateSection("JIT");
	jitConfig->Get("DiscardRegsOnJRRA", &bDiscardRegsOnJRRA, false);

	IniFile::Section *upgrade = iniFile.GetOrCreateSection("Upgrade");
	upgrade->Get("UpgradeMessage", &upgradeMessage, "");
	upgrade->Get("UpgradeVersion", &upgradeVersion, "");
	upgrade->Get("DismissedVersion", &dismissedVersion, "");
	
	if (dismissedVersion == upgradeVersion) {
		upgradeMessage = "";
	}

	// Check for new version on every 5 runs.
	// Sometimes the download may not be finished when the main screen shows (if the user dismisses the
	// splash screen quickly), but then we'll just show the notification next time instead, we store the
	// upgrade number in the ini.
	if (iRunCount % 5 == 0) {
		g_DownloadManager.StartDownloadWithCallback(
			"http://www.ppsspp.org/version.json", "", &DownloadCompletedCallback);
	}

	INFO_LOG(LOADER, "Loading controller config: %s", controllerIniFilename_.c_str());
	bSaveSettings = true;

	IniFile controllerIniFile;
	if (!controllerIniFile.Load(controllerIniFilename_)) {
		ERROR_LOG(LOADER, "Failed to read %s. Setting controller config to default.", controllerIniFilename_.c_str());
		KeyMap::RestoreDefault();
	} else {
		// Continue anyway to initialize the config. It will just restore the defaults.
		KeyMap::LoadFromIni(controllerIniFile);
	}

	CleanRecent();
}
Exemplo n.º 12
0
Arquivo: view.cpp Projeto: PGGB/native
void TextEdit::Key(const KeyInput &input) {
	if (!HasFocus())
		return;
	// Process navigation keys. These aren't chars.
	if (input.flags & KEY_DOWN) {
		switch (input.keyCode) {
		case NKCODE_CTRL_LEFT:
		case NKCODE_CTRL_RIGHT:
			ctrlDown_ = true;
			break;
		case NKCODE_DPAD_LEFT:  // ASCII left arrow
			u8_dec(text_.c_str(), &caret_);
			break;
		case NKCODE_DPAD_RIGHT: // ASCII right arrow
			u8_inc(text_.c_str(), &caret_);
			break;
		case NKCODE_MOVE_HOME:
		case NKCODE_PAGE_UP:
			caret_ = 0;
			break;
		case NKCODE_MOVE_END:
		case NKCODE_PAGE_DOWN:
			caret_ = (int)text_.size();
			break;
		case NKCODE_FORWARD_DEL:
			if (caret_ < (int)text_.size()) {
				int endCaret = caret_;
				u8_inc(text_.c_str(), &endCaret);
				undo_ = text_;
				text_.erase(text_.begin() + caret_, text_.begin() + endCaret);
			}
			break;
		case NKCODE_DEL:
			if (caret_ > 0) {
				int begCaret = caret_;
				u8_dec(text_.c_str(), &begCaret);
				undo_ = text_;
				text_.erase(text_.begin() + begCaret, text_.begin() + caret_);
				caret_--;
			}
			break;
		}

		if (ctrlDown_) {
			switch (input.keyCode) {
			case NKCODE_C:
				// Just copy the entire text contents, until we get selection support.
				System_SendMessage("setclipboardtext", text_.c_str());
				break;
			case NKCODE_V:
				{
					std::string clipText = System_GetProperty(SYSPROP_CLIPBOARD_TEXT);
					clipText = FirstLine(clipText);
					if (clipText.size()) {
						// Until we get selection, replace the whole text
						undo_ = text_;
						text_.clear();
						caret_ = 0;

						size_t maxPaste = maxLen_ - text_.size();
						if (clipText.size() > maxPaste) {
							int end = 0;
							while ((size_t)end < maxPaste) {
								u8_inc(clipText.c_str(), &end);
							}
							if (end > 0) {
								u8_dec(clipText.c_str(), &end);
							}
							clipText = clipText.substr(0, end);
						}
						InsertAtCaret(clipText.c_str());
					}
				}
				break;
			case NKCODE_Z:
				text_ = undo_;
				break;
			}
		}

		if (caret_ < 0) {
			caret_ = 0;
		}
		if (caret_ > (int)text_.size()) {
			caret_ = (int)text_.size();
		}
	}

	if (input.flags & KEY_UP) {
		switch (input.keyCode) {
		case NKCODE_CTRL_LEFT:
		case NKCODE_CTRL_RIGHT:
			ctrlDown_ = false;
			break;
		}
	}

	// Process chars.
	if (input.flags & KEY_CHAR) {
		int unichar = input.keyCode;
		if (unichar >= 0x20 && !ctrlDown_) {  // Ignore control characters.
			// Insert it! (todo: do it with a string insert)
			char buf[8];
			buf[u8_wc_toutf8(buf, unichar)] = '\0';
			if (strlen(buf) + text_.size() < maxLen_) {
				undo_ = text_;
				InsertAtCaret(buf);
			}
		}
	}
}
Exemplo n.º 13
0
void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
	iniFilename_ = FindConfigFile(iniFileName != NULL ? iniFileName : "ppsspp.ini");
	controllerIniFilename_ = FindConfigFile(controllerIniFilename != NULL ? controllerIniFilename : "controls.ini");

	INFO_LOG(LOADER, "Loading config: %s", iniFilename_.c_str());
	bSaveSettings = true;

	IniFile iniFile;
	if (!iniFile.Load(iniFilename_)) {
		ERROR_LOG(LOADER, "Failed to read %s. Setting config to default.", iniFilename_.c_str());
		// Continue anyway to initialize the config.
	}

	IniFile::Section *general = iniFile.GetOrCreateSection("General");

	general->Get("FirstRun", &bFirstRun, true);
	general->Get("Enable Logging", &bEnableLogging, true);
	general->Get("AutoRun", &bAutoRun, true);
	general->Get("Browse", &bBrowse, false);
	general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true);
	general->Get("CurrentDirectory", &currentDirectory, "");
	general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);

	if (!File::Exists(currentDirectory))
		currentDirectory = "";

	std::string defaultLangRegion = "en_US";
	if (bFirstRun) {
		std::string langRegion = System_GetProperty(SYSPROP_LANGREGION);
		if (i18nrepo.IniExists(langRegion))
			defaultLangRegion = langRegion;
		// TODO: Be smart about same language, different country
	}

	general->Get("Language", &sLanguageIni, defaultLangRegion.c_str());
	general->Get("NumWorkerThreads", &iNumWorkerThreads, cpu_info.num_cores);
	general->Get("EnableCheats", &bEnableCheats, false);
	general->Get("ScreenshotsAsPNG", &bScreenshotsAsPNG, false);
	general->Get("StateSlot", &iCurrentStateSlot, 0);
	general->Get("GridView1", &bGridView1, true);
	general->Get("GridView2", &bGridView2, true);
	general->Get("GridView3", &bGridView3, true);

	// "default" means let emulator decide, "" means disable.
	general->Get("ReportingHost", &sReportHost, "default");
	general->Get("Recent", recentIsos);
	general->Get("AutoSaveSymbolMap", &bAutoSaveSymbolMap, false);
#ifdef _WIN32
	general->Get("TopMost", &bTopMost);
	general->Get("WindowX", &iWindowX, -1); // -1 tells us to center the window.
	general->Get("WindowY", &iWindowY, -1);
	general->Get("WindowWidth", &iWindowWidth, 0);   // 0 will be automatically reset later (need to do the AdjustWindowRect dance).
	general->Get("WindowHeight", &iWindowHeight, 0);
	general->Get("PauseOnLostFocus", &bPauseOnLostFocus, false);
#endif

	IniFile::Section *recent = iniFile.GetOrCreateSection("Recent");
	recent->Get("MaxRecent", &iMaxRecent, 30);

	// Fix issue from switching from uint (hex in .ini) to int (dec)
	if (iMaxRecent == 0)
		iMaxRecent = 30;

	recentIsos.clear();
	for (int i = 0; i < iMaxRecent; i++)
	{
		char keyName[64];
		std::string fileName;

		sprintf(keyName,"FileName%d",i);
		if (!recent->Get(keyName,&fileName,"") || fileName.length() == 0) {
			// just skip it to get the next key
		}
		else {
			recentIsos.push_back(fileName);
		}
	}

	IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
#ifdef IOS
	cpu->Get("Jit", &bJit, !isJailed);
#else
	cpu->Get("Jit", &bJit, true);
#endif
	cpu->Get("SeparateCPUThread", &bSeparateCPUThread, false);
	cpu->Get("AtomicAudioLocks", &bAtomicAudioLocks, false);

#ifdef __SYMBIAN32__
	cpu->Get("SeparateIOThread", &bSeparateIOThread, false);
#else
	cpu->Get("SeparateIOThread", &bSeparateIOThread, true);
#endif
	cpu->Get("FastMemory", &bFastMemory, false);
	cpu->Get("CPUSpeed", &iLockedCPUSpeed, 0);

	IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics");
	graphics->Get("ShowFPSCounter", &iShowFPSCounter, false);

	int renderingModeDefault = 1;  // Buffered
	if (System_GetProperty(SYSPROP_NAME) == "samsung:GT-S5360") {
		renderingModeDefault = 0;  // Non-buffered
	}

	graphics->Get("RenderingMode", &iRenderingMode, renderingModeDefault);
	graphics->Get("SoftwareRendering", &bSoftwareRendering, false);
	graphics->Get("HardwareTransform", &bHardwareTransform, true);
	graphics->Get("TextureFiltering", &iTexFiltering, 1);
	// Auto on Windows, 1x elsewhere. Maybe change to 2x on large screens?
#ifdef _WIN32
	graphics->Get("InternalResolution", &iInternalResolution, 0);
#else
	graphics->Get("InternalResolution", &iInternalResolution, 1);
#endif

	graphics->Get("FrameSkip", &iFrameSkip, 0);
	graphics->Get("FrameRate", &iFpsLimit, 0);
#ifdef _WIN32
	graphics->Get("FrameSkipUnthrottle", &bFrameSkipUnthrottle, false);
#else
	graphics->Get("FrameSkipUnthrottle", &bFrameSkipUnthrottle, true);
#endif
	graphics->Get("ForceMaxEmulatedFPS", &iForceMaxEmulatedFPS, 60);
#ifdef USING_GLES2
	graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 0);
#else
	graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 8);
#endif
	if (iAnisotropyLevel > 4) {
		iAnisotropyLevel = 4;
	}
	graphics->Get("VertexCache", &bVertexCache, true);
#ifdef _WIN32
	graphics->Get("FullScreen", &bFullScreen, false);
#endif
#ifdef BLACKBERRY
	graphics->Get("PartialStretch", &bPartialStretch, pixel_xres == pixel_yres);
#endif
	graphics->Get("StretchToDisplay", &bStretchToDisplay, false);
	graphics->Get("TrueColor", &bTrueColor, true);
	graphics->Get("MipMap", &bMipMap, true);
	graphics->Get("TexScalingLevel", &iTexScalingLevel, 1);
	graphics->Get("TexScalingType", &iTexScalingType, 0);
	graphics->Get("TexDeposterize", &bTexDeposterize, false);
	graphics->Get("VSyncInterval", &bVSync, false);
	graphics->Get("DisableStencilTest", &bDisableStencilTest, false);
	graphics->Get("AlwaysDepthWrite", &bAlwaysDepthWrite, false);
	graphics->Get("LowQualitySplineBezier", &bLowQualitySplineBezier, false);
	graphics->Get("PostShader", &sPostShaderName, "Off");

	IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
	sound->Get("Enable", &bEnableSound, true);
	sound->Get("VolumeBGM", &iBGMVolume, 7);
	sound->Get("VolumeSFX", &iSFXVolume, 7);
	sound->Get("LowLatency", &bLowLatencyAudio, false);

	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	control->Get("HapticFeedback", &bHapticFeedback, true);
	control->Get("ShowAnalogStick", &bShowTouchAnalogStick, true);
	control->Get("ShowTouchCross", &bShowTouchCross, true);
	control->Get("ShowTouchCircle", &bShowTouchCircle, true);
	control->Get("ShowTouchSquare", &bShowTouchSquare, true);
	control->Get("ShowTouchTriangle", &bShowTouchTriangle, true);
	control->Get("ShowTouchStart", &bShowTouchStart, true);
	control->Get("ShowTouchSelect", &bShowTouchSelect, true);
	control->Get("ShowTouchLTrigger", &bShowTouchLTrigger, true);
	control->Get("ShowTouchRTrigger", &bShowTouchRTrigger, true);
	control->Get("ShowAnalogStick", &bShowTouchAnalogStick, true);
	control->Get("ShowTouchDpad", &bShowTouchDpad, true);
	control->Get("ShowTouchUnthrottle", &bShowTouchUnthrottle, true);

#if defined(USING_GLES2)
	std::string name = System_GetProperty(SYSPROP_NAME);
	if (KeyMap::HasBuiltinController(name)) {
		control->Get("ShowTouchControls", &bShowTouchControls, false);
	} else {
		control->Get("ShowTouchControls", &bShowTouchControls, true);
	}
#else
	control->Get("ShowTouchControls", &bShowTouchControls, false);
#endif
	// control->Get("KeyMapping",iMappingMap);
#ifdef USING_GLES2
	control->Get("AccelerometerToAnalogHoriz", &bAccelerometerToAnalogHoriz, false);
	control->Get("TiltSensitivity", &iTiltSensitivity, 100);
#endif
	control->Get("TouchButtonOpacity", &iTouchButtonOpacity, 65);
	control->Get("ButtonScale", &fButtonScale, 1.15);
	//set these to -1 if not initialized. initializing these
	//requires pixel coordinates which is not known right now.
	//will be initialized in GamepadEmu::CreatePadLayout
	control->Get("ActionButtonSpacing", &iActionButtonSpacing, -1);
	control->Get("ActionButtonCenterX", &iActionButtonCenterX, -1);
	control->Get("ActionButtonCenterY", &iActionButtonCenterY, -1);
	control->Get("DPadRadius", &iDpadRadius, -1);
	control->Get("DPadX", &iDpadX, -1);
	control->Get("DPadY", &iDpadY, -1);
	control->Get("StartKeyX", &iStartKeyX, -1);
	control->Get("StartKeyY", &iStartKeyY, -1);
	control->Get("SelectKeyX", &iSelectKeyX, -1);
	control->Get("SelectKeyY", &iSelectKeyY, -1);
	control->Get("UnthrottleKeyX", &iUnthrottleKeyX, -1);
	control->Get("UnthrottleKeyY", &iUnthrottleKeyY, -1);
	control->Get("LKeyX", &iLKeyX, -1);
	control->Get("LKeyY", &iLKeyY, -1);
	control->Get("RKeyX", &iRKeyX, -1);
	control->Get("RKeyY", &iRKeyY, -1);
	control->Get("AnalogStickX", &iAnalogStickX, -1);
	control->Get("AnalogStickY", &iAnalogStickY, -1);
	
	IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam");
	pspConfig->Get("NickName", &sNickName, "PPSSPP");
	pspConfig->Get("Language", &iLanguage, PSP_SYSTEMPARAM_LANGUAGE_ENGLISH);
	pspConfig->Get("TimeFormat", &iTimeFormat, PSP_SYSTEMPARAM_TIME_FORMAT_24HR);
	pspConfig->Get("DateFormat", &iDateFormat, PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD);
	pspConfig->Get("TimeZone", &iTimeZone, 0);
	pspConfig->Get("DayLightSavings", &bDayLightSavings, PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_STD);
	pspConfig->Get("ButtonPreference", &iButtonPreference, PSP_SYSTEMPARAM_BUTTON_CROSS);
	pspConfig->Get("LockParentalLevel", &iLockParentalLevel, 0);
	pspConfig->Get("WlanAdhocChannel", &iWlanAdhocChannel, PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC);
#ifdef _WIN32
	pspConfig->Get("BypassOSKWithKeyboard", &bBypassOSKWithKeyboard, false);
#endif
	pspConfig->Get("WlanPowerSave", &bWlanPowerSave, PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF);
	pspConfig->Get("EncryptSave", &bEncryptSave, true);

	IniFile::Section *debugConfig = iniFile.GetOrCreateSection("Debugger");
	debugConfig->Get("DisasmWindowX", &iDisasmWindowX, -1);
	debugConfig->Get("DisasmWindowY", &iDisasmWindowY, -1);
	debugConfig->Get("DisasmWindowW", &iDisasmWindowW, -1);
	debugConfig->Get("DisasmWindowH", &iDisasmWindowH, -1);
	debugConfig->Get("GEWindowX", &iGEWindowX, -1);
	debugConfig->Get("GEWindowY", &iGEWindowY, -1);
	debugConfig->Get("GEWindowW", &iGEWindowW, -1);
	debugConfig->Get("GEWindowH", &iGEWindowH, -1);
	debugConfig->Get("ConsoleWindowX", &iConsoleWindowX, -1);
	debugConfig->Get("ConsoleWindowY", &iConsoleWindowY, -1);
	debugConfig->Get("FontWidth", &iFontWidth, 8);
	debugConfig->Get("FontHeight", &iFontHeight, 12);
	debugConfig->Get("DisplayStatusBar", &bDisplayStatusBar, true);
	debugConfig->Get("ShowBottomTabTitles",&bShowBottomTabTitles,true);
	debugConfig->Get("ShowDeveloperMenu", &bShowDeveloperMenu, false);

	IniFile::Section *speedhacks = iniFile.GetOrCreateSection("SpeedHacks");
	speedhacks->Get("PrescaleUV", &bPrescaleUV, false);
	speedhacks->Get("DisableAlphaTest", &bDisableAlphaTest, false);

	INFO_LOG(LOADER, "Loading controller config: %s", controllerIniFilename_.c_str());
	bSaveSettings = true;

	IniFile controllerIniFile;
	if (!controllerIniFile.Load(controllerIniFilename_)) {
		ERROR_LOG(LOADER, "Failed to read %s. Setting controller config to default.", controllerIniFilename_.c_str());
		KeyMap::RestoreDefault();
	} else {
		// Continue anyway to initialize the config. It will just restore the defaults.
		KeyMap::LoadFromIni(controllerIniFile);
	}

	CleanRecent();
}