Exemplo n.º 1
0
void SConfig::LoadUSBPassthroughSettings(IniFile& ini)
{
  IniFile::Section* section = ini.GetOrCreateSection("USBPassthrough");
  m_usb_passthrough_devices.clear();
  std::string devices_string;
  section->Get("Devices", &devices_string, "");
  for (const auto& pair : SplitString(devices_string, ','))
  {
    const auto index = pair.find(':');
    if (index == std::string::npos)
      continue;

    const u16 vid = static_cast<u16>(strtol(pair.substr(0, index).c_str(), nullptr, 16));
    const u16 pid = static_cast<u16>(strtol(pair.substr(index + 1).c_str(), nullptr, 16));
    if (vid && pid)
      m_usb_passthrough_devices.emplace(vid, pid);
  }
}
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
}
Exemplo n.º 3
0
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", &currentDirectory, "");
	general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);
	// "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() > MAX_RECENT)
		recentIsos.resize(MAX_RECENT);

	IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
	cpu->Get("Jit", &bJit, true);
	//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("WindowZoom", &iWindowZoom, 2);
#else
	graphics->Get("WindowZoom", &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("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);	
	graphics->Get("StretchToDisplay", &bStretchToDisplay, false);
	graphics->Get("TrueColor", &bTrueColor, true);
	graphics->Get("MipMap", &bMipMap, false);

	IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
	sound->Get("Enable", &bEnableSound, true);

	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	control->Get("ShowStick", &bShowAnalogStick, false);
	control->Get("ShowTouchControls", &bShowTouchControls,
#ifdef USING_GLES2
		true);
#else
		false);
#endif
	control->Get("LargeControls", &bLargeControls, false);
	control->Get("KeyMapping",iMappingMap);
	control->Get("AccelerometerToAnalogHoriz", &bAccelerometerToAnalogHoriz, false);

	IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam");
	pspConfig->Get("Language", &ilanguage, PSP_SYSTEMPARAM_LANGUAGE_ENGLISH);
	pspConfig->Get("TimeFormat", &itimeformat, PSP_SYSTEMPARAM_TIME_FORMAT_24HR);
	pspConfig->Get("EncryptSave", &bEncryptSave, true);

	// Ephemeral settings
	bDrawWireframe = false;
}
Exemplo n.º 4
0
void SConfig::LoadFifoPlayerSettings(IniFile& ini)
{
	IniFile::Section* fifoplayer = ini.GetOrCreateSection("FifoPlayer");

	fifoplayer->Get("LoopReplay", &bLoopFifoReplay, true);
}
Exemplo n.º 5
0
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("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("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("FrameLimit",                &m_Framelimit,                                  1); // auto frame limit by default
	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("GameCubeAdapter",           &m_GameCubeAdapter,                             false);
	core->Get("AdapterRumble",             &m_AdapterRumble,                               true);
	core->Get("PerfMapDir",                &m_perfDir, "");
}
Exemplo n.º 6
0
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);
}
Exemplo n.º 7
0
void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
	const bool useIniFilename = iniFileName != nullptr && strlen(iniFileName) > 0;
	iniFilename_ = FindConfigFile(useIniFilename ? iniFileName : "ppsspp.ini");

	const bool useControllerIniFilename = controllerIniFilename != nullptr && strlen(controllerIniFilename) > 0;
	controllerIniFilename_ = FindConfigFile(useControllerIniFilename ? controllerIniFilename : "controls.ini");

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

	bShowFrameProfiler = 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.
	}

	for (size_t i = 0; i < ARRAY_SIZE(sections); ++i) {
		IniFile::Section *section = iniFile.GetOrCreateSection(sections[i].section);
		for (auto setting = sections[i].settings; setting->HasMore(); ++setting) {
			setting->Get(section);
		}
	}

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

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

	// Fix issue from switching from uint (hex in .ini) to int (dec)
	// -1 is okay, though. We'll just ignore recent stuff if it is.
	if (iMaxRecent == 0)
		iMaxRecent = 30;

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

			snprintf(keyName, sizeof(keyName), "FileName%d", i);
			if (recent->Get(keyName, &fileName, "") && !fileName.empty()) {
				recentIsos.push_back(fileName);
			}
		}
	}

	auto pinnedPaths = iniFile.GetOrCreateSection("PinnedPaths")->ToMap();
	vPinnedPaths.clear();
	for (auto it = pinnedPaths.begin(), end = pinnedPaths.end(); it != end; ++it) {
		vPinnedPaths.push_back(it->second);
	}

	if (iAnisotropyLevel > 4) {
		iAnisotropyLevel = 4;
	}

	// Check for an old dpad setting
	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	float f;
	control->Get("DPadRadius", &f, 0.0f);
	if (f > 0.0f) {
		ResetControlLayout();
	}

	// MIGRATION: For users who had the old static touch layout, aren't I nice?
	// We can probably kill this in 0.9.8 or something.
	if (fDpadX > 1.0 || fDpadY > 1.0) { // Likely the rest are too!
		float screen_width = dp_xres;
		float screen_height = dp_yres;

		fActionButtonCenterX /= screen_width;
		fActionButtonCenterY /= screen_height;
		fDpadX /= screen_width;
		fDpadY /= screen_height;
		fStartKeyX /= screen_width;
		fStartKeyY /= screen_height;
		fSelectKeyX /= screen_width;
		fSelectKeyY /= screen_height;
		fUnthrottleKeyX /= screen_width;
		fUnthrottleKeyY /= screen_height;
		fLKeyX /= screen_width;
		fLKeyY /= screen_height;
		fRKeyX /= screen_width;
		fRKeyY /= screen_height;
		fAnalogStickX /= screen_width;
		fAnalogStickY /= screen_height;
	}
	
	const char *gitVer = PPSSPP_GIT_VERSION;
	Version installed(gitVer);
	Version upgrade(upgradeVersion);
	const bool versionsValid = installed.IsValid() && upgrade.IsValid();

	// Do this regardless of iRunCount to prevent a silly bug where one might use an older
	// build of PPSSPP, receive an upgrade notice, then start a newer version, and still receive the upgrade notice,
	// even if said newer version is >= the upgrade found online.
	if ((dismissedVersion == upgradeVersion) || (versionsValid && (installed >= upgrade))) {
		upgradeMessage = "";
	}

	// Check for new version on every 10 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 !defined(ARMEABI)
	if (iRunCount % 10 == 0 && bCheckForNewVersion) {
		std::shared_ptr<http::Download> dl = g_DownloadManager.StartDownloadWithCallback(
			"http://www.ppsspp.org/version.json", "", &DownloadCompletedCallback);
		dl->SetHidden(true);
	}
