INIFile::Key* INIFile::getKey(const std::string& sectionname, const std::string& keyname) const { INIFile::Section* curSection = getSection(sectionname); if(curSection == NULL) { return NULL; } return curSection->getKey(keyname); }
void SConfig::LoadFifoPlayerSettings(IniFile& ini) { IniFile::Section* fifoplayer = ini.GetOrCreateSection("FifoPlayer"); fifoplayer->Get("LoopReplay", &bLoopFifoReplay, true); }
void SConfig::LoadInputSettings(IniFile& ini) { IniFile::Section* input = ini.GetOrCreateSection("Input"); input->Get("BackgroundInput", &m_BackgroundInput, false); }
void SConfig::LoadCoreSettings(IniFile& ini) { IniFile::Section* core = ini.GetOrCreateSection("Core"); core->Get("HLE_BS2", &bHLE_BS2, false); #ifdef _M_X86 core->Get("CPUCore", &iCPUCore, PowerPC::CORE_JIT64); #elif _M_ARM_64 core->Get("CPUCore", &iCPUCore, PowerPC::CORE_JITARM64); #else core->Get("CPUCore", &iCPUCore, PowerPC::CORE_INTERPRETER); #endif core->Get("Fastmem", &bFastmem, true); core->Get("DSPHLE", &bDSPHLE, true); core->Get("TimingVariance", &iTimingVariance, 40); core->Get("CPUThread", &bCPUThread, true); core->Get("SkipIdle", &bSkipIdle, true); core->Get("SyncOnSkipIdle", &bSyncGPUOnSkipIdleHack, true); core->Get("DefaultISO", &m_strDefaultISO); core->Get("DVDRoot", &m_strDVDRoot); core->Get("Apploader", &m_strApploader); core->Get("EnableCheats", &bEnableCheats, false); core->Get("SelectedLanguage", &SelectedLanguage, 0); core->Get("OverrideGCLang", &bOverrideGCLanguage, false); core->Get("DPL2Decoder", &bDPL2Decoder, false); core->Get("Latency", &iLatency, 2); core->Get("MemcardAPath", &m_strMemoryCardA); core->Get("MemcardBPath", &m_strMemoryCardB); core->Get("AgpCartAPath", &m_strGbaCartA); core->Get("AgpCartBPath", &m_strGbaCartB); core->Get("SlotA", (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD); core->Get("SlotB", (int*)&m_EXIDevice[1], EXIDEVICE_NONE); core->Get("SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE); core->Get("BBA_MAC", &m_bba_mac); core->Get("TimeProfiling", &bJITILTimeProfiling, false); core->Get("OutputIR", &bJITILOutputIR, false); for (int i = 0; i < MAX_SI_CHANNELS; ++i) { core->Get(StringFromFormat("SIDevice%i", i), (u32*)&m_SIDevice[i], (i == 0) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE); core->Get(StringFromFormat("AdapterRumble%i", i), &m_AdapterRumble[i], true); core->Get(StringFromFormat("SimulateKonga%i", i), &m_AdapterKonga[i], false); } core->Get("WiiSDCard", &m_WiiSDCard, false); core->Get("WiiKeyboard", &m_WiiKeyboard, false); core->Get("WiimoteContinuousScanning", &m_WiimoteContinuousScanning, false); core->Get("WiimoteEnableSpeaker", &m_WiimoteEnableSpeaker, false); core->Get("RunCompareServer", &bRunCompareServer, false); core->Get("RunCompareClient", &bRunCompareClient, false); core->Get("MMU", &bMMU, false); core->Get("BBDumpPort", &iBBDumpPort, -1); core->Get("SyncGPU", &bSyncGPU, false); core->Get("SyncGpuMaxDistance", &iSyncGpuMaxDistance, 200000); core->Get("SyncGpuMinDistance", &iSyncGpuMinDistance, -200000); core->Get("SyncGpuOverclock", &fSyncGpuOverclock, 1.0); core->Get("FastDiscSpeed", &bFastDiscSpeed, false); core->Get("DCBZ", &bDCBZOFF, false); core->Get("FPRF", &bFPRF, false); core->Get("AccurateNaNs", &bAccurateNaNs, false); core->Get("EmulationSpeed", &m_EmulationSpeed, 1.0f); core->Get("Overclock", &m_OCFactor, 1.0f); core->Get("OverclockEnable", &m_OCEnable, false); core->Get("FrameSkip", &m_FrameSkip, 0); core->Get("GFXBackend", &m_strVideoBackend, ""); core->Get("GPUDeterminismMode", &m_strGPUDeterminismMode, "auto"); core->Get("PerfMapDir", &m_perfDir, ""); }
void Config::Load(const char *iniFileName, const char *controllerIniFilename) { iniFilename_ = iniFileName != NULL ? iniFileName : "ppsspp.ini"; controllerIniFilename_ = 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", ¤tDirectory, ""); general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false); 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", &languageIni, 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, 40); general->Get("WindowY", &iWindowY, 100); general->Get("WindowWidth", &iWindowWidth, 0); // 0 will be automatically reset later (need to do the AdjustWindowRect dance). general->Get("WindowHeight", &iWindowHeight, 0); #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); #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); graphics->Get("RenderingMode", &iRenderingMode, // Many ARMv6 devices have serious problems with buffered rendering. #if defined(ARM) && !defined(ARMV7) 0 #else 1 #endif ); // default is buffered rendering mode 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); 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); IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Get("Enable", &bEnableSound, true); sound->Get("EnableAtrac3plus", &bEnableAtrac3plus, true); sound->Get("VolumeBGM", &iBGMVolume, 7); sound->Get("VolumeSFX", &iSFXVolume, 7); sound->Get("LowLatency", &bLowLatencyAudio, false); IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Get("ShowAnalogStick", &bShowAnalogStick, true); #ifdef BLACKBERRY control->Get("ShowTouchControls", &bShowTouchControls, pixel_xres != pixel_yres); #elif 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); control->Get("AccelerometerToAnalogHoriz", &bAccelerometerToAnalogHoriz, false); control->Get("TouchButtonOpacity", &iTouchButtonOpacity, 65); control->Get("TiltSensitivity", &iTiltSensitivity, 100); control->Get("ButtonScale", &fButtonScale, 1.15); 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("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("ShowDeveloperMenu", &bShowDeveloperMenu, false); IniFile::Section *gleshacks = iniFile.GetOrCreateSection("GLESHacks"); gleshacks->Get("PrescaleUV", &bPrescaleUV, 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(); }
void SConfig::SaveInputSettings(IniFile& ini) { IniFile::Section* input = ini.GetOrCreateSection("Input"); input->Set("BackgroundInput", m_BackgroundInput); }
void SConfig::SaveGameListSettings(IniFile& ini) { IniFile::Section* gamelist = ini.GetOrCreateSection("GameList"); gamelist->Set("ListDrives", m_ListDrives); gamelist->Set("ListWad", m_ListWad); gamelist->Set("ListElfDol", m_ListElfDol); gamelist->Set("ListWii", m_ListWii); gamelist->Set("ListGC", m_ListGC); gamelist->Set("ListJap", m_ListJap); gamelist->Set("ListPal", m_ListPal); gamelist->Set("ListUsa", m_ListUsa); gamelist->Set("ListAustralia", m_ListAustralia); gamelist->Set("ListFrance", m_ListFrance); gamelist->Set("ListGermany", m_ListGermany); gamelist->Set("ListItaly", m_ListItaly); gamelist->Set("ListKorea", m_ListKorea); gamelist->Set("ListNetherlands", m_ListNetherlands); gamelist->Set("ListRussia", m_ListRussia); gamelist->Set("ListSpain", m_ListSpain); gamelist->Set("ListTaiwan", m_ListTaiwan); gamelist->Set("ListWorld", m_ListWorld); gamelist->Set("ListUnknown", m_ListUnknown); gamelist->Set("ListSort", m_ListSort); gamelist->Set("ListSortSecondary", m_ListSort2); gamelist->Set("ColorCompressed", m_ColorCompressed); gamelist->Set("ColumnPlatform", m_showSystemColumn); gamelist->Set("ColumnBanner", m_showBannerColumn); gamelist->Set("ColumnNotes", m_showMakerColumn); gamelist->Set("ColumnFileName", m_showFileNameColumn); gamelist->Set("ColumnID", m_showIDColumn); gamelist->Set("ColumnRegion", m_showRegionColumn); gamelist->Set("ColumnSize", m_showSizeColumn); gamelist->Set("ColumnState", m_showStateColumn); }
void SConfig::SaveInterfaceSettings(IniFile& ini) { IniFile::Section* interface = ini.GetOrCreateSection("Interface"); interface->Set("ConfirmStop", bConfirmStop); interface->Set("UsePanicHandlers", bUsePanicHandlers); interface->Set("OnScreenDisplayMessages", bOnScreenDisplayMessages); interface->Set("HideCursor", bHideCursor); interface->Set("AutoHideCursor", bAutoHideCursor); interface->Set("MainWindowPosX", iPosX); interface->Set("MainWindowPosY", iPosY); interface->Set("MainWindowWidth", iWidth); interface->Set("MainWindowHeight", iHeight); interface->Set("LanguageCode", m_InterfaceLanguage); interface->Set("ShowToolbar", m_InterfaceToolbar); interface->Set("ShowStatusbar", m_InterfaceStatusbar); interface->Set("ShowLogWindow", m_InterfaceLogWindow); interface->Set("ShowLogConfigWindow", m_InterfaceLogConfigWindow); interface->Set("ExtendedFPSInfo", m_InterfaceExtendedFPSInfo); interface->Set("ThemeName", theme_name); interface->Set("PauseOnFocusLost", m_PauseOnFocusLost); interface->Set("DisableTooltips", m_DisableTooltips); }
void SConfig::SaveFifoPlayerSettings(IniFile& ini) { IniFile::Section* fifoplayer = ini.GetOrCreateSection("FifoPlayer"); fifoplayer->Set("LoopReplay", bLoopFifoReplay); }
void SConfig::LoadCoreSettings(IniFile& ini) { IniFile::Section* core = ini.GetOrCreateSection("Core"); core->Get("SkipIPL", &bHLE_BS2, true); #ifdef _M_X86 core->Get("CPUCore", &cpu_core, PowerPC::CPUCore::JIT64); #elif _M_ARM_64 core->Get("CPUCore", &cpu_core, PowerPC::CPUCore::JITARM64); #else core->Get("CPUCore", &cpu_core, PowerPC::CPUCore::Interpreter); #endif core->Get("JITFollowBranch", &bJITFollowBranch, true); core->Get("Fastmem", &bFastmem, true); core->Get("DSPHLE", &bDSPHLE, true); core->Get("TimingVariance", &iTimingVariance, 40); core->Get("CPUThread", &bCPUThread, true); core->Get("SyncOnSkipIdle", &bSyncGPUOnSkipIdleHack, true); core->Get("EnableCheats", &bEnableCheats, false); core->Get("SelectedLanguage", &SelectedLanguage, 0); core->Get("OverrideGCLang", &bOverrideGCLanguage, false); core->Get("DPL2Decoder", &bDPL2Decoder, false); core->Get("AudioLatency", &iLatency, 20); core->Get("AudioStretch", &m_audio_stretch, false); core->Get("AudioStretchMaxLatency", &m_audio_stretch_max_latency, 80); core->Get("AgpCartAPath", &m_strGbaCartA); core->Get("AgpCartBPath", &m_strGbaCartB); core->Get("SlotA", (int*)&m_EXIDevice[0], ExpansionInterface::EXIDEVICE_MEMORYCARDFOLDER); core->Get("SlotB", (int*)&m_EXIDevice[1], ExpansionInterface::EXIDEVICE_NONE); core->Get("SerialPort1", (int*)&m_EXIDevice[2], ExpansionInterface::EXIDEVICE_NONE); core->Get("BBA_MAC", &m_bba_mac); for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i) { core->Get(StringFromFormat("SIDevice%i", i), (u32*)&m_SIDevice[i], (i == 0) ? SerialInterface::SIDEVICE_GC_CONTROLLER : SerialInterface::SIDEVICE_NONE); core->Get(StringFromFormat("AdapterRumble%i", i), &m_AdapterRumble[i], true); core->Get(StringFromFormat("SimulateKonga%i", i), &m_AdapterKonga[i], false); } core->Get("WiiSDCard", &m_WiiSDCard, false); core->Get("WiiKeyboard", &m_WiiKeyboard, false); core->Get("WiimoteContinuousScanning", &m_WiimoteContinuousScanning, false); core->Get("WiimoteEnableSpeaker", &m_WiimoteEnableSpeaker, false); core->Get("RunCompareServer", &bRunCompareServer, false); core->Get("RunCompareClient", &bRunCompareClient, false); core->Get("MMU", &bMMU, bMMU); core->Get("BBDumpPort", &iBBDumpPort, -1); core->Get("SyncGPU", &bSyncGPU, false); core->Get("SyncGpuMaxDistance", &iSyncGpuMaxDistance, 200000); core->Get("SyncGpuMinDistance", &iSyncGpuMinDistance, -200000); core->Get("SyncGpuOverclock", &fSyncGpuOverclock, 1.0f); core->Get("FastDiscSpeed", &bFastDiscSpeed, false); core->Get("LowDCBZHack", &bLowDCBZHack, false); core->Get("FPRF", &bFPRF, false); core->Get("AccurateNaNs", &bAccurateNaNs, false); core->Get("EmulationSpeed", &m_EmulationSpeed, 1.0f); core->Get("Overclock", &m_OCFactor, 1.0f); core->Get("OverclockEnable", &m_OCEnable, false); core->Get("GFXBackend", &m_strVideoBackend, ""); core->Get("GPUDeterminismMode", &m_strGPUDeterminismMode, "auto"); core->Get("PerfMapDir", &m_perfDir, ""); core->Get("EnableCustomRTC", &bEnableCustomRTC, false); // Default to seconds between 1.1.1970 and 1.1.2000 core->Get("CustomRTCValue", &m_customRTCValue, 946684800); core->Get("EnableSignatureChecks", &m_enable_signature_checks, true); }
void SConfig::LoadInterfaceSettings(IniFile& ini) { IniFile::Section* interface = ini.GetOrCreateSection("Interface"); interface->Get("ConfirmStop", &bConfirmStop, true); interface->Get("UsePanicHandlers", &bUsePanicHandlers, true); interface->Get("OnScreenDisplayMessages", &bOnScreenDisplayMessages, true); interface->Get("HideCursor", &bHideCursor, false); interface->Get("LanguageCode", &m_InterfaceLanguage, ""); interface->Get("ExtendedFPSInfo", &m_InterfaceExtendedFPSInfo, false); interface->Get("ShowActiveTitle", &m_show_active_title, true); interface->Get("UseBuiltinTitleDatabase", &m_use_builtin_title_database, true); interface->Get("ThemeName", &theme_name, DEFAULT_THEME_DIR); interface->Get("PauseOnFocusLost", &m_PauseOnFocusLost, false); interface->Get("DebugModeEnabled", &bEnableDebugging, false); }
void SConfig::SaveInterfaceSettings(IniFile& ini) { IniFile::Section* interface = ini.GetOrCreateSection("Interface"); interface->Set("ConfirmStop", bConfirmStop); interface->Set("UsePanicHandlers", bUsePanicHandlers); interface->Set("OnScreenDisplayMessages", bOnScreenDisplayMessages); interface->Set("HideCursor", bHideCursor); interface->Set("LanguageCode", m_InterfaceLanguage); interface->Set("ExtendedFPSInfo", m_InterfaceExtendedFPSInfo); interface->Set("ShowActiveTitle", m_show_active_title); interface->Set("UseBuiltinTitleDatabase", m_use_builtin_title_database); interface->Set("ThemeName", theme_name); interface->Set("PauseOnFocusLost", m_PauseOnFocusLost); interface->Set("DebugModeEnabled", bEnableDebugging); }
void Config::Load(const char *iniFileName) { iniFilename_ = iniFileName; INFO_LOG(LOADER, "Loading config: %s", iniFileName); bSaveSettings = true; IniFile iniFile; if (!iniFile.Load(iniFileName)) { ERROR_LOG(LOADER, "Failed to read %s. Setting config to default.", iniFileName); // Continue anyway to initialize the config. } IniFile::Section *general = iniFile.GetOrCreateSection("General"); bSpeedLimit = false; general->Get("FirstRun", &bFirstRun, true); general->Get("AutoLoadLast", &bAutoLoadLast, false); general->Get("AutoRun", &bAutoRun, true); general->Get("Browse", &bBrowse, false); general->Get("ConfirmOnQuit", &bConfirmOnQuit, false); general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true); general->Get("CurrentDirectory", ¤tDirectory, ""); general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false); general->Get("Language", &languageIni, "en_US"); general->Get("NumWorkerThreads", &iNumWorkerThreads, cpu_info.num_cores); general->Get("MaxRecent", &iMaxRecent, 12); // Fix issue from switching from uint (hex in .ini) to int (dec) if (iMaxRecent == 0) iMaxRecent = 12; // "default" means let emulator decide, "" means disable. general->Get("ReportHost", &sReportHost, "default"); general->Get("Recent", recentIsos); general->Get("WindowX", &iWindowX, 40); general->Get("WindowY", &iWindowY, 100); general->Get("AutoSaveSymbolMap", &bAutoSaveSymbolMap, false); if (recentIsos.size() > iMaxRecent) recentIsos.resize(iMaxRecent); IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU"); #ifdef IOS cpu->Get("Jit", &bJit, !isJailed); #else cpu->Get("Jit", &bJit, true); #endif //FastMemory Default set back to True when solve UNIMPL _sceAtracGetContextAddress making game crash cpu->Get("FastMemory", &bFastMemory, false); IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics"); graphics->Get("ShowFPSCounter", &bShowFPSCounter, false); graphics->Get("DisplayFramebuffer", &bDisplayFramebuffer, false); #ifdef _WIN32 graphics->Get("ResolutionScale", &iWindowZoom, 2); #else graphics->Get("ResolutionScale", &iWindowZoom, 1); #endif graphics->Get("BufferedRendering", &bBufferedRendering, true); graphics->Get("HardwareTransform", &bHardwareTransform, true); graphics->Get("LinearFiltering", &bLinearFiltering, false); graphics->Get("SSAA", &SSAntiAliasing, 0); graphics->Get("VBO", &bUseVBO, false); graphics->Get("FrameSkip", &iFrameSkip, 0); graphics->Get("FrameRate", &iFpsLimit, 60); graphics->Get("UseMediaEngine", &bUseMediaEngine, true); #ifdef USING_GLES2 graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 0); #else graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 8); #endif graphics->Get("VertexCache", &bVertexCache, true); graphics->Get("FullScreen", &bFullScreen, false); #ifdef BLACKBERRY10 graphics->Get("PartialStretch", &bPartialStretch, pixel_xres == pixel_yres); #endif graphics->Get("StretchToDisplay", &bStretchToDisplay, false); graphics->Get("TrueColor", &bTrueColor, true); #ifdef USING_GLES2 graphics->Get("MipMap", &bMipMap, true); #else graphics->Get("MipMap", &bMipMap, false); #endif graphics->Get("TexScalingLevel", &iTexScalingLevel, 1); graphics->Get("TexScalingType", &iTexScalingType, 0); graphics->Get("TexDeposterize", &bTexDeposterize, false); IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Get("Enable", &bEnableSound, true); sound->Get("AutoLoadDShow", &bAutoLoadDShow, false); IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Get("ShowStick", &bShowAnalogStick, false); #ifdef BLACKBERRY10 control->Get("ShowTouchControls", &bShowTouchControls, pixel_xres != pixel_yres); #elif defined(USING_GLES2) control->Get("ShowTouchControls", &bShowTouchControls, true); #else control->Get("ShowTouchControls", &bShowTouchControls,false); #endif control->Get("LargeControls", &bLargeControls, false); control->Get("KeyMapping",iMappingMap); control->Get("AccelerometerToAnalogHoriz", &bAccelerometerToAnalogHoriz, false); control->Get("ForceInputDevice", &iForceInputDevice, -1); IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); pspConfig->Get("NickName", &sNickName, "shadow"); 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", &bButtonPreference, PSP_SYSTEMPARAM_BUTTON_CROSS); pspConfig->Get("LockParentalLevel", &iLockParentalLevel, 0); pspConfig->Get("WlanAdhocChannel", &iWlanAdhocChannel, PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC); pspConfig->Get("WlanPowerSave", &bWlanPowerSave, PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF); pspConfig->Get("EncryptSave", &bEncryptSave, true); CleanRecent(); }
void Config::Save() { if (iniFilename_.size() && g_Config.bSaveSettings) { CleanRecent(); IniFile iniFile; if (!iniFile.Load(iniFilename_.c_str())) { ERROR_LOG(LOADER, "Error saving config - can't read ini %s", iniFilename_.c_str()); } IniFile::Section *general = iniFile.GetOrCreateSection("General"); general->Set("FirstRun", bFirstRun); general->Set("AutoLoadLast", bAutoLoadLast); general->Set("AutoRun", bAutoRun); general->Set("Browse", bBrowse); general->Set("ConfirmOnQuit", bConfirmOnQuit); general->Set("IgnoreBadMemAccess", bIgnoreBadMemAccess); general->Set("CurrentDirectory", currentDirectory); general->Set("ShowDebuggerOnLoad", bShowDebuggerOnLoad); general->Set("ReportHost", sReportHost); general->Set("Recent", recentIsos); general->Set("WindowX", iWindowX); general->Set("WindowY", iWindowY); general->Set("AutoSaveSymbolMap", bAutoSaveSymbolMap); general->Set("Language", languageIni); general->Set("NumWorkerThreads", iNumWorkerThreads); general->Set("MaxRecent", iMaxRecent); IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU"); cpu->Set("Jit", bJit); cpu->Set("FastMemory", bFastMemory); IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics"); graphics->Set("ShowFPSCounter", bShowFPSCounter); graphics->Set("DisplayFramebuffer", bDisplayFramebuffer); graphics->Set("ResolutionScale", iWindowZoom); graphics->Set("BufferedRendering", bBufferedRendering); graphics->Set("HardwareTransform", bHardwareTransform); graphics->Set("LinearFiltering", bLinearFiltering); graphics->Set("SSAA", SSAntiAliasing); graphics->Set("VBO", bUseVBO); graphics->Set("FrameSkip", iFrameSkip); graphics->Set("FrameRate", iFpsLimit); graphics->Set("UseMediaEngine", bUseMediaEngine); graphics->Set("AnisotropyLevel", iAnisotropyLevel); graphics->Set("VertexCache", bVertexCache); graphics->Set("FullScreen", bFullScreen); #ifdef BLACKBERRY10 graphics->Set("PartialStretch", bPartialStretch); #endif graphics->Set("StretchToDisplay", bStretchToDisplay); graphics->Set("TrueColor", bTrueColor); graphics->Set("MipMap", bMipMap); graphics->Set("TexScalingLevel", iTexScalingLevel); graphics->Set("TexScalingType", iTexScalingType); graphics->Set("TexDeposterize", bTexDeposterize); IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Set("Enable", bEnableSound); sound->Set("AutoLoadDShow", bAutoLoadDShow); IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Set("ShowStick", bShowAnalogStick); control->Set("ShowTouchControls", bShowTouchControls); control->Set("LargeControls", bLargeControls); control->Set("KeyMapping",iMappingMap); control->Set("AccelerometerToAnalogHoriz", bAccelerometerToAnalogHoriz); control->Set("ForceInputDevice", iForceInputDevice); IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); pspConfig->Set("NickName", sNickName.c_str()); pspConfig->Set("Language", ilanguage); pspConfig->Set("TimeFormat", itimeformat); pspConfig->Set("DateFormat", iDateFormat); pspConfig->Set("TimeZone", iTimeZone); pspConfig->Set("DayLightSavings", bDayLightSavings); pspConfig->Set("ButtonPreference", bButtonPreference); pspConfig->Set("LockParentalLevel", iLockParentalLevel); pspConfig->Set("WlanAdhocChannel", iWlanAdhocChannel); pspConfig->Set("WlanPowerSave", bWlanPowerSave); pspConfig->Set("EncryptSave", bEncryptSave); if (!iniFile.Save(iniFilename_.c_str())) { ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str()); return; } INFO_LOG(LOADER, "Config saved: %s", iniFilename_.c_str()); } else { INFO_LOG(LOADER, "Not saving config"); } }
//Dragonbane std::string AVIDump::GetCurrDumpFile(int fileCount, bool getTempFile) { //Dragonbane: Get last chosen Path IniFile settingsIni; IniFile::Section* iniPathSection; std::string lastRecordingPath = ""; bool fileLoaded = false; fileLoaded = settingsIni.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); //Get Path if (fileLoaded) { iniPathSection = settingsIni.GetOrCreateSection("RememberedPaths"); iniPathSection->Get("LastDumpPath", &lastRecordingPath, ""); } std::string dumpFolder; if (lastRecordingPath.empty()) dumpFolder = File::GetUserPath(D_DUMPFRAMES_IDX); else dumpFolder = lastRecordingPath; std::string movie_file_name = ""; bool lastSide = false; if (Movie::cmp_isRunning) { if (Movie::cmp_outputPath.empty()) //Default Save Path { movie_file_name = StringFromFormat("%sComparison%d.avi", dumpFolder.c_str(), fileCount); } else { std::string file, legalPathname, extension; SplitPathEscapeChar(Movie::cmp_outputPath, &legalPathname, &file, &extension); if (extension.empty() || extension.compare(".avi")) { movie_file_name = StringFromFormat("%sComparison%d", legalPathname.c_str(), fileCount); } else { movie_file_name = StringFromFormat("%s%s%d", legalPathname.c_str(), file.c_str(), fileCount); } } if (Movie::cmp_leftFinished || Movie::cmp_rightFinished) lastSide = true; if (!lastSide) { movie_file_name.append("_temp.avi"); } else { if (getTempFile) { movie_file_name.append("_temp.avi"); } else { movie_file_name.append(".avi"); } } } else { movie_file_name = StringFromFormat("%sframedump%d.avi", dumpFolder.c_str(), fileCount); } return movie_file_name; }
void SConfig::SaveGeneralSettings(IniFile& ini) { IniFile::Section* general = ini.GetOrCreateSection("General"); // General general->Set("LastFilename", m_LastFilename); general->Set("ShowLag", m_ShowLag); general->Set("ShowFrameCount", m_ShowFrameCount); // ISO folders // Clear removed folders int oldPaths; int numPaths = (int)m_ISOFolder.size(); general->Get("ISOPaths", &oldPaths, 0); for (int i = numPaths; i < oldPaths; i++) { ini.DeleteKey("General", StringFromFormat("ISOPath%i", i)); } general->Set("ISOPaths", numPaths); for (int i = 0; i < numPaths; i++) { general->Set(StringFromFormat("ISOPath%i", i), m_ISOFolder[i]); } general->Set("RecursiveISOPaths", m_RecursiveISOFolder); general->Set("NANDRootPath", m_NANDPath); general->Set("DumpPath", m_DumpPath); CreateDumpPath(m_DumpPath); general->Set("WirelessMac", m_WirelessMac); general->Set("WiiSDCardPath", m_strWiiSDCardPath); #ifdef USE_GDBSTUB #ifndef _WIN32 general->Set("GDBSocket", gdb_socket); #endif general->Set("GDBPort", iGDBPort); #endif }
void SConfig::LoadGeneralSettings(IniFile& ini) { IniFile::Section* general = ini.GetOrCreateSection("General"); general->Get("LastFilename", &m_LastFilename); general->Get("ShowLag", &m_ShowLag, false); general->Get("ShowFrameCount", &m_ShowFrameCount, false); #ifdef USE_GDBSTUB #ifndef _WIN32 general->Get("GDBSocket", &gdb_socket, ""); #endif general->Get("GDBPort", &(iGDBPort), -1); #endif m_ISOFolder.clear(); int numISOPaths; if (general->Get("ISOPaths", &numISOPaths, 0)) { for (int i = 0; i < numISOPaths; i++) { std::string tmpPath; general->Get(StringFromFormat("ISOPath%i", i), &tmpPath, ""); m_ISOFolder.push_back(std::move(tmpPath)); } } // Check for old file path (Changed in 4.0-4003) // This can probably be removed after 5.0 stable is launched else if (general->Get("GCMPathes", &numISOPaths, 0)) { for (int i = 0; i < numISOPaths; i++) { std::string tmpPath; general->Get(StringFromFormat("GCMPath%i", i), &tmpPath, ""); bool found = false; for (size_t j = 0; j < m_ISOFolder.size(); ++j) { if (m_ISOFolder[j] == tmpPath) { found = true; break; } } if (!found) m_ISOFolder.push_back(std::move(tmpPath)); } } if (!general->Get("RecursiveISOPaths", &m_RecursiveISOFolder, false)) { // Check for old name general->Get("RecursiveGCMPaths", &m_RecursiveISOFolder, false); } general->Get("NANDRootPath", &m_NANDPath); File::SetUserPath(D_WIIROOT_IDX, m_NANDPath); general->Get("WirelessMac", &m_WirelessMac); }
void SConfig::SaveDisplaySettings(IniFile& ini) { IniFile::Section* display = ini.GetOrCreateSection("Display"); display->Set("FullscreenResolution", strFullscreenResolution); display->Set("Fullscreen", bFullscreen); display->Set("RenderToMain", bRenderToMain); display->Set("RenderWindowXPos", iRenderWindowXPos); display->Set("RenderWindowYPos", iRenderWindowYPos); display->Set("RenderWindowWidth", iRenderWindowWidth); display->Set("RenderWindowHeight", iRenderWindowHeight); display->Set("RenderWindowAutoSize", bRenderWindowAutoSize); display->Set("KeepWindowOnTop", bKeepWindowOnTop); display->Set("ProgressiveScan", bProgressive); display->Set("PAL60", bPAL60); display->Set("DisableScreenSaver", bDisableScreenSaver); display->Set("ForceNTSCJ", bForceNTSCJ); }
void SConfig::LoadInterfaceSettings(IniFile& ini) { IniFile::Section* interface = ini.GetOrCreateSection("Interface"); interface->Get("ConfirmStop", &bConfirmStop, true); interface->Get("UsePanicHandlers", &bUsePanicHandlers, true); interface->Get("OnScreenDisplayMessages", &bOnScreenDisplayMessages, true); interface->Get("HideCursor", &bHideCursor, false); interface->Get("AutoHideCursor", &bAutoHideCursor, false); interface->Get("MainWindowPosX", &iPosX, 100); interface->Get("MainWindowPosY", &iPosY, 100); interface->Get("MainWindowWidth", &iWidth, 800); interface->Get("MainWindowHeight", &iHeight, 600); interface->Get("Language", &m_InterfaceLanguage, 0); interface->Get("ShowToolbar", &m_InterfaceToolbar, true); interface->Get("ShowStatusbar", &m_InterfaceStatusbar, true); interface->Get("ShowLogWindow", &m_InterfaceLogWindow, false); interface->Get("ShowLogConfigWindow", &m_InterfaceLogConfigWindow, false); interface->Get("ExtendedFPSInfo", &m_InterfaceExtendedFPSInfo, false); interface->Get("ThemeName40", &theme_name, "Clean"); interface->Get("PauseOnFocusLost", &m_PauseOnFocusLost, false); }
void SConfig::SaveCoreSettings(IniFile& ini) { IniFile::Section* core = ini.GetOrCreateSection("Core"); core->Set("HLE_BS2", bHLE_BS2); core->Set("TimingVariance", iTimingVariance); core->Set("CPUCore", iCPUCore); core->Set("Fastmem", bFastmem); core->Set("CPUThread", bCPUThread); core->Set("DSPHLE", bDSPHLE); core->Set("SyncOnSkipIdle", bSyncGPUOnSkipIdleHack); core->Set("SyncGPU", bSyncGPU); core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance); core->Set("SyncGpuMinDistance", iSyncGpuMinDistance); core->Set("SyncGpuOverclock", fSyncGpuOverclock); core->Set("FPRF", bFPRF); core->Set("AccurateNaNs", bAccurateNaNs); core->Set("DefaultISO", m_strDefaultISO); core->Set("DVDRoot", m_strDVDRoot); core->Set("Apploader", m_strApploader); core->Set("EnableCheats", bEnableCheats); core->Set("SelectedLanguage", SelectedLanguage); core->Set("OverrideGCLang", bOverrideGCLanguage); core->Set("DPL2Decoder", bDPL2Decoder); core->Set("TimeStretching", bTimeStretching); core->Set("RSHACK", bRSHACK); core->Set("Latency", iLatency); core->Set("MemcardAPath", m_strMemoryCardA); core->Set("MemcardBPath", m_strMemoryCardB); core->Set("AgpCartAPath", m_strGbaCartA); core->Set("AgpCartBPath", m_strGbaCartB); core->Set("SlotA", m_EXIDevice[0]); core->Set("SlotB", m_EXIDevice[1]); core->Set("SerialPort1", m_EXIDevice[2]); core->Set("BBA_MAC", m_bba_mac); for (int i = 0; i < MAX_SI_CHANNELS; ++i) { core->Set(StringFromFormat("SIDevice%i", i), m_SIDevice[i]); core->Set(StringFromFormat("AdapterRumble%i", i), m_AdapterRumble[i]); core->Set(StringFromFormat("SimulateKonga%i", i), m_AdapterKonga[i]); } core->Set("WiiSDCard", m_WiiSDCard); core->Set("WiiKeyboard", m_WiiKeyboard); core->Set("WiimoteContinuousScanning", m_WiimoteContinuousScanning); core->Set("WiimoteEnableSpeaker", m_WiimoteEnableSpeaker); core->Set("RunCompareServer", bRunCompareServer); core->Set("RunCompareClient", bRunCompareClient); core->Set("EmulationSpeed", m_EmulationSpeed); core->Set("FrameSkip", m_FrameSkip); core->Set("Overclock", m_OCFactor); core->Set("OverclockEnable", m_OCEnable); core->Set("GFXBackend", m_strVideoBackend); core->Set("GPUDeterminismMode", m_strGPUDeterminismMode); core->Set("PerfMapDir", m_perfDir); core->Set("EnableCustomRTC", bEnableCustomRTC); core->Set("CustomRTCValue", m_customRTCValue); }
void SConfig::LoadDisplaySettings(IniFile& ini) { IniFile::Section* display = ini.GetOrCreateSection("Display"); display->Get("Fullscreen", &bFullscreen, false); display->Get("FullscreenResolution", &strFullscreenResolution, "Auto"); display->Get("RenderToMain", &bRenderToMain, false); display->Get("RenderWindowXPos", &iRenderWindowXPos, -1); display->Get("RenderWindowYPos", &iRenderWindowYPos, -1); display->Get("RenderWindowWidth", &iRenderWindowWidth, 640); display->Get("RenderWindowHeight", &iRenderWindowHeight, 480); display->Get("RenderWindowAutoSize", &bRenderWindowAutoSize, false); display->Get("KeepWindowOnTop", &bKeepWindowOnTop, false); display->Get("ProgressiveScan", &bProgressive, false); display->Get("PAL60", &bPAL60, true); display->Get("DisableScreenSaver", &bDisableScreenSaver, true); display->Get("ForceNTSCJ", &bForceNTSCJ, false); }
void SConfig::LoadGameListSettings(IniFile& ini) { IniFile::Section* gamelist = ini.GetOrCreateSection("GameList"); gamelist->Get("ListDrives", &m_ListDrives, false); gamelist->Get("ListWad", &m_ListWad, true); gamelist->Get("ListElfDol", &m_ListElfDol, true); gamelist->Get("ListWii", &m_ListWii, true); gamelist->Get("ListGC", &m_ListGC, true); gamelist->Get("ListJap", &m_ListJap, true); gamelist->Get("ListPal", &m_ListPal, true); gamelist->Get("ListUsa", &m_ListUsa, true); gamelist->Get("ListAustralia", &m_ListAustralia, true); gamelist->Get("ListFrance", &m_ListFrance, true); gamelist->Get("ListGermany", &m_ListGermany, true); gamelist->Get("ListItaly", &m_ListItaly, true); gamelist->Get("ListKorea", &m_ListKorea, true); gamelist->Get("ListNetherlands", &m_ListNetherlands, true); gamelist->Get("ListRussia", &m_ListRussia, true); gamelist->Get("ListSpain", &m_ListSpain, true); gamelist->Get("ListTaiwan", &m_ListTaiwan, true); gamelist->Get("ListWorld", &m_ListWorld, true); gamelist->Get("ListUnknown", &m_ListUnknown, true); gamelist->Get("ListSort", &m_ListSort, 3); gamelist->Get("ListSortSecondary", &m_ListSort2, 0); // Determines if compressed games display in blue gamelist->Get("ColorCompressed", &m_ColorCompressed, true); // Gamelist columns toggles gamelist->Get("ColumnPlatform", &m_showSystemColumn, true); gamelist->Get("ColumnBanner", &m_showBannerColumn, true); gamelist->Get("ColumnNotes", &m_showMakerColumn, true); gamelist->Get("ColumnFileName", &m_showFileNameColumn, false); gamelist->Get("ColumnID", &m_showIDColumn, false); gamelist->Get("ColumnRegion", &m_showRegionColumn, true); gamelist->Get("ColumnSize", &m_showSizeColumn, true); gamelist->Get("ColumnState", &m_showStateColumn, true); }
void Config::Save() { if (iniFilename_.size() && g_Config.bSaveSettings) { CleanRecent(); IniFile iniFile; if (!iniFile.Load(iniFilename_.c_str())) { ERROR_LOG(LOADER, "Error saving config - can't read ini %s", iniFilename_.c_str()); } IniFile::Section *general = iniFile.GetOrCreateSection("General"); // Need to do this somewhere... bFirstRun = false; general->Set("FirstRun", bFirstRun); general->Set("Enable Logging", bEnableLogging); general->Set("AutoRun", bAutoRun); general->Set("Browse", bBrowse); general->Set("IgnoreBadMemAccess", bIgnoreBadMemAccess); general->Set("CurrentDirectory", currentDirectory); general->Set("ShowDebuggerOnLoad", bShowDebuggerOnLoad); general->Set("ReportingHost", sReportHost); general->Set("AutoSaveSymbolMap", bAutoSaveSymbolMap); #ifdef _WIN32 general->Set("TopMost", bTopMost); general->Set("WindowX", iWindowX); general->Set("WindowY", iWindowY); general->Set("WindowWidth", iWindowWidth); general->Set("WindowHeight", iWindowHeight); #endif general->Set("Language", languageIni); general->Set("NumWorkerThreads", iNumWorkerThreads); general->Set("EnableCheats", bEnableCheats); general->Set("ScreenshotsAsPNG", bScreenshotsAsPNG); general->Set("StateSlot", iCurrentStateSlot); general->Set("GridView1", bGridView1); general->Set("GridView2", bGridView2); general->Set("GridView3", bGridView3); IniFile::Section *recent = iniFile.GetOrCreateSection("Recent"); recent->Set("MaxRecent", iMaxRecent); for (int i = 0; i < iMaxRecent; i++) { char keyName[64]; sprintf(keyName,"FileName%d",i); if (i < (int)recentIsos.size()) { recent->Set(keyName, recentIsos[i]); } else { recent->Delete(keyName); // delete the nonexisting FileName } } IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU"); cpu->Set("Jit", bJit); cpu->Set("SeparateCPUThread", bSeparateCPUThread); cpu->Set("SeparateIOThread", bSeparateIOThread); cpu->Set("FastMemory", bFastMemory); cpu->Set("CPUSpeed", iLockedCPUSpeed); IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics"); graphics->Set("ShowFPSCounter", iShowFPSCounter); graphics->Set("RenderingMode", iRenderingMode); graphics->Set("SoftwareRendering", bSoftwareRendering); graphics->Set("HardwareTransform", bHardwareTransform); graphics->Set("TextureFiltering", iTexFiltering); graphics->Set("InternalResolution", iInternalResolution); graphics->Set("FrameSkip", iFrameSkip); graphics->Set("FrameRate", iFpsLimit); graphics->Set("ForceMaxEmulatedFPS", iForceMaxEmulatedFPS); graphics->Set("AnisotropyLevel", iAnisotropyLevel); graphics->Set("VertexCache", bVertexCache); #ifdef _WIN32 graphics->Set("FullScreen", bFullScreen); #endif #ifdef BLACKBERRY graphics->Set("PartialStretch", bPartialStretch); #endif graphics->Set("StretchToDisplay", bStretchToDisplay); graphics->Set("TrueColor", bTrueColor); graphics->Set("MipMap", bMipMap); graphics->Set("TexScalingLevel", iTexScalingLevel); graphics->Set("TexScalingType", iTexScalingType); graphics->Set("TexDeposterize", bTexDeposterize); graphics->Set("VSyncInterval", bVSync); graphics->Set("DisableStencilTest", bDisableStencilTest); graphics->Set("AlwaysDepthWrite", bAlwaysDepthWrite); IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Set("Enable", bEnableSound); sound->Set("EnableAtrac3plus", bEnableAtrac3plus); sound->Set("VolumeBGM", iBGMVolume); sound->Set("VolumeSFX", iSFXVolume); sound->Set("LowLatency", bLowLatencyAudio); IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Set("ShowAnalogStick", bShowAnalogStick); control->Set("ShowTouchControls", bShowTouchControls); // control->Set("KeyMapping",iMappingMap); control->Set("AccelerometerToAnalogHoriz", bAccelerometerToAnalogHoriz); control->Set("TiltSensitivity", iTiltSensitivity); control->Set("TouchButtonOpacity", iTouchButtonOpacity); control->Set("ButtonScale", fButtonScale); IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); pspConfig->Set("NickName", sNickName.c_str()); pspConfig->Set("Language", ilanguage); pspConfig->Set("TimeFormat", iTimeFormat); pspConfig->Set("DateFormat", iDateFormat); pspConfig->Set("TimeZone", iTimeZone); pspConfig->Set("DayLightSavings", bDayLightSavings); pspConfig->Set("ButtonPreference", iButtonPreference); pspConfig->Set("LockParentalLevel", iLockParentalLevel); pspConfig->Set("WlanAdhocChannel", iWlanAdhocChannel); pspConfig->Set("WlanPowerSave", bWlanPowerSave); pspConfig->Set("EncryptSave", bEncryptSave); #ifdef _WIN32 pspConfig->Set("BypassOSKWithKeyboard", bBypassOSKWithKeyboard); #endif IniFile::Section *debugConfig = iniFile.GetOrCreateSection("Debugger"); debugConfig->Set("DisasmWindowX", iDisasmWindowX); debugConfig->Set("DisasmWindowY", iDisasmWindowY); debugConfig->Set("DisasmWindowW", iDisasmWindowW); debugConfig->Set("DisasmWindowH", iDisasmWindowH); debugConfig->Set("ConsoleWindowX", iConsoleWindowX); debugConfig->Set("ConsoleWindowY", iConsoleWindowY); debugConfig->Set("FontWidth", iFontWidth); debugConfig->Set("FontHeight", iFontHeight); debugConfig->Set("DisplayStatusBar", bDisplayStatusBar); debugConfig->Set("ShowDeveloperMenu", bShowDeveloperMenu); if (!iniFile.Save(iniFilename_.c_str())) { ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str()); return; } INFO_LOG(LOADER, "Config saved: %s", iniFilename_.c_str()); IniFile controllerIniFile; if (!controllerIniFile.Load(controllerIniFilename_.c_str())) { ERROR_LOG(LOADER, "Error saving config - can't read ini %s", controllerIniFilename_.c_str()); } KeyMap::SaveToIni(controllerIniFile); if (!controllerIniFile.Save(controllerIniFilename_.c_str())) { ERROR_LOG(LOADER, "Error saving config - can't write ini %s", controllerIniFilename_.c_str()); return; } INFO_LOG(LOADER, "Controller config saved: %s", controllerIniFilename_.c_str()); } else { INFO_LOG(LOADER, "Not saving config"); } }