void SConfig::SaveCoreSettings(IniFile& ini) { IniFile::Section* core = ini.GetOrCreateSection("Core"); core->Set("HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2); core->Set("CPUCore", m_LocalCoreStartupParameter.iCPUCore); core->Set("Fastmem", m_LocalCoreStartupParameter.bFastmem); core->Set("CPUThread", m_LocalCoreStartupParameter.bCPUThread); core->Set("DSPThread", m_LocalCoreStartupParameter.bDSPThread); core->Set("DSPHLE", m_LocalCoreStartupParameter.bDSPHLE); core->Set("SkipIdle", m_LocalCoreStartupParameter.bSkipIdle); core->Set("DefaultGCM", m_LocalCoreStartupParameter.m_strDefaultGCM); core->Set("DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot); core->Set("Apploader", m_LocalCoreStartupParameter.m_strApploader); core->Set("EnableCheats", m_LocalCoreStartupParameter.bEnableCheats); core->Set("SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage); core->Set("DPL2Decoder", m_LocalCoreStartupParameter.bDPL2Decoder); core->Set("Latency", m_LocalCoreStartupParameter.iLatency); core->Set("MemcardAPath", m_strMemoryCardA); core->Set("MemcardBPath", m_strMemoryCardB); 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("WiiSDCard", m_WiiSDCard); core->Set("WiiKeyboard", m_WiiKeyboard); core->Set("WiimoteContinuousScanning", m_WiimoteContinuousScanning); core->Set("WiimoteEnableSpeaker", m_WiimoteEnableSpeaker); core->Set("RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer); core->Set("RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient); core->Set("FrameLimit", m_Framelimit); core->Set("FrameSkip", m_FrameSkip); core->Set("GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend); }
void SConfig::SaveDisplaySettings(IniFile& ini) { IniFile::Section* display = ini.GetOrCreateSection("Display"); display->Set("FullscreenResolution", m_LocalCoreStartupParameter.strFullscreenResolution); display->Set("Fullscreen", m_LocalCoreStartupParameter.bFullscreen); display->Set("RenderToMain", m_LocalCoreStartupParameter.bRenderToMain); display->Set("RenderWindowXPos", m_LocalCoreStartupParameter.iRenderWindowXPos); display->Set("RenderWindowYPos", m_LocalCoreStartupParameter.iRenderWindowYPos); display->Set("RenderWindowWidth", m_LocalCoreStartupParameter.iRenderWindowWidth); display->Set("RenderWindowHeight", m_LocalCoreStartupParameter.iRenderWindowHeight); display->Set("RenderWindowAutoSize", m_LocalCoreStartupParameter.bRenderWindowAutoSize); display->Set("KeepWindowOnTop", m_LocalCoreStartupParameter.bKeepWindowOnTop); display->Set("ProgressiveScan", m_LocalCoreStartupParameter.bProgressive); display->Set("DisableScreenSaver", m_LocalCoreStartupParameter.bDisableScreenSaver); display->Set("ForceNTSCJ", m_LocalCoreStartupParameter.bForceNTSCJ); }
void SConfig::SaveGameListSettings(IniFile& ini) { IniFile::Section* gamelist = ini.GetOrCreateSection("GameList"); gamelist->Set("ListDrives", m_ListDrives); gamelist->Set("ListWad", m_ListWad); 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("ListFrance", m_ListFrance); gamelist->Set("ListItaly", m_ListItaly); gamelist->Set("ListKorea", m_ListKorea); gamelist->Set("ListTaiwan", m_ListTaiwan); 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_showNotesColumn); gamelist->Set("ColumnID", m_showIDColumn); gamelist->Set("ColumnRegion", m_showRegionColumn); gamelist->Set("ColumnSize", m_showSizeColumn); gamelist->Set("ColumnState", m_showStateColumn); }
void SConfig::SaveFifoPlayerSettings(IniFile& ini) { IniFile::Section* fifoplayer = ini.GetOrCreateSection("FifoPlayer"); fifoplayer->Set("LoopReplay", bLoopFifoReplay); }
void SConfig::SaveInterfaceSettings(IniFile& ini) { IniFile::Section* interface = ini.GetOrCreateSection("Interface"); interface->Set("ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop); interface->Set("UsePanicHandlers", m_LocalCoreStartupParameter.bUsePanicHandlers); interface->Set("OnScreenDisplayMessages", m_LocalCoreStartupParameter.bOnScreenDisplayMessages); interface->Set("HideCursor", m_LocalCoreStartupParameter.bHideCursor); interface->Set("AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor); interface->Set("MainWindowPosX", (m_LocalCoreStartupParameter.iPosX == -32000) ? 0 : m_LocalCoreStartupParameter.iPosX); // TODO - HAX interface->Set("MainWindowPosY", (m_LocalCoreStartupParameter.iPosY == -32000) ? 0 : m_LocalCoreStartupParameter.iPosY); // TODO - HAX interface->Set("MainWindowWidth", m_LocalCoreStartupParameter.iWidth); interface->Set("MainWindowHeight", m_LocalCoreStartupParameter.iHeight); interface->Set("Language", 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("ThemeName40", m_LocalCoreStartupParameter.theme_name); }
void SConfig::SaveCoreSettings(IniFile& ini) { IniFile::Section* core = ini.GetOrCreateSection("Core"); core->Set("SkipIPL", bHLE_BS2); core->Set("TimingVariance", iTimingVariance); core->Set("CPUCore", cpu_core); 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("EnableCheats", bEnableCheats); core->Set("SelectedLanguage", SelectedLanguage); core->Set("OverrideGCLang", bOverrideGCLanguage); core->Set("DPL2Decoder", bDPL2Decoder); core->Set("AudioLatency", iLatency); core->Set("AudioStretch", m_audio_stretch); core->Set("AudioStretchMaxLatency", m_audio_stretch_max_latency); 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 < SerialInterface::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("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); core->Set("EnableSignatureChecks", m_enable_signature_checks); }
void SConfig::SaveInputSettings(IniFile& ini) { IniFile::Section* input = ini.GetOrCreateSection("Input"); input->Set("BackgroundInput", m_BackgroundInput); }
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 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("ColumnPlatform", m_showSystemColumn); gamelist->Set("ColumnBanner", m_showBannerColumn); gamelist->Set("ColumnDescription", m_showDescriptionColumn); gamelist->Set("ColumnTitle", m_showTitleColumn); 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("ColumnTags", m_showTagsColumn); }
void SConfig::SaveCoreSettings(IniFile& ini) { IniFile::Section* core = ini.GetOrCreateSection("Core"); core->Set("HLE_BS2", bHLE_BS2); core->Set("CPUCore", iCPUCore); core->Set("Fastmem", bFastmem); core->Set("CPUThread", bCPUThread); core->Set("DSPHLE", bDSPHLE); core->Set("SkipIdle", bSkipIdle); core->Set("SyncOnSkipIdle", bSyncGPUOnSkipIdleHack); core->Set("SyncGPU", bSyncGPU); core->Set("SyncGpuMaxDistance", iSyncGpuMaxDistance); core->Set("SyncGpuMinDistance", iSyncGpuMinDistance); core->Set("SyncGpuOverclock", fSyncGpuOverclock); 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("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("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("FrameLimit", m_Framelimit); 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("GameCubeAdapter", m_GameCubeAdapter); core->Set("AdapterRumble", m_AdapterRumble); core->Set("PerfMapDir", m_perfDir); }
void Config::Save() { if (jitForcedOff) { // if JIT has been forced off, we don't want to screw up the user's ppsspp.ini g_Config.bJit = true; } if (iniFilename_.size() && g_Config.bSaveSettings) { saveGameConfig(gameId_); CleanRecent(); IniFile iniFile; if (!iniFile.Load(iniFilename_.c_str())) { ERROR_LOG(LOADER, "Error saving config - can't read ini %s", iniFilename_.c_str()); } // Need to do this somewhere... bFirstRun = false; IterateSettings(iniFile, [&](IniFile::Section *section, ConfigSetting *setting) { if (!bGameSpecific || !setting->perGame_) { setting->Set(section); } }); IniFile::Section *recent = iniFile.GetOrCreateSection("Recent"); recent->Set("MaxRecent", iMaxRecent); for (int i = 0; i < iMaxRecent; i++) { char keyName[64]; snprintf(keyName, sizeof(keyName), "FileName%d", i); if (i < (int)recentIsos.size()) { recent->Set(keyName, recentIsos[i]); } else { recent->Delete(keyName); // delete the nonexisting FileName } } IniFile::Section *pinnedPaths = iniFile.GetOrCreateSection("PinnedPaths"); pinnedPaths->Clear(); for (size_t i = 0; i < vPinnedPaths.size(); ++i) { char keyName[64]; snprintf(keyName, sizeof(keyName), "Path%d", (int)i); pinnedPaths->Set(keyName, vPinnedPaths[i]); } IniFile::Section *control = iniFile.GetOrCreateSection("Control"); control->Delete("DPadRadius"); 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()); if (!bGameSpecific) //otherwise we already did this in saveGameConfig() { 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"); } if (jitForcedOff) { // force JIT off again just in case Config::Save() is called without exiting PPSSPP g_Config.bJit = false; } }
void VideoConfig::Save(const std::string& ini_file) { IniFile iniFile; iniFile.Load(ini_file); IniFile::Section* hardware = iniFile.GetOrCreateSection("Hardware"); hardware->Set("VSync", bVSync); hardware->Set("Adapter", iAdapter); IniFile::Section* settings = iniFile.GetOrCreateSection("Settings"); settings->Set("AspectRatio", iAspectRatio); settings->Set("Crop", bCrop); settings->Set("wideScreenHack", bWidescreenHack); settings->Set("UseXFB", bUseXFB); settings->Set("UseRealXFB", bUseRealXFB); settings->Set("SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples); settings->Set("ShowFPS", bShowFPS); settings->Set("LogFPSToFile", bLogFPSToFile); settings->Set("ShowInputDisplay", bShowInputDisplay); settings->Set("OverlayStats", bOverlayStats); settings->Set("OverlayProjStats", bOverlayProjStats); settings->Set("DumpTextures", bDumpTextures); settings->Set("HiresTextures", bHiresTextures); settings->Set("DumpEFBTarget", bDumpEFBTarget); settings->Set("DumpFrames", bDumpFrames); settings->Set("FreeLook", bFreeLook); settings->Set("UseFFV1", bUseFFV1); settings->Set("AnaglyphStereo", bAnaglyphStereo); settings->Set("AnaglyphStereoSeparation", iAnaglyphStereoSeparation); settings->Set("AnaglyphFocalAngle", iAnaglyphFocalAngle); settings->Set("EnablePixelLighting", bEnablePixelLighting); settings->Set("FastDepthCalc", bFastDepthCalc); settings->Set("ShowEFBCopyRegions", bShowEFBCopyRegions); settings->Set("MSAA", iMultisampleMode); settings->Set("EFBScale", iEFBScale); settings->Set("TexFmtOverlayEnable", bTexFmtOverlayEnable); settings->Set("TexFmtOverlayCenter", bTexFmtOverlayCenter); settings->Set("Wireframe", bWireFrame); settings->Set("DstAlphaPass", bDstAlphaPass); settings->Set("DisableFog", bDisableFog); settings->Set("OMPDecoder", bOMPDecoder); settings->Set("EnableShaderDebugging", bEnableShaderDebugging); IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements"); enhancements->Set("ForceFiltering", bForceFiltering); enhancements->Set("MaxAnisotropy", iMaxAnisotropy); enhancements->Set("PostProcessingShader", sPostProcessingShader); enhancements->Set("Enable3dVision", b3DVision); IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks"); hacks->Set("EFBAccessEnable", bEFBAccessEnable); hacks->Set("EFBCopyEnable", bEFBCopyEnable); hacks->Set("EFBToTextureEnable", bCopyEFBToTexture); hacks->Set("EFBScaledCopy", bCopyEFBScaled); hacks->Set("EFBCopyCacheEnable", bEFBCopyCacheEnable); hacks->Set("EFBEmulateFormatChanges", bEFBEmulateFormatChanges); iniFile.Save(ini_file); }
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::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 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"); } }
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"); } }