#endif

	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);
	}
	
	//so this is all the way down here to overwrite the controller settings
	//sadly it won't benefit from all the "version conversion" going on up-above
	//but these configs shouldn't contain older versions anyhow
	if (bGameSpecific)
	{
		loadGameConfig(gameId_);
	}

	CleanRecent();

#ifdef _WIN32
	iTempGPUBackend = iGPUBackend;
#endif

	// Fix Wrong MAC address by old version by "Change MAC address"
	if (sMACAddress.length() != 17)
		sMACAddress = CreateRandMAC();

	if (g_Config.bAutoFrameSkip && g_Config.iRenderingMode == FB_NON_BUFFERED_MODE) {
		g_Config.iRenderingMode = FB_BUFFERED_MODE;
	}
}
Exemplo n.º 8
0
void CLogWindow::CreateGUIControls()
{
  IniFile ini;
  ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));

  IniFile::Section* options = ini.GetOrCreateSection("Options");
  IniFile::Section* log_window = ini.GetOrCreateSection("LogWindow");
  log_window->Get("x", &x, Parent->GetSize().GetX() / 2);
  log_window->Get("y", &y, Parent->GetSize().GetY());
  log_window->Get("pos", &winpos, wxAUI_DOCK_RIGHT);

  // Font
  m_FontChoice = new wxChoice(this, wxID_ANY);
  m_FontChoice->Bind(wxEVT_CHOICE, &CLogWindow::OnFontChange, this);
  m_FontChoice->Append(_("Default font"));
  m_FontChoice->Append(_("Monospaced font"));
  m_FontChoice->Append(_("Selected font"));

  DefaultFont = GetFont();
  MonoSpaceFont.SetFamily(wxFONTFAMILY_TELETYPE);
#ifdef _WIN32
  // Windows uses Courier New for monospace even though there are better fonts.
  MonoSpaceFont.SetFaceName("Consolas");
#endif
  MonoSpaceFont.SetPointSize(DefaultFont.GetPointSize());
  LogFont.push_back(DefaultFont);
  LogFont.push_back(MonoSpaceFont);
  LogFont.push_back(DebuggerFont);

  int font;
  options->Get("Font", &font, 0);
  m_FontChoice->SetSelection(font);

  // Word wrap
  bool wrap_lines;
  options->Get("WrapLines", &wrap_lines, false);
  m_WrapLine = new wxCheckBox(this, wxID_ANY, _("Word Wrap"));
  m_WrapLine->Bind(wxEVT_CHECKBOX, &CLogWindow::OnWrapLineCheck, this);
  m_WrapLine->SetValue(wrap_lines);

  // Log viewer
  m_Log = CreateTextCtrl(this, wxID_ANY, wxTE_RICH | wxTE_MULTILINE | wxTE_READONLY |
                                             (wrap_lines ? wxTE_WORDWRAP : wxTE_DONTWRAP));

  // submit row
  m_cmdline = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
                             wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB);

  // Clear log button
  m_clear_log_btn =
      new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
  m_clear_log_btn->Bind(wxEVT_BUTTON, &CLogWindow::OnClear, this);

  const int space3 = FromDIP(3);

  // Sizers
  wxBoxSizer* sTop = new wxBoxSizer(wxHORIZONTAL);
  sTop->Add(m_clear_log_btn, 0, wxALIGN_CENTER_VERTICAL);
  sTop->Add(m_FontChoice, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, space3);
  sTop->Add(m_WrapLine, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, space3);

  sBottom = new wxBoxSizer(wxVERTICAL);
  PopulateBottom();

  wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
  sMain->Add(sTop, 0, wxEXPAND);
  sMain->Add(sBottom, 1, wxEXPAND);
  SetSizer(sMain);

  m_cmdline->SetFocus();
}
Exemplo n.º 9
0
void CConfig::Load(const char *iniFileName)
{
	iniFilename_ = iniFileName;
	NOTICE_LOG(LOADER, "Loading config: %s", iniFileName);
	bSaveSettings = true;

	IniFile iniFile;
	iniFile.Load(iniFileName);

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

	bSpeedLimit = false;
	general->Get("FirstRun", &bFirstRun, true);
	general->Get("AutoLoadLast", &bAutoLoadLast, false);
	general->Get("AutoRun", &bAutoRun, false);
	general->Get("ConfirmOnQuit", &bConfirmOnQuit, false);
	general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true);
	general->Get("CurrentDirectory", &currentDirectory, "");
	general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);
	IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
	cpu->Get("Core", &iCpuCore, 0);

	IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics");
	graphics->Get("ShowFPSCounter", &bShowFPSCounter, false);
	graphics->Get("DisplayFramebuffer", &bDisplayFramebuffer, false);
	graphics->Get("WindowZoom", &iWindowZoom, 1);
	graphics->Get("BufferedRendering", &bBufferedRendering, true);

	IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
	sound->Get("Enable", &bEnableSound, true);

	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	control->Get("ShowStick", &bShowAnalogStick, false);
	control->Get("ShowTouchControls", &bShowTouchControls, true);
}
Exemplo n.º 10
0
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("MainWindowPosX", &iPosX, INT_MIN);
  interface->Get("MainWindowPosY", &iPosY, INT_MIN);
  interface->Get("MainWindowWidth", &iWidth, -1);
  interface->Get("MainWindowHeight", &iHeight, -1);
  interface->Get("LanguageCode", &m_InterfaceLanguage, "");
  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("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("DisableTooltips", &m_DisableTooltips, false);
}
Exemplo n.º 11
0
void SConfig::LoadGeneralSettings(IniFile& ini)
{
  IniFile::Section* general = ini.GetOrCreateSection("General");

  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));
    }
  }

  general->Get("RecursiveISOPaths", &m_RecursiveISOFolder, false);
  general->Get("NANDRootPath", &m_NANDPath);
  File::SetUserPath(D_WIIROOT_IDX, m_NANDPath);
  general->Get("DumpPath", &m_DumpPath);
  CreateDumpPath(m_DumpPath);
  general->Get("WirelessMac", &m_WirelessMac);
  general->Get("WiiSDCardPath", &m_strWiiSDCardPath, File::GetUserPath(F_WIISDCARD_IDX));
  File::SetUserPath(F_WIISDCARD_IDX, m_strWiiSDCardPath);
}
Exemplo n.º 12
0
void VideoConfig::Load(const std::string& ini_file)
{
	IniFile iniFile;
	iniFile.Load(ini_file);

	IniFile::Section* hardware = iniFile.GetOrCreateSection("Hardware");
	hardware->Get("VSync", &bVSync, 0);
	hardware->Get("Adapter", &iAdapter, 0);

	IniFile::Section* settings = iniFile.GetOrCreateSection("Settings");
	settings->Get("wideScreenHack", &bWidescreenHack, false);
	settings->Get("AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
	settings->Get("Crop", &bCrop, false);
	settings->Get("UseXFB", &bUseXFB, 0);
	settings->Get("UseRealXFB", &bUseRealXFB, 0);
	settings->Get("SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples, 128);
	settings->Get("ShowFPS", &bShowFPS, false);
	settings->Get("LogRenderTimeToFile", &bLogRenderTimeToFile, false);
	settings->Get("ShowInputDisplay", &bShowInputDisplay, false);
	settings->Get("OverlayStats", &bOverlayStats, false);
	settings->Get("OverlayProjStats", &bOverlayProjStats, false);
	settings->Get("ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
	settings->Get("DumpTextures", &bDumpTextures, 0);
	settings->Get("DumpVertexLoader", &bDumpVertexLoaders, 0);
	settings->Get("HiresTextures", &bHiresTextures, 0);
	settings->Get("HiresMaterialMaps", &bHiresMaterialMaps, 0);
	settings->Get("ConvertHiresTextures", &bConvertHiresTextures, 0);
	settings->Get("CacheHiresTextures", &bCacheHiresTextures, 0);
	settings->Get("CacheHiresTexturesonGPU", &bCacheHiresTexturesGPU, 0);
	settings->Get("DumpEFBTarget", &bDumpEFBTarget, 0);
	settings->Get("FreeLook", &bFreeLook, 0);
	settings->Get("UseFFV1", &bUseFFV1, 0);
	settings->Get("EnablePixelLighting", &bEnablePixelLighting, 0);
	settings->Get("ForcePhongShading", &bForcePhongShading, 0);

	settings->Get("FastDepthCalc", &bFastDepthCalc, true);
	settings->Get("MSAA", &iMultisampleMode, 0);
	settings->Get("EFBScale", &iEFBScale, (int)SCALE_1X); // native	
	settings->Get("TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
	settings->Get("TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
	settings->Get("WireFrame", &bWireFrame, 0);
	settings->Get("DisableFog", &bDisableFog, 0);
	settings->Get("SSAA", &bSSAA, false);
	settings->Get("EnableOpenCL", &bEnableOpenCL, false);
	settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false);
	settings->Get("BorderlessFullscreen", &bBorderlessFullscreen, false);

	IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
	enhancements->Get("ForceFiltering", &bForceFiltering, 0);
	enhancements->Get("MaxAnisotropy", &iMaxAnisotropy, 0);  // NOTE - this is x in (1 << x)
	enhancements->Get("PostProcessingShader", &sPostProcessingShader, "");
	enhancements->Get("StereoMode", &iStereoMode, 0);
	enhancements->Get("StereoDepth", &iStereoDepth, 20);
	enhancements->Get("StereoConvergence", &iStereoConvergence, 20);
	enhancements->Get("StereoSwapEyes", &bStereoSwapEyes, false);
	enhancements->Get("UseScalingFilter", &bUseScalingFilter, false);
	enhancements->Get("TextureScalingType", &iTexScalingType, 0);
	enhancements->Get("TextureScalingFactor", &iTexScalingFactor, 2);
	enhancements->Get("UseDePosterize", &bTexDeposterize, false);

	//currently these settings are not saved in global config, so we could've initialized them directly
	for (size_t i = 0; i < oStereoPresets.size(); ++i)
	{
	   enhancements->Get(StringFromFormat("StereoConvergence_%zu", i), &oStereoPresets[i].depth, iStereoConvergence);
	   enhancements->Get(StringFromFormat("StereoDepth_%zu", i), &oStereoPresets[i].convergence, iStereoDepth);
	}
	enhancements->Get("StereoActivePreset", &iStereoActivePreset, 0);
	iStereoConvergence = oStereoPresets[iStereoActivePreset].convergence;
	iStereoDepth = oStereoPresets[iStereoActivePreset].depth;

	IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
	hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true);
	hacks->Get("EFBFastAccess", &bEFBFastAccess, false);
	hacks->Get("ForceProgressive", &bForceProgressive, true);
	hacks->Get("EFBToTextureEnable", &bSkipEFBCopyToRam, true);
	hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true);
	hacks->Get("EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);
	hacks->Get("ForceDualSourceBlend", &bForceDualSourceBlend, false);
	hacks->Get("FullAsyncShaderCompilation", &bFullAsyncShaderCompilation, false);
	hacks->Get("WaitForShaderCompilation", &bWaitForShaderCompilation, false);
	hacks->Get("PredictiveFifo", &bPredictiveFifo, false);
	hacks->Get("BoundingBoxMode", &iBBoxMode, (int)BBoxMode::BBoxGPU);

	// hacks which are disabled by default
	iPhackvalue[0] = 0;
	bPerfQueriesEnable = false;

	// Load common settings
	iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
	IniFile::Section* interface = iniFile.GetOrCreateSection("Interface");
	bool bTmp;
	interface->Get("UsePanicHandlers", &bTmp, true);
	SetEnableAlert(bTmp);

	// Shader Debugging causes a huge slowdown and it's easy to forget about it
	// since it's not exposed in the settings dialog. It's only used by
	// developers, so displaying an obnoxious message avoids some confusion and
	// is not too annoying/confusing for users.
	//
	// XXX(delroth): This is kind of a bad place to put this, but the current
	// VideoCommon is a mess and we don't have a central initialization
	// function to do these kind of checks. Instead, the init code is
	// triplicated for each video backend.
	if (bEnableShaderDebugging)
		OSD::AddMessage("Warning: Shader Debugging is enabled, performance will suffer heavily", 15000);
	VerifyValidity();
}
Exemplo n.º 13
0
void VideoConfig::GameIniLoad()
{
	bool gfx_override_exists = false;

	// XXX: Again, bad place to put OSD messages at (see delroth's comment above)
	// XXX: This will add an OSD message for each projection hack value... meh
#define CHECK_SETTING(section, key, var) do { \
		decltype(var) temp = var; \
		if (iniFile.GetIfExists(section, key, &var) && var != temp) { \
			std::string msg = StringFromFormat("Note: Option \"%s\" is overridden by game ini.", key); \
			OSD::AddMessage(msg, 7500); \
			gfx_override_exists = true; \
		} \
	} while (0)

	IniFile iniFile = SConfig::GetInstance().LoadGameIni();

	CHECK_SETTING("Video_Hardware", "VSync", bVSync);

	CHECK_SETTING("Video_Settings", "wideScreenHack", bWidescreenHack);
	CHECK_SETTING("Video_Settings", "AspectRatio", iAspectRatio);
	CHECK_SETTING("Video_Settings", "Crop", bCrop);
	CHECK_SETTING("Video_Settings", "UseXFB", bUseXFB);
	CHECK_SETTING("Video_Settings", "UseRealXFB", bUseRealXFB);
	CHECK_SETTING("Video_Settings", "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
	CHECK_SETTING("Video_Settings", "HiresTextures", bHiresTextures);
	CHECK_SETTING("Video_Settings", "HiresMaterialMaps", bHiresMaterialMaps);

	CHECK_SETTING("Video_Settings", "ConvertHiresTextures", bConvertHiresTextures);
	CHECK_SETTING("Video_Settings", "CacheHiresTextures", bCacheHiresTextures);
	CHECK_SETTING("Video_Settings", "CacheHiresTexturesonGPU", bCacheHiresTexturesGPU);
	CHECK_SETTING("Video_Settings", "EnablePixelLighting", bEnablePixelLighting);
	CHECK_SETTING("Video_Settings", "ForcePhongShading", bForcePhongShading);

	CHECK_SETTING("Video_Settings", "FastDepthCalc", bFastDepthCalc);
	CHECK_SETTING("Video_Settings", "MSAA", iMultisampleMode);
	CHECK_SETTING("Video_Settings", "SSAA", bSSAA);
	int tmp = -9000;
	CHECK_SETTING("Video_Settings", "EFBScale", tmp); // integral
	if (tmp != -9000)
	{
		if (tmp != SCALE_FORCE_INTEGRAL)
		{
			iEFBScale = tmp;
		}
		else // Round down to multiple of native IR
		{
			switch (iEFBScale)
			{
			case SCALE_AUTO:
				iEFBScale = SCALE_AUTO_INTEGRAL;
				break;
			case SCALE_1_5X:
				iEFBScale = SCALE_1X;
				break;
			case SCALE_2_5X:
				iEFBScale = SCALE_2X;
				break;
			default:
				break;
			}
		}
	}

	CHECK_SETTING("Video_Settings", "DisableFog", bDisableFog);
	CHECK_SETTING("Video_Settings", "EnableOpenCL", bEnableOpenCL);

	CHECK_SETTING("Video_Enhancements", "ForceFiltering", bForceFiltering);
	CHECK_SETTING("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy);  // NOTE - this is x in (1 << x)
	CHECK_SETTING("Video_Enhancements", "PostProcessingShader", sPostProcessingShader);
	CHECK_SETTING("Video_Enhancements", "StereoMode", iStereoMode);
	CHECK_SETTING("Video_Enhancements", "StereoDepth", iStereoDepth);
	CHECK_SETTING("Video_Enhancements", "StereoConvergence", iStereoConvergence);
	CHECK_SETTING("Video_Enhancements", "StereoSwapEyes", bStereoSwapEyes);
	CHECK_SETTING("Video_Enhancements", "UseScalingFilter", bUseScalingFilter);
	CHECK_SETTING("Video_Enhancements", "TextureScalingType", iTexScalingType);
	CHECK_SETTING("Video_Enhancements", "TextureScalingFactor", iTexScalingFactor);
	CHECK_SETTING("Video_Enhancements", "UseDePosterize", bTexDeposterize);

	//these are not overrides, they are per-game settings, hence no warning
	IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
	for (size_t i = 0; i < oStereoPresets.size(); ++i)
	{
	   enhancements->Get(StringFromFormat("StereoConvergence_%zu", i), &oStereoPresets[i].depth, iStereoConvergence);
	   enhancements->Get(StringFromFormat("StereoDepth_%zu", i), &oStereoPresets[i].convergence, iStereoDepth);
	}
	enhancements->Get("StereoActivePreset", &iStereoActivePreset, 0);
	iStereoConvergence = oStereoPresets[iStereoActivePreset].convergence;
	iStereoDepth = oStereoPresets[iStereoActivePreset].depth;


	CHECK_SETTING("Video_Stereoscopy", "StereoEFBMonoDepth", bStereoEFBMonoDepth);
	CHECK_SETTING("Video_Stereoscopy", "StereoDepthPercentage", iStereoDepthPercentage);
	CHECK_SETTING("Video_Stereoscopy", "StereoConvergenceMinimum", iStereoConvergenceMinimum);

	CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
	CHECK_SETTING("Video_Hacks", "EFBFastAccess", bEFBFastAccess);
	CHECK_SETTING("Video_Hacks", "ForceProgressive", bForceProgressive);
	CHECK_SETTING("Video_Hacks", "EFBToTextureEnable", bSkipEFBCopyToRam);
	CHECK_SETTING("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
	CHECK_SETTING("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
	CHECK_SETTING("Video_Hacks", "BoundingBoxMode", iBBoxMode);

	CHECK_SETTING("Video", "ProjectionHack", iPhackvalue[0]);
	CHECK_SETTING("Video", "PH_SZNear", iPhackvalue[1]);
	CHECK_SETTING("Video", "PH_SZFar", iPhackvalue[2]);
	CHECK_SETTING("Video", "PH_ExtraParam", iPhackvalue[3]);
	CHECK_SETTING("Video", "PH_ZNear", sPhackvalue[0]);
	CHECK_SETTING("Video", "PH_ZFar", sPhackvalue[1]);
	CHECK_SETTING("Video", "ZTPSpeedupHack", bZTPSpeedHack);
	CHECK_SETTING("Video", "PerfQueriesEnable", bPerfQueriesEnable);
	CHECK_SETTING("Video", "FullAsyncShaderCompilation", bFullAsyncShaderCompilation);
	CHECK_SETTING("Video", "WaitForShaderCompilation", bWaitForShaderCompilation);
	CHECK_SETTING("Video", "PredictiveFifo", bPredictiveFifo);
	if (gfx_override_exists)
		OSD::AddMessage("Warning: Opening the graphics configuration will reset settings and might cause issues!", 10000);
}
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);
}
Exemplo n.º 15
0
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);
}
Exemplo n.º 16
0
void Config::Load(const char *iniFileName, const char *controllerIniFilename)
{
	iniFilename_ = iniFileName;
	controllerIniFilename_ = controllerIniFilename;
	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");

	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);
	general->Get("Language", &languageIni, "en_US");
	general->Get("NumWorkerThreads", &iNumWorkerThreads, cpu_info.num_cores);
	general->Get("EnableCheats", &bEnableCheats, false);
	general->Get("MaxRecent", &iMaxRecent, 30);
	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);

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

	// "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);
#endif

	if ((int)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
	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);
#ifdef _WIN32
	graphics->Get("ResolutionScale", &iWindowZoom, 2);
#else
	graphics->Get("ResolutionScale", &iWindowZoom, 1);
#endif
	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);
	graphics->Get("SSAA", &bAntiAliasing, 0);
	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);
	graphics->Get("FullScreenOnLaunch", &bFullScreenOnLaunch, 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);

	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_GetName();
	if (name == "NVIDIA:SHIELD" || name == "Sony Ericsson:R800i" || name == "Sony Ericsson:zeus") {
		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("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);

	IniFile::Section *gleshacks = iniFile.GetOrCreateSection("GLESHacks");
	gleshacks->Get("PrescaleUV", &bPrescaleUV, false);

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

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

	CleanRecent();
}
Exemplo n.º 17
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.º 18
0
void SConfig::LoadCoreSettings(IniFile& ini)
{
  IniFile::Section* core = ini.GetOrCreateSection("Core");

  core->Get("SkipIPL", &bHLE_BS2, true);
#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("SyncOnSkipIdle", &bSyncGPUOnSkipIdleHack, true);
  core->Get("DefaultISO", &m_strDefaultISO);
  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("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], 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("DCBZ", &bDCBZOFF, 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("FrameSkip", &m_FrameSkip, 0);
  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);
}
Exemplo n.º 19
0
void CConfig::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("ConfirmOnQuit", &bConfirmOnQuit, false);
	general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true);
	general->Get("CurrentDirectory", &currentDirectory, "");
	general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);

	IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
	cpu->Get("Core", &iCpuCore, 0);
	cpu->Get("FastMemory", &bFastMemory, false);

	IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics");
	graphics->Get("ShowFPSCounter", &bShowFPSCounter, false);
	graphics->Get("DisplayFramebuffer", &bDisplayFramebuffer, false);
	graphics->Get("WindowZoom", &iWindowZoom, 1);
	graphics->Get("BufferedRendering", &bBufferedRendering, true);
	graphics->Get("HardwareTransform", &bHardwareTransform, true);
	graphics->Get("LinearFiltering", &bLinearFiltering, false);
	graphics->Get("SSAA", &SSAntiAlaising, 0);
	graphics->Get("VBO", &bUseVBO, true);
	graphics->Get("DisableG3DLog", &bDisableG3DLog, false);

	IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
	sound->Get("Enable", &bEnableSound, true);

	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	control->Get("ShowStick", &bShowAnalogStick, false);
	control->Get("ShowTouchControls", &bShowTouchControls,
#ifdef USING_GLES2
		true);
#else
		false);
#endif

	// Ephemeral settings
	bDrawWireframe = false;
}
Exemplo n.º 20
0
void CLogWindow::CreateGUIControls()
{
  IniFile ini;
  ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));

  IniFile::Section* options = ini.GetOrCreateSection("Options");
  IniFile::Section* log_window = ini.GetOrCreateSection("LogWindow");
  log_window->Get("x", &x, Parent->GetSize().GetX() / 2);
  log_window->Get("y", &y, Parent->GetSize().GetY());
  log_window->Get("pos", &winpos, wxAUI_DOCK_RIGHT);

  // Set up log listeners
  int verbosity;
  options->Get("Verbosity", &verbosity, 0);

  // Ensure the verbosity level is valid
  if (verbosity < 1)
    verbosity = 1;
  if (verbosity > MAX_LOGLEVEL)
    verbosity = MAX_LOGLEVEL;

  // Get the logger output settings from the config ini file.
  options->Get("WriteToFile", &m_writeFile, false);
  options->Get("WriteToWindow", &m_writeWindow, true);

  IniFile::Section* logs = ini.GetOrCreateSection("Logs");
  for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
  {
    bool enable;
    logs->Get(m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &enable, false);

    if (m_writeWindow && enable)
      m_LogManager->AddListener((LogTypes::LOG_TYPE)i, LogListener::LOG_WINDOW_LISTENER);
    else
      m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, LogListener::LOG_WINDOW_LISTENER);

    if (m_writeFile && enable)
      m_LogManager->AddListener((LogTypes::LOG_TYPE)i, LogListener::FILE_LISTENER);
    else
      m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, LogListener::FILE_LISTENER);

    m_LogManager->SetLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)(verbosity));
  }
  m_has_listeners = true;

  // Font
  m_FontChoice = new wxChoice(this, wxID_ANY);
  m_FontChoice->Bind(wxEVT_CHOICE, &CLogWindow::OnFontChange, this);
  m_FontChoice->Append(_("Default font"));
  m_FontChoice->Append(_("Monospaced font"));
  m_FontChoice->Append(_("Selected font"));

  DefaultFont = GetFont();
  MonoSpaceFont.SetNativeFontInfoUserDesc("lucida console windows-1252");
  LogFont.push_back(DefaultFont);
  LogFont.push_back(MonoSpaceFont);
  LogFont.push_back(DebuggerFont);

  int font;
  options->Get("Font", &font, 0);
  m_FontChoice->SetSelection(font);

  // Word wrap
  bool wrap_lines;
  options->Get("WrapLines", &wrap_lines, false);
  m_WrapLine = new wxCheckBox(this, wxID_ANY, _("Word Wrap"));
  m_WrapLine->Bind(wxEVT_CHECKBOX, &CLogWindow::OnWrapLineCheck, this);
  m_WrapLine->SetValue(wrap_lines);

  // Log viewer
  m_Log = CreateTextCtrl(this, wxID_ANY, wxTE_RICH | wxTE_MULTILINE | wxTE_READONLY |
                                             (wrap_lines ? wxTE_WORDWRAP : wxTE_DONTWRAP));

  // submit row
  m_cmdline = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
                             wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB);

  // Clear log button
  m_clear_log_btn =
      new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
  m_clear_log_btn->Bind(wxEVT_BUTTON, &CLogWindow::OnClear, this);

  const int space3 = FromDIP(3);

  // Sizers
  wxBoxSizer* sTop = new wxBoxSizer(wxHORIZONTAL);
  sTop->Add(m_clear_log_btn, 0, wxALIGN_CENTER_VERTICAL);
  sTop->Add(m_FontChoice, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, space3);
  sTop->Add(m_WrapLine, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, space3);

  sBottom = new wxBoxSizer(wxVERTICAL);
  PopulateBottom();

  wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL);
  sMain->Add(sTop, 0, wxEXPAND);
  sMain->Add(sBottom, 1, wxEXPAND);
  SetSizer(sMain);

  m_cmdline->SetFocus();
}
Exemplo n.º 21
0
LogManager::LogManager()
{
	// create log containers
	m_Log[LogTypes::ACTIONREPLAY]       = new LogContainer("ActionReplay",    "ActionReplay");
	m_Log[LogTypes::AUDIO]              = new LogContainer("Audio",           "Audio Emulator");
	m_Log[LogTypes::AUDIO_INTERFACE]    = new LogContainer("AI",              "Audio Interface (AI)");
	m_Log[LogTypes::BOOT]               = new LogContainer("BOOT",            "Boot");
	m_Log[LogTypes::COMMANDPROCESSOR]   = new LogContainer("CP",              "CommandProc");
	m_Log[LogTypes::COMMON]             = new LogContainer("COMMON",          "Common");
	m_Log[LogTypes::CONSOLE]            = new LogContainer("CONSOLE",         "Dolphin Console");
	m_Log[LogTypes::DISCIO]             = new LogContainer("DIO",             "Disc IO");
	m_Log[LogTypes::DSPHLE]             = new LogContainer("DSPHLE",          "DSP HLE");
	m_Log[LogTypes::DSPLLE]             = new LogContainer("DSPLLE",          "DSP LLE");
	m_Log[LogTypes::DSP_MAIL]           = new LogContainer("DSPMails",        "DSP Mails");
	m_Log[LogTypes::DSPINTERFACE]       = new LogContainer("DSP",             "DSPInterface");
	m_Log[LogTypes::DVDINTERFACE]       = new LogContainer("DVD",             "DVD Interface");
	m_Log[LogTypes::DYNA_REC]           = new LogContainer("JIT",             "Dynamic Recompiler");
	m_Log[LogTypes::EXPANSIONINTERFACE] = new LogContainer("EXI",             "Expansion Interface");
	m_Log[LogTypes::FILEMON]            = new LogContainer("FileMon",         "File Monitor");
	m_Log[LogTypes::GDB_STUB]           = new LogContainer("GDB_STUB",        "GDB Stub");
	m_Log[LogTypes::GPFIFO]             = new LogContainer("GP",              "GPFifo");
	m_Log[LogTypes::HOST_GPU]           = new LogContainer("Host GPU",        "Host GPU");
	m_Log[LogTypes::MASTER_LOG]         = new LogContainer("*",               "Master Log");
	m_Log[LogTypes::MEMCARD_MANAGER]    = new LogContainer("MemCard Manager", "MemCard Manager");
	m_Log[LogTypes::MEMMAP]             = new LogContainer("MI",              "MI & memmap");
	m_Log[LogTypes::NETPLAY]            = new LogContainer("NETPLAY",         "Netplay");
	m_Log[LogTypes::OSHLE]              = new LogContainer("HLE",             "HLE");
	m_Log[LogTypes::OSREPORT]           = new LogContainer("OSREPORT",        "OSReport");
	m_Log[LogTypes::PAD]                = new LogContainer("PAD",             "Pad");
	m_Log[LogTypes::PIXELENGINE]        = new LogContainer("PE",              "PixelEngine");
	m_Log[LogTypes::PROCESSORINTERFACE] = new LogContainer("PI",              "ProcessorInt");
	m_Log[LogTypes::POWERPC]            = new LogContainer("PowerPC",         "IBM CPU");
	m_Log[LogTypes::SERIALINTERFACE]    = new LogContainer("SI",              "Serial Interface (SI)");
	m_Log[LogTypes::SP1]                = new LogContainer("SP1",             "Serial Port 1");
	m_Log[LogTypes::VIDEO]              = new LogContainer("Video",           "Video Backend");
	m_Log[LogTypes::VIDEOINTERFACE]     = new LogContainer("VI",              "Video Interface (VI)");
	m_Log[LogTypes::WIIMOTE]            = new LogContainer("Wiimote",         "Wiimote");
	m_Log[LogTypes::WII_IPC]            = new LogContainer("WII_IPC",         "WII IPC");
	m_Log[LogTypes::WII_IPC_DVD]        = new LogContainer("WII_IPC_DVD",     "WII IPC DVD");
	m_Log[LogTypes::WII_IPC_ES]         = new LogContainer("WII_IPC_ES",      "WII IPC ES");
	m_Log[LogTypes::WII_IPC_FILEIO]     = new LogContainer("WII_IPC_FILEIO",  "WII IPC FILEIO");
	m_Log[LogTypes::WII_IPC_HID]        = new LogContainer("WII_IPC_HID",     "WII IPC HID");
	m_Log[LogTypes::WII_IPC_HLE]        = new LogContainer("WII_IPC_HLE",     "WII IPC HLE");
	m_Log[LogTypes::WII_IPC_SD]         = new LogContainer("WII_IPC_SD",      "WII IPC SD");
	m_Log[LogTypes::WII_IPC_SSL]        = new LogContainer("WII_IPC_SSL",     "WII IPC SSL");
	m_Log[LogTypes::WII_IPC_STM]        = new LogContainer("WII_IPC_STM",     "WII IPC STM");
	m_Log[LogTypes::WII_IPC_NET]        = new LogContainer("WII_IPC_NET",     "WII IPC NET");
	m_Log[LogTypes::WII_IPC_WC24]       = new LogContainer("WII_IPC_WC24",    "WII IPC WC24");
	m_Log[LogTypes::WII_IPC_WIIMOTE]    = new LogContainer("WII_IPC_WIIMOTE", "WII IPC WIIMOTE");

	RegisterListener(LogListener::FILE_LISTENER, new FileLogListener(File::GetUserPath(F_MAINLOG_IDX)));
	RegisterListener(LogListener::CONSOLE_LISTENER, new ConsoleListener());

	IniFile ini;
	ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
	IniFile::Section* logs = ini.GetOrCreateSection("Logs");
	IniFile::Section* options = ini.GetOrCreateSection("Options");
	bool write_file;
	bool write_console;
	options->Get("WriteToFile", &write_file, false);
	options->Get("WriteToConsole", &write_console, true);

	for (LogContainer* container : m_Log)
	{
		bool enable;
		logs->Get(container->GetShortName(), &enable, false);
		container->SetEnable(enable);
		if (enable && write_file)
			container->AddListener(LogListener::FILE_LISTENER);
		if (enable && write_console)
			container->AddListener(LogListener::CONSOLE_LISTENER);
	}
}
Exemplo n.º 22
0
void VideoConfig::Load(const std::string& ini_file)
{
	IniFile iniFile;
	iniFile.Load(ini_file);

	IniFile::Section* hardware = iniFile.GetOrCreateSection("Hardware");
	hardware->Get("VSync", &bVSync, 0);
	hardware->Get("Adapter", &iAdapter, 0);

	IniFile::Section* settings = iniFile.GetOrCreateSection("Settings");
	settings->Get("wideScreenHack", &bWidescreenHack, false);
	settings->Get("AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
	settings->Get("Crop", &bCrop, false);
	settings->Get("UseXFB", &bUseXFB, 0);
	settings->Get("UseRealXFB", &bUseRealXFB, 0);
	settings->Get("SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples, 128);
	settings->Get("ShowFPS", &bShowFPS, false);
	settings->Get("LogRenderTimeToFile", &bLogRenderTimeToFile, false);
	settings->Get("OverlayStats", &bOverlayStats, false);
	settings->Get("OverlayProjStats", &bOverlayProjStats, false);
	settings->Get("DumpTextures", &bDumpTextures, 0);
	settings->Get("HiresTextures", &bHiresTextures, 0);
	settings->Get("ConvertHiresTextures", &bConvertHiresTextures, 0);
	settings->Get("CacheHiresTextures", &bCacheHiresTextures, 0);
	settings->Get("DumpEFBTarget", &bDumpEFBTarget, 0);
	settings->Get("FreeLook", &bFreeLook, 0);
	settings->Get("UseFFV1", &bUseFFV1, 0);
	settings->Get("EnablePixelLighting", &bEnablePixelLighting, 0);
	settings->Get("FastDepthCalc", &bFastDepthCalc, true);
	settings->Get("MSAA", &iMultisamples, 1);
	settings->Get("SSAA", &bSSAA, false);
	settings->Get("EFBScale", &iEFBScale, (int)SCALE_1X); // native
	settings->Get("TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
	settings->Get("TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
	settings->Get("WireFrame", &bWireFrame, 0);
	settings->Get("DisableFog", &bDisableFog, 0);
	settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false);
	settings->Get("BorderlessFullscreen", &bBorderlessFullscreen, false);

	settings->Get("SWZComploc", &bZComploc, true);
	settings->Get("SWZFreeze", &bZFreeze, true);
	settings->Get("SWDumpObjects", &bDumpObjects, false);
	settings->Get("SWDumpTevStages", &bDumpTevStages, false);
	settings->Get("SWDumpTevTexFetches", &bDumpTevTextureFetches, false);
	settings->Get("SWDrawStart", &drawStart, 0);
	settings->Get("SWDrawEnd", &drawEnd, 100000);


	IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
	enhancements->Get("ForceFiltering", &bForceFiltering, 0);
	enhancements->Get("MaxAnisotropy", &iMaxAnisotropy, 0);  // NOTE - this is x in (1 << x)
	enhancements->Get("PostProcessingShader", &sPostProcessingShader, "");

	IniFile::Section* stereoscopy = iniFile.GetOrCreateSection("Stereoscopy");
	stereoscopy->Get("StereoMode", &iStereoMode, 0);
	stereoscopy->Get("StereoDepth", &iStereoDepth, 20);
	stereoscopy->Get("StereoConvergencePercentage", &iStereoConvergencePercentage, 100);
	stereoscopy->Get("StereoSwapEyes", &bStereoSwapEyes, false);

	IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
	hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true);
	hacks->Get("BBoxEnable", &bBBoxEnable, false);
	hacks->Get("ForceProgressive", &bForceProgressive, true);
	hacks->Get("EFBToTextureEnable", &bSkipEFBCopyToRam, true);
	hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true);
	hacks->Get("EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);

	// hacks which are disabled by default
	iPhackvalue[0] = 0;
	bPerfQueriesEnable = false;

	// Load common settings
	iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
	IniFile::Section* interface = iniFile.GetOrCreateSection("Interface");
	bool bTmp;
	interface->Get("UsePanicHandlers", &bTmp, true);
	SetEnableAlert(bTmp);

	// Shader Debugging causes a huge slowdown and it's easy to forget about it
	// since it's not exposed in the settings dialog. It's only used by
	// developers, so displaying an obnoxious message avoids some confusion and
	// is not too annoying/confusing for users.
	//
	// XXX(delroth): This is kind of a bad place to put this, but the current
	// VideoCommon is a mess and we don't have a central initialization
	// function to do these kind of checks. Instead, the init code is
	// triplicated for each video backend.
	if (bEnableShaderDebugging)
		OSD::AddMessage("Warning: Shader Debugging is enabled, performance will suffer heavily", 15000);

	VerifyValidity();
}
Exemplo n.º 23
0
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);
}
Exemplo n.º 24
0
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", &currentDirectory, "");
	general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);
	general->Get("Language", &languageIni, "en_US");
	general->Get("NumWorkerThreads", &iNumWorkerThreads, cpu_info.num_cores);
	general->Get("EnableCheats", &bEnableCheats, false);
	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);
#ifdef _WIN32
	general->Get("TopMost", &bTopMost);
#endif

	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);
#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);
	graphics->Get("MipMap", &bMipMap, true);
	graphics->Get("TexScalingLevel", &iTexScalingLevel, 1);
	graphics->Get("TexScalingType", &iTexScalingType, 0);
	graphics->Get("TexDeposterize", &bTexDeposterize, false);
	graphics->Get("VSyncInterval", &iVSyncInterval, 0);

	IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
	sound->Get("Enable", &bEnableSound, true);
	sound->Get("EnableAtrac3plus", &bEnableAtrac3plus, true);
	
	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);
	control->Get("RightStickBind", &iRightStickBind, 0);
	control->Get("TouchButtonOpacity", &iTouchButtonOpacity, 65);
	control->Get("ButtonScale", &fButtonScale, 1.15);

	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();
}
Exemplo n.º 25
0
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);
}
Exemplo n.º 26
0
void SConfig::LoadCoreSettings(IniFile& ini)
{
	IniFile::Section* core = ini.GetOrCreateSection("Core");

	core->Get("HLE_BS2",      &m_LocalCoreStartupParameter.bHLE_BS2, false);
#ifdef _M_X86
	core->Get("CPUCore",      &m_LocalCoreStartupParameter.iCPUCore, SCoreStartupParameter::CORE_JIT64);
#elif _M_ARM_32
	core->Get("CPUCore",      &m_LocalCoreStartupParameter.iCPUCore, SCoreStartupParameter::CORE_JITARM);
#else
	core->Get("CPUCore",      &m_LocalCoreStartupParameter.iCPUCore, SCoreStartupParameter::CORE_INTERPRETER);
#endif
	core->Get("Fastmem",           &m_LocalCoreStartupParameter.bFastmem,      true);
	core->Get("DSPThread",         &m_LocalCoreStartupParameter.bDSPThread,    false);
	core->Get("DSPHLE",            &m_LocalCoreStartupParameter.bDSPHLE,       true);
	core->Get("CPUThread",         &m_LocalCoreStartupParameter.bCPUThread,    true);
	core->Get("SkipIdle",          &m_LocalCoreStartupParameter.bSkipIdle,     true);
	core->Get("DefaultISO",        &m_LocalCoreStartupParameter.m_strDefaultISO);
	core->Get("DVDRoot",           &m_LocalCoreStartupParameter.m_strDVDRoot);
	core->Get("Apploader",         &m_LocalCoreStartupParameter.m_strApploader);
	core->Get("EnableCheats",      &m_LocalCoreStartupParameter.bEnableCheats, false);
	core->Get("SelectedLanguage",  &m_LocalCoreStartupParameter.SelectedLanguage, 0);
	core->Get("DPL2Decoder",       &m_LocalCoreStartupParameter.bDPL2Decoder, false);
	core->Get("Latency",           &m_LocalCoreStartupParameter.iLatency, 2);
	core->Get("MemcardAPath",      &m_strMemoryCardA);
	core->Get("MemcardBPath",      &m_strMemoryCardB);
	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",     &m_LocalCoreStartupParameter.bJITILTimeProfiling, false);
	core->Get("OutputIR",          &m_LocalCoreStartupParameter.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("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",          &m_LocalCoreStartupParameter.bRunCompareServer, false);
	core->Get("RunCompareClient",          &m_LocalCoreStartupParameter.bRunCompareClient, false);
	core->Get("MMU",                       &m_LocalCoreStartupParameter.bMMU,              false);
	core->Get("BBDumpPort",                &m_LocalCoreStartupParameter.iBBDumpPort,       -1);
	core->Get("VBeam",                     &m_LocalCoreStartupParameter.bVBeamSpeedHack,   false);
	core->Get("SyncGPU",                   &m_LocalCoreStartupParameter.bSyncGPU,          false);
	core->Get("FastDiscSpeed",             &m_LocalCoreStartupParameter.bFastDiscSpeed,    false);
	core->Get("DCBZ",                      &m_LocalCoreStartupParameter.bDCBZOFF,          false);
	core->Get("FrameLimit",                &m_Framelimit,                                  1); // auto frame limit by default
	core->Get("FrameSkip",                 &m_FrameSkip,                                   0);
	core->Get("GFXBackend",                &m_LocalCoreStartupParameter.m_strVideoBackend, "");
	core->Get("GPUDeterminismMode",        &m_LocalCoreStartupParameter.m_strGPUDeterminismMode, "auto");
}
Exemplo n.º 27
0
void SConfig::LoadInputSettings(IniFile& ini)
{
	IniFile::Section* input = ini.GetOrCreateSection("Input");

	input->Get("BackgroundInput", &m_BackgroundInput, false);
}
Exemplo n.º 28
0
void SConfig::LoadFifoPlayerSettings(IniFile& ini)
{
	IniFile::Section* fifoplayer = ini.GetOrCreateSection("FifoPlayer");

	fifoplayer->Get("LoopReplay", &m_LocalCoreStartupParameter.bLoopFifoReplay, true);
}
Exemplo n.º 29
0
void CConfig::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("ConfirmOnQuit", &bConfirmOnQuit, false);
	general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true);
	general->Get("CurrentDirectory", &currentDirectory, "");
	general->Get("ShowDebuggerOnLoad", &bShowDebuggerOnLoad, false);

	IniFile::Section *cpu = iniFile.GetOrCreateSection("CPU");
	cpu->Get("Core", &iCpuCore, 0);
	cpu->Get("FastMemory", &bFastMemory, false);

	IniFile::Section *graphics = iniFile.GetOrCreateSection("Graphics");
	graphics->Get("ShowFPSCounter", &bShowFPSCounter, false);
	graphics->Get("DisplayFramebuffer", &bDisplayFramebuffer, false);
	graphics->Get("WindowZoom", &iWindowZoom, 1);
	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("DisableG3DLog", &bDisableG3DLog, false);
	graphics->Get("VertexCache", &bVertexCache, true);
	graphics->Get("FullScreen", &bFullScreen, false);	

	IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
	sound->Get("Enable", &bEnableSound, true);

	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	control->Get("ShowStick", &bShowAnalogStick, false);
	control->Get("ShowTouchControls", &bShowTouchControls,
#ifdef USING_GLES2
		true);
#else
		false);
#endif
	control->Get("LargeControls", &bLargeControls, false);
	control->Get("KeyMapping",iMappingMap);

	IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam");
	pspConfig->Get("Language", &ilanguage, PSP_SYSTEMPARAM_LANGUAGE_ENGLISH);
	pspConfig->Get("TimeFormat", &itimeformat, PSP_SYSTEMPARAM_TIME_FORMAT_24HR);
	pspConfig->Get("EncryptSave", &bEncryptSave, true);

	// Ephemeral settings
	bDrawWireframe = false;
}
Exemplo n.º 30
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.
	}

	for (size_t i = 0; i < ARRAY_SIZE(sections); ++i) {
		IniFile::Section *section = iniFile.GetOrCreateSection(sections[i].section);
		for (auto setting = sections[i].settings; setting->HasMore(); ++setting) {
			setting->Get(section);
		}
	}

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

	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.empty()) {
			recentIsos.push_back(fileName);
		}
	}

	auto pinnedPaths = iniFile.GetOrCreateSection("PinnedPaths")->ToMap();
	vPinnedPaths.clear();
	for (auto it = pinnedPaths.begin(), end = pinnedPaths.end(); it != end; ++it) {
		vPinnedPaths.push_back(it->second);
	}

	if (iAnisotropyLevel > 4) {
		iAnisotropyLevel = 4;
	}

	// Check for an old dpad setting
	IniFile::Section *control = iniFile.GetOrCreateSection("Control");
	float f;
	control->Get("DPadRadius", &f, 0.0f);
	if (f > 0.0f) {
		ResetControlLayout();
	}

	// MIGRATION: For users who had the old static touch layout, aren't I nice?
	// We can probably kill this in 0.9.8 or something.
	if (fDpadX > 1.0 || fDpadY > 1.0) { // Likely the rest are too!
		float screen_width = dp_xres;
		float screen_height = dp_yres;

		fActionButtonCenterX /= screen_width;
		fActionButtonCenterY /= screen_height;
		fDpadX /= screen_width;
		fDpadY /= screen_height;
		fStartKeyX /= screen_width;
		fStartKeyY /= screen_height;
		fSelectKeyX /= screen_width;
		fSelectKeyY /= screen_height;
		fUnthrottleKeyX /= screen_width;
		fUnthrottleKeyY /= screen_height;
		fLKeyX /= screen_width;
		fLKeyY /= screen_height;
		fRKeyX /= screen_width;
		fRKeyY /= screen_height;
		fAnalogStickX /= screen_width;
		fAnalogStickY /= screen_height;
	}
	
	if (dismissedVersion == upgradeVersion) {
		upgradeMessage = "";
	}

	// Check for new version on every 10 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 % 10 == 0 && bCheckForNewVersion) {
		std::shared_ptr<http::Download> dl = g_DownloadManager.StartDownloadWithCallback(
			"http://www.ppsspp.org/version.json", "", &DownloadCompletedCallback);
		dl->SetHidden(true);
	}

	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();
}