2009-09-12 02:58:22 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
2023-01-12 09:30:39 +00:00
|
|
|
* Copyright (C) 2002-2023 PCSX2 Dev Team
|
2009-11-12 12:51:00 +00:00
|
|
|
*
|
2009-09-12 02:58:22 +00:00
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "PrecompiledHeader.h"
|
2009-11-14 12:02:56 +00:00
|
|
|
|
2022-05-19 14:46:33 +00:00
|
|
|
#include "common/FileSystem.h"
|
|
|
|
#include "common/Path.h"
|
2021-09-22 07:38:30 +00:00
|
|
|
#include "common/SettingsInterface.h"
|
|
|
|
#include "common/SettingsWrapper.h"
|
|
|
|
#include "common/StringUtil.h"
|
2009-09-12 02:58:22 +00:00
|
|
|
#include "Config.h"
|
|
|
|
#include "GS.h"
|
2022-07-18 22:13:02 +00:00
|
|
|
#include "CDVD/CDVDcommon.h"
|
2021-09-17 08:42:39 +00:00
|
|
|
#include "MemoryCardFile.h"
|
2022-12-04 15:00:06 +00:00
|
|
|
#include "USB/USB.h"
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2023-05-13 10:22:46 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include "common/RedtapeWindows.h"
|
|
|
|
#include <KnownFolders.h>
|
|
|
|
#include <ShlObj.h>
|
|
|
|
#endif
|
|
|
|
|
2022-11-27 08:27:17 +00:00
|
|
|
const char* SettingInfo::StringDefaultValue() const
|
|
|
|
{
|
|
|
|
return default_value ? default_value : "";
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SettingInfo::BooleanDefaultValue() const
|
|
|
|
{
|
|
|
|
return default_value ? StringUtil::FromChars<bool>(default_value).value_or(false) : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 SettingInfo::IntegerDefaultValue() const
|
|
|
|
{
|
|
|
|
return default_value ? StringUtil::FromChars<s32>(default_value).value_or(0) : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 SettingInfo::IntegerMinValue() const
|
|
|
|
{
|
|
|
|
static constexpr s32 fallback_value = std::numeric_limits<s32>::min();
|
|
|
|
return min_value ? StringUtil::FromChars<s32>(min_value).value_or(fallback_value) : fallback_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 SettingInfo::IntegerMaxValue() const
|
|
|
|
{
|
|
|
|
static constexpr s32 fallback_value = std::numeric_limits<s32>::max();
|
|
|
|
return max_value ? StringUtil::FromChars<s32>(max_value).value_or(fallback_value) : fallback_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 SettingInfo::IntegerStepValue() const
|
|
|
|
{
|
|
|
|
static constexpr s32 fallback_value = 1;
|
|
|
|
return step_value ? StringUtil::FromChars<s32>(step_value).value_or(fallback_value) : fallback_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
float SettingInfo::FloatDefaultValue() const
|
|
|
|
{
|
|
|
|
return default_value ? StringUtil::FromChars<float>(default_value).value_or(0.0f) : 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
float SettingInfo::FloatMinValue() const
|
|
|
|
{
|
|
|
|
static constexpr float fallback_value = std::numeric_limits<float>::min();
|
|
|
|
return min_value ? StringUtil::FromChars<float>(min_value).value_or(fallback_value) : fallback_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
float SettingInfo::FloatMaxValue() const
|
|
|
|
{
|
|
|
|
static constexpr float fallback_value = std::numeric_limits<float>::max();
|
|
|
|
return max_value ? StringUtil::FromChars<float>(max_value).value_or(fallback_value) : fallback_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
float SettingInfo::FloatStepValue() const
|
|
|
|
{
|
|
|
|
static constexpr float fallback_value = 0.1f;
|
|
|
|
return step_value ? StringUtil::FromChars<float>(step_value).value_or(fallback_value) : fallback_value;
|
|
|
|
}
|
|
|
|
|
2023-06-19 07:51:14 +00:00
|
|
|
void SettingInfo::SetDefaultValue(SettingsInterface* si, const char* section, const char* key) const
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case SettingInfo::Type::Boolean:
|
|
|
|
si->SetBoolValue(section, key, BooleanDefaultValue());
|
|
|
|
break;
|
|
|
|
case SettingInfo::Type::Integer:
|
|
|
|
case SettingInfo::Type::IntegerList:
|
|
|
|
si->SetIntValue(section, key, IntegerDefaultValue());
|
|
|
|
break;
|
|
|
|
case SettingInfo::Type::Float:
|
|
|
|
si->SetFloatValue(section, key, FloatDefaultValue());
|
|
|
|
break;
|
|
|
|
case SettingInfo::Type::String:
|
|
|
|
case SettingInfo::Type::StringList:
|
|
|
|
case SettingInfo::Type::Path:
|
|
|
|
si->SetStringValue(section, key, StringDefaultValue());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SettingInfo::CopyValue(SettingsInterface* dest_si, const SettingsInterface& src_si,
|
|
|
|
const char* section, const char* key) const
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case SettingInfo::Type::Boolean:
|
|
|
|
dest_si->CopyBoolValue(src_si, section, key);
|
|
|
|
break;
|
|
|
|
case SettingInfo::Type::Integer:
|
|
|
|
case SettingInfo::Type::IntegerList:
|
|
|
|
dest_si->CopyIntValue(src_si, section, key);
|
|
|
|
break;
|
|
|
|
case SettingInfo::Type::Float:
|
|
|
|
dest_si->CopyFloatValue(src_si, section, key);
|
|
|
|
break;
|
|
|
|
case SettingInfo::Type::String:
|
|
|
|
case SettingInfo::Type::StringList:
|
|
|
|
case SettingInfo::Type::Path:
|
|
|
|
dest_si->CopyStringValue(src_si, section, key);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-25 00:49:48 +00:00
|
|
|
namespace EmuFolders
|
|
|
|
{
|
2022-05-19 14:46:33 +00:00
|
|
|
std::string AppRoot;
|
|
|
|
std::string DataRoot;
|
|
|
|
std::string Settings;
|
|
|
|
std::string Bios;
|
|
|
|
std::string Snapshots;
|
|
|
|
std::string Savestates;
|
|
|
|
std::string MemoryCards;
|
|
|
|
std::string Langs;
|
|
|
|
std::string Logs;
|
|
|
|
std::string Cheats;
|
2023-05-25 16:24:01 +00:00
|
|
|
std::string Patches;
|
2022-05-19 14:46:33 +00:00
|
|
|
std::string Resources;
|
|
|
|
std::string Cache;
|
|
|
|
std::string Covers;
|
|
|
|
std::string GameSettings;
|
|
|
|
std::string Textures;
|
2022-04-02 12:17:26 +00:00
|
|
|
std::string InputProfiles;
|
2023-01-12 09:30:39 +00:00
|
|
|
std::string Videos;
|
2023-05-13 10:22:46 +00:00
|
|
|
|
|
|
|
static void SetAppRoot();
|
|
|
|
static void SetResourcesDirectory();
|
|
|
|
static bool ShouldUsePortableMode();
|
|
|
|
static void SetDataDirectory();
|
2021-09-25 00:49:48 +00:00
|
|
|
} // namespace EmuFolders
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void TraceLogFilters::LoadSave(SettingsWrapper& wrap)
|
2009-11-11 11:36:13 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/TraceLog");
|
|
|
|
|
|
|
|
SettingsWrapEntry(Enabled);
|
2009-11-11 11:36:13 +00:00
|
|
|
|
|
|
|
// Retaining backwards compat of the trace log enablers isn't really important, and
|
|
|
|
// doing each one by hand would be murder. So let's cheat and just save it as an int:
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(EE.bitset);
|
|
|
|
SettingsWrapEntry(IOP.bitset);
|
2009-11-11 11:36:13 +00:00
|
|
|
}
|
|
|
|
|
2021-12-10 11:12:15 +00:00
|
|
|
const char* const tbl_SpeedhackNames[] =
|
2021-10-23 19:36:02 +00:00
|
|
|
{
|
|
|
|
"mvuFlag",
|
|
|
|
"InstantVU1",
|
|
|
|
"MTVU"
|
|
|
|
};
|
2020-12-14 02:23:28 +00:00
|
|
|
|
2021-12-10 11:12:15 +00:00
|
|
|
const char* EnumToString(SpeedhackId id)
|
2020-12-14 02:23:28 +00:00
|
|
|
{
|
|
|
|
return tbl_SpeedhackNames[id];
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::SpeedhackOptions::Set(SpeedhackId id, bool enabled)
|
|
|
|
{
|
2022-05-18 13:27:23 +00:00
|
|
|
pxAssert(EnumIsValid(id));
|
2020-12-14 02:23:28 +00:00
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case Speedhack_mvuFlag:
|
|
|
|
vuFlagHack = enabled;
|
|
|
|
break;
|
|
|
|
case Speedhack_InstantVU1:
|
|
|
|
vu1Instant = enabled;
|
|
|
|
break;
|
2021-10-23 19:36:02 +00:00
|
|
|
case Speedhack_MTVU:
|
|
|
|
vuThread = enabled;
|
|
|
|
break;
|
2022-03-01 00:54:18 +00:00
|
|
|
jNO_DEFAULT;
|
2020-12-14 02:23:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-11-23 06:54:24 +00:00
|
|
|
Pcsx2Config::SpeedhackOptions::SpeedhackOptions()
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2010-09-29 13:48:36 +00:00
|
|
|
DisableAll();
|
2020-12-14 02:23:28 +00:00
|
|
|
|
2010-09-26 17:31:23 +00:00
|
|
|
// Set recommended speedhacks to enabled by default. They'll still be off globally on resets.
|
|
|
|
WaitLoop = true;
|
|
|
|
IntcStat = true;
|
|
|
|
vuFlagHack = true;
|
2020-12-12 03:33:24 +00:00
|
|
|
vu1Instant = true;
|
2009-11-23 06:54:24 +00:00
|
|
|
}
|
|
|
|
|
2010-09-29 13:48:36 +00:00
|
|
|
Pcsx2Config::SpeedhackOptions& Pcsx2Config::SpeedhackOptions::DisableAll()
|
|
|
|
{
|
2020-12-14 02:23:28 +00:00
|
|
|
bitset = 0;
|
|
|
|
EECycleRate = 0;
|
|
|
|
EECycleSkip = 0;
|
|
|
|
|
2010-09-29 13:48:36 +00:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::SpeedhackOptions::LoadSave(SettingsWrapper& wrap)
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/Speedhacks");
|
2020-12-14 02:23:28 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitfield(EECycleRate);
|
|
|
|
SettingsWrapBitfield(EECycleSkip);
|
|
|
|
SettingsWrapBitBool(fastCDVD);
|
|
|
|
SettingsWrapBitBool(IntcStat);
|
|
|
|
SettingsWrapBitBool(WaitLoop);
|
|
|
|
SettingsWrapBitBool(vuFlagHack);
|
|
|
|
SettingsWrapBitBool(vuThread);
|
|
|
|
SettingsWrapBitBool(vu1Instant);
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::ProfilerOptions::LoadSave(SettingsWrapper& wrap)
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/Profiler");
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(Enabled);
|
|
|
|
SettingsWrapBitBool(RecBlocks_EE);
|
|
|
|
SettingsWrapBitBool(RecBlocks_IOP);
|
|
|
|
SettingsWrapBitBool(RecBlocks_VU0);
|
|
|
|
SettingsWrapBitBool(RecBlocks_VU1);
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2009-11-21 07:44:11 +00:00
|
|
|
Pcsx2Config::RecompilerOptions::RecompilerOptions()
|
2009-11-01 11:27:50 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
bitset = 0;
|
2009-11-21 07:44:11 +00:00
|
|
|
|
2010-07-04 11:14:06 +00:00
|
|
|
//StackFrameChecks = false;
|
2010-09-29 13:48:36 +00:00
|
|
|
//PreBlockCheckEE = false;
|
2009-11-21 07:44:11 +00:00
|
|
|
|
2009-11-01 11:27:50 +00:00
|
|
|
// All recs are enabled by default.
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
EnableEE = true;
|
2011-02-17 21:27:24 +00:00
|
|
|
EnableEECache = false;
|
2021-09-22 07:38:30 +00:00
|
|
|
EnableIOP = true;
|
|
|
|
EnableVU0 = true;
|
|
|
|
EnableVU1 = true;
|
2022-10-29 03:39:19 +00:00
|
|
|
EnableFastmem = true;
|
2023-01-25 15:13:55 +00:00
|
|
|
PauseOnTLBMiss = false;
|
2009-11-01 11:27:50 +00:00
|
|
|
|
|
|
|
// vu and fpu clamping default to standard overflow.
|
2022-12-28 04:44:34 +00:00
|
|
|
vu0Overflow = true;
|
|
|
|
//vu0ExtraOverflow = false;
|
|
|
|
//vu0SignOverflow = false;
|
|
|
|
//vu0Underflow = false;
|
|
|
|
vu1Overflow = true;
|
|
|
|
//vu1ExtraOverflow = false;
|
|
|
|
//vu1SignOverflow = false;
|
|
|
|
//vu1Underflow = false;
|
2009-11-01 11:27:50 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
fpuOverflow = true;
|
2009-11-01 11:27:50 +00:00
|
|
|
//fpuExtraOverflow = false;
|
|
|
|
//fpuFullMode = false;
|
|
|
|
}
|
|
|
|
|
2009-11-01 16:49:20 +00:00
|
|
|
void Pcsx2Config::RecompilerOptions::ApplySanityCheck()
|
|
|
|
{
|
2009-11-02 07:00:59 +00:00
|
|
|
bool fpuIsRight = true;
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
if (fpuExtraOverflow)
|
2009-11-02 07:00:59 +00:00
|
|
|
fpuIsRight = fpuOverflow;
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
if (fpuFullMode)
|
2009-11-26 13:09:23 +00:00
|
|
|
fpuIsRight = fpuOverflow && fpuExtraOverflow;
|
2009-11-02 07:00:59 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
if (!fpuIsRight)
|
2009-11-01 16:49:20 +00:00
|
|
|
{
|
|
|
|
// Values are wonky; assume the defaults.
|
2021-09-22 07:38:30 +00:00
|
|
|
fpuOverflow = RecompilerOptions().fpuOverflow;
|
|
|
|
fpuExtraOverflow = RecompilerOptions().fpuExtraOverflow;
|
|
|
|
fpuFullMode = RecompilerOptions().fpuFullMode;
|
2009-11-01 16:49:20 +00:00
|
|
|
}
|
|
|
|
|
2009-11-02 07:00:59 +00:00
|
|
|
bool vuIsOk = true;
|
2009-11-01 16:49:20 +00:00
|
|
|
|
2022-12-28 04:44:34 +00:00
|
|
|
if (vu0ExtraOverflow)
|
|
|
|
vuIsOk = vuIsOk && vu0Overflow;
|
|
|
|
if (vu0SignOverflow)
|
|
|
|
vuIsOk = vuIsOk && vu0ExtraOverflow;
|
2009-11-02 07:00:59 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
if (!vuIsOk)
|
2009-11-01 16:49:20 +00:00
|
|
|
{
|
|
|
|
// Values are wonky; assume the defaults.
|
2022-12-28 04:44:34 +00:00
|
|
|
vu0Overflow = RecompilerOptions().vu0Overflow;
|
|
|
|
vu0ExtraOverflow = RecompilerOptions().vu0ExtraOverflow;
|
|
|
|
vu0SignOverflow = RecompilerOptions().vu0SignOverflow;
|
|
|
|
vu0Underflow = RecompilerOptions().vu0Underflow;
|
|
|
|
}
|
|
|
|
|
|
|
|
vuIsOk = true;
|
|
|
|
|
|
|
|
if (vu1ExtraOverflow)
|
|
|
|
vuIsOk = vuIsOk && vu1Overflow;
|
|
|
|
if (vu1SignOverflow)
|
|
|
|
vuIsOk = vuIsOk && vu1ExtraOverflow;
|
|
|
|
|
|
|
|
if (!vuIsOk)
|
|
|
|
{
|
|
|
|
// Values are wonky; assume the defaults.
|
|
|
|
vu1Overflow = RecompilerOptions().vu1Overflow;
|
|
|
|
vu1ExtraOverflow = RecompilerOptions().vu1ExtraOverflow;
|
|
|
|
vu1SignOverflow = RecompilerOptions().vu1SignOverflow;
|
|
|
|
vu1Underflow = RecompilerOptions().vu1Underflow;
|
2009-11-01 16:49:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::RecompilerOptions::LoadSave(SettingsWrapper& wrap)
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/CPU/Recompiler");
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(EnableEE);
|
|
|
|
SettingsWrapBitBool(EnableIOP);
|
|
|
|
SettingsWrapBitBool(EnableEECache);
|
|
|
|
SettingsWrapBitBool(EnableVU0);
|
|
|
|
SettingsWrapBitBool(EnableVU1);
|
2022-10-29 03:39:19 +00:00
|
|
|
SettingsWrapBitBool(EnableFastmem);
|
2023-01-25 15:13:55 +00:00
|
|
|
SettingsWrapBitBool(PauseOnTLBMiss);
|
2009-09-18 14:40:24 +00:00
|
|
|
|
2022-12-28 04:44:34 +00:00
|
|
|
SettingsWrapBitBool(vu0Overflow);
|
|
|
|
SettingsWrapBitBool(vu0ExtraOverflow);
|
|
|
|
SettingsWrapBitBool(vu0SignOverflow);
|
|
|
|
SettingsWrapBitBool(vu0Underflow);
|
|
|
|
SettingsWrapBitBool(vu1Overflow);
|
|
|
|
SettingsWrapBitBool(vu1ExtraOverflow);
|
|
|
|
SettingsWrapBitBool(vu1SignOverflow);
|
|
|
|
SettingsWrapBitBool(vu1Underflow);
|
2009-11-01 11:27:50 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(fpuOverflow);
|
|
|
|
SettingsWrapBitBool(fpuExtraOverflow);
|
|
|
|
SettingsWrapBitBool(fpuFullMode);
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2022-04-03 04:02:06 +00:00
|
|
|
bool Pcsx2Config::CpuOptions::CpusChanged(const CpuOptions& right) const
|
|
|
|
{
|
|
|
|
return (Recompiler.EnableEE != right.Recompiler.EnableEE ||
|
|
|
|
Recompiler.EnableIOP != right.Recompiler.EnableIOP ||
|
|
|
|
Recompiler.EnableVU0 != right.Recompiler.EnableVU0 ||
|
|
|
|
Recompiler.EnableVU1 != right.Recompiler.EnableVU1);
|
|
|
|
}
|
|
|
|
|
2009-11-02 07:00:59 +00:00
|
|
|
Pcsx2Config::CpuOptions::CpuOptions()
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
sseMXCSR.bitmask = DEFAULT_sseMXCSR;
|
2022-12-28 04:44:34 +00:00
|
|
|
sseVU0MXCSR.bitmask = DEFAULT_sseVUMXCSR;
|
|
|
|
sseVU1MXCSR.bitmask = DEFAULT_sseVUMXCSR;
|
2021-10-31 09:59:31 +00:00
|
|
|
AffinityControlMode = 0;
|
2009-11-02 07:00:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::CpuOptions::ApplySanityCheck()
|
|
|
|
{
|
|
|
|
sseMXCSR.ClearExceptionFlags().DisableExceptions();
|
2022-12-28 04:44:34 +00:00
|
|
|
sseVU0MXCSR.ClearExceptionFlags().DisableExceptions();
|
|
|
|
sseVU1MXCSR.ClearExceptionFlags().DisableExceptions();
|
2021-10-31 09:59:31 +00:00
|
|
|
AffinityControlMode = std::min<u32>(AffinityControlMode, 6);
|
2009-11-02 07:00:59 +00:00
|
|
|
|
|
|
|
Recompiler.ApplySanityCheck();
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::CpuOptions::LoadSave(SettingsWrapper& wrap)
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/CPU");
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBoolEx(sseMXCSR.DenormalsAreZero, "FPU.DenormalsAreZero");
|
|
|
|
SettingsWrapBitBoolEx(sseMXCSR.FlushToZero, "FPU.FlushToZero");
|
|
|
|
SettingsWrapBitfieldEx(sseMXCSR.RoundingControl, "FPU.Roundmode");
|
2021-10-31 09:59:31 +00:00
|
|
|
SettingsWrapEntry(AffinityControlMode);
|
2009-11-02 07:00:59 +00:00
|
|
|
|
2022-12-28 04:44:34 +00:00
|
|
|
SettingsWrapBitBoolEx(sseVU0MXCSR.DenormalsAreZero, "VU0.DenormalsAreZero");
|
|
|
|
SettingsWrapBitBoolEx(sseVU0MXCSR.FlushToZero, "VU0.FlushToZero");
|
|
|
|
SettingsWrapBitfieldEx(sseVU0MXCSR.RoundingControl, "VU0.Roundmode");
|
|
|
|
SettingsWrapBitBoolEx(sseVU1MXCSR.DenormalsAreZero, "VU1.DenormalsAreZero");
|
|
|
|
SettingsWrapBitBoolEx(sseVU1MXCSR.FlushToZero, "VU1.FlushToZero");
|
|
|
|
SettingsWrapBitfieldEx(sseVU1MXCSR.RoundingControl, "VU1.Roundmode");
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
Recompiler.LoadSave(wrap);
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
const char* Pcsx2Config::GSOptions::AspectRatioNames[] = {
|
|
|
|
"Stretch",
|
2022-04-11 13:00:18 +00:00
|
|
|
"Auto 4:3/3:2",
|
|
|
|
"4:3",
|
2021-12-18 14:43:50 +00:00
|
|
|
"16:9",
|
|
|
|
nullptr};
|
|
|
|
|
|
|
|
const char* Pcsx2Config::GSOptions::FMVAspectRatioSwitchNames[] = {
|
|
|
|
"Off",
|
2022-04-11 13:00:18 +00:00
|
|
|
"Auto 4:3/3:2",
|
|
|
|
"4:3",
|
2021-12-18 14:43:50 +00:00
|
|
|
"16:9",
|
|
|
|
nullptr};
|
|
|
|
|
2023-03-03 13:04:50 +00:00
|
|
|
const char* Pcsx2Config::GSOptions::BlendingLevelNames[] = {
|
|
|
|
"Minimum",
|
|
|
|
"Basic",
|
|
|
|
"Medium",
|
|
|
|
"High",
|
|
|
|
"Full",
|
|
|
|
"Maximum",
|
|
|
|
nullptr};
|
|
|
|
|
2023-01-19 14:01:54 +00:00
|
|
|
const char* Pcsx2Config::GSOptions::CaptureContainers[] = {
|
2022-12-18 13:05:00 +00:00
|
|
|
"mp4",
|
|
|
|
"mkv",
|
|
|
|
"avi",
|
2023-01-19 14:01:54 +00:00
|
|
|
"wav",
|
|
|
|
"mp3",
|
2022-12-18 13:05:00 +00:00
|
|
|
nullptr};
|
2023-01-19 14:01:54 +00:00
|
|
|
const char* Pcsx2Config::GSOptions::DEFAULT_CAPTURE_CONTAINER = "mp4";
|
2022-12-18 13:05:00 +00:00
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
const char* Pcsx2Config::GSOptions::GetRendererName(GSRendererType type)
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
2022-03-01 00:54:18 +00:00
|
|
|
case GSRendererType::Auto: return "Auto";
|
|
|
|
case GSRendererType::DX11: return "Direct3D 11";
|
2022-03-19 12:19:16 +00:00
|
|
|
case GSRendererType::DX12: return "Direct3D 12";
|
2021-11-19 06:25:51 +00:00
|
|
|
case GSRendererType::Metal: return "Metal";
|
2022-03-01 00:54:18 +00:00
|
|
|
case GSRendererType::OGL: return "OpenGL";
|
|
|
|
case GSRendererType::VK: return "Vulkan";
|
|
|
|
case GSRendererType::SW: return "Software";
|
|
|
|
case GSRendererType::Null: return "Null";
|
|
|
|
default: return "";
|
2021-12-18 14:43:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-29 15:35:04 +00:00
|
|
|
std::optional<bool> Pcsx2Config::GSOptions::TriStateToOptionalBoolean(int value)
|
|
|
|
{
|
|
|
|
return (value < 0) ? std::optional<bool>(std::nullopt) : std::optional<bool>((value != 0));
|
|
|
|
}
|
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
Pcsx2Config::GSOptions::GSOptions()
|
|
|
|
{
|
|
|
|
bitset = 0;
|
|
|
|
|
2022-06-14 22:54:08 +00:00
|
|
|
PCRTCAntiBlur = true;
|
2022-05-20 17:17:35 +00:00
|
|
|
DisableInterlaceOffset = false;
|
2022-04-10 14:30:55 +00:00
|
|
|
PCRTCOffsets = false;
|
2022-06-05 17:03:13 +00:00
|
|
|
PCRTCOverscan = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
IntegerScaling = false;
|
2022-11-22 14:12:06 +00:00
|
|
|
LinearPresent = GSPostBilinearMode::BilinearSmooth;
|
2022-02-06 12:17:48 +00:00
|
|
|
SyncToHostRefreshRate = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
UseDebugDevice = false;
|
|
|
|
UseBlitSwapChain = false;
|
|
|
|
DisableShaderCache = false;
|
2022-03-07 14:36:05 +00:00
|
|
|
DisableFramebufferFetch = false;
|
2023-05-11 09:45:57 +00:00
|
|
|
DisableVertexShaderExpand = false;
|
2023-01-06 15:10:58 +00:00
|
|
|
DisableThreadedPresentation = false;
|
2022-01-09 09:27:19 +00:00
|
|
|
SkipDuplicateFrames = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
OsdShowMessages = true;
|
|
|
|
OsdShowSpeed = false;
|
|
|
|
OsdShowFPS = false;
|
|
|
|
OsdShowCPU = false;
|
2022-03-11 12:05:38 +00:00
|
|
|
OsdShowGPU = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
OsdShowResolution = false;
|
|
|
|
OsdShowGSStats = false;
|
2022-02-23 11:52:18 +00:00
|
|
|
OsdShowIndicators = true;
|
2022-09-17 12:45:03 +00:00
|
|
|
OsdShowSettings = false;
|
|
|
|
OsdShowInputs = false;
|
2022-11-30 14:25:16 +00:00
|
|
|
OsdShowFrameTimes = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
|
2022-06-06 11:01:31 +00:00
|
|
|
HWDownloadMode = GSHardwareDownloadMode::Enabled;
|
2022-09-18 01:46:27 +00:00
|
|
|
HWSpinGPUForReadbacks = false;
|
2022-09-28 06:54:33 +00:00
|
|
|
HWSpinCPUForReadbacks = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
GPUPaletteConversion = false;
|
|
|
|
AutoFlushSW = true;
|
|
|
|
PreloadFrameWithGSData = false;
|
2022-02-05 13:33:03 +00:00
|
|
|
Mipmap = true;
|
|
|
|
|
2022-03-03 12:36:05 +00:00
|
|
|
ManualUserHacks = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
UserHacks_AlignSpriteX = false;
|
2023-04-23 06:50:17 +00:00
|
|
|
UserHacks_AutoFlush = GSHWAutoFlushLevel::Disabled;
|
2021-12-18 14:43:50 +00:00
|
|
|
UserHacks_CPUFBConversion = false;
|
2023-02-23 11:00:48 +00:00
|
|
|
UserHacks_ReadTCOnClose = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
UserHacks_DisableDepthSupport = false;
|
|
|
|
UserHacks_DisablePartialInvalidation = false;
|
|
|
|
UserHacks_DisableSafeFeatures = false;
|
2023-05-11 10:41:26 +00:00
|
|
|
UserHacks_DisableRenderFixes = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
UserHacks_MergePPSprite = false;
|
|
|
|
UserHacks_WildHack = false;
|
2023-03-16 02:50:59 +00:00
|
|
|
UserHacks_BilinearHack = false;
|
2023-03-31 13:19:07 +00:00
|
|
|
UserHacks_NativePaletteDraw = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
|
2022-02-19 14:20:18 +00:00
|
|
|
DumpReplaceableTextures = false;
|
|
|
|
DumpReplaceableMipmaps = false;
|
|
|
|
DumpTexturesWithFMVActive = false;
|
2022-05-11 10:36:04 +00:00
|
|
|
DumpDirectTextures = true;
|
|
|
|
DumpPaletteTextures = true;
|
2022-02-19 14:20:18 +00:00
|
|
|
LoadTextureReplacements = false;
|
|
|
|
LoadTextureReplacementsAsync = true;
|
|
|
|
PrecacheTextureReplacements = false;
|
2023-01-12 09:30:39 +00:00
|
|
|
|
2023-01-19 14:01:54 +00:00
|
|
|
EnableVideoCapture = true;
|
2023-01-12 09:30:39 +00:00
|
|
|
EnableVideoCaptureParameters = false;
|
2023-01-19 14:01:54 +00:00
|
|
|
EnableAudioCapture = true;
|
|
|
|
EnableAudioCaptureParameters = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::GSOptions::operator==(const GSOptions& right) const
|
|
|
|
{
|
|
|
|
return (
|
|
|
|
OpEqu(SynchronousMTGS) &&
|
|
|
|
OpEqu(VsyncQueueSize) &&
|
|
|
|
|
|
|
|
OpEqu(FrameLimitEnable) &&
|
|
|
|
|
|
|
|
OpEqu(LimitScalar) &&
|
|
|
|
OpEqu(FramerateNTSC) &&
|
|
|
|
OpEqu(FrameratePAL) &&
|
|
|
|
|
|
|
|
OpEqu(AspectRatio) &&
|
|
|
|
OpEqu(FMVAspectRatioSwitch) &&
|
|
|
|
|
2022-02-24 19:45:27 +00:00
|
|
|
OptionsAreEqual(right));
|
2021-12-18 14:43:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::GSOptions::OptionsAreEqual(const GSOptions& right) const
|
|
|
|
{
|
|
|
|
return (
|
2022-02-24 19:45:27 +00:00
|
|
|
OpEqu(bitset) &&
|
|
|
|
|
|
|
|
OpEqu(VsyncEnable) &&
|
|
|
|
|
|
|
|
OpEqu(InterlaceMode) &&
|
2022-11-22 14:12:06 +00:00
|
|
|
OpEqu(LinearPresent) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
|
|
|
|
OpEqu(StretchY) &&
|
2022-06-29 12:45:01 +00:00
|
|
|
OpEqu(Crop[0]) &&
|
|
|
|
OpEqu(Crop[1]) &&
|
|
|
|
OpEqu(Crop[2]) &&
|
|
|
|
OpEqu(Crop[3]) &&
|
|
|
|
|
2022-02-24 19:45:27 +00:00
|
|
|
OpEqu(OsdScale) &&
|
|
|
|
|
|
|
|
OpEqu(Renderer) &&
|
|
|
|
OpEqu(UpscaleMultiplier) &&
|
|
|
|
|
|
|
|
OpEqu(HWMipmap) &&
|
|
|
|
OpEqu(AccurateBlendingUnit) &&
|
|
|
|
OpEqu(TextureFiltering) &&
|
|
|
|
OpEqu(TexturePreloading) &&
|
2022-05-16 11:10:34 +00:00
|
|
|
OpEqu(GSDumpCompression) &&
|
2022-06-06 11:01:31 +00:00
|
|
|
OpEqu(HWDownloadMode) &&
|
2022-11-20 14:20:40 +00:00
|
|
|
OpEqu(CASMode) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
OpEqu(Dithering) &&
|
|
|
|
OpEqu(MaxAnisotropy) &&
|
|
|
|
OpEqu(SWExtraThreads) &&
|
|
|
|
OpEqu(SWExtraThreadsHeight) &&
|
2022-10-01 03:32:31 +00:00
|
|
|
OpEqu(TriFilter) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
OpEqu(TVShader) &&
|
2023-01-05 12:08:33 +00:00
|
|
|
OpEqu(GetSkipCountFunctionId) &&
|
|
|
|
OpEqu(BeforeDrawFunctionId) &&
|
2022-03-03 12:36:05 +00:00
|
|
|
OpEqu(SkipDrawEnd) &&
|
|
|
|
OpEqu(SkipDrawStart) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
|
2023-04-23 06:50:17 +00:00
|
|
|
OpEqu(UserHacks_AutoFlush) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
OpEqu(UserHacks_HalfBottomOverride) &&
|
|
|
|
OpEqu(UserHacks_HalfPixelOffset) &&
|
|
|
|
OpEqu(UserHacks_RoundSprite) &&
|
|
|
|
OpEqu(UserHacks_TCOffsetX) &&
|
|
|
|
OpEqu(UserHacks_TCOffsetY) &&
|
2022-06-02 15:00:39 +00:00
|
|
|
OpEqu(UserHacks_CPUSpriteRenderBW) &&
|
2023-03-19 12:24:29 +00:00
|
|
|
OpEqu(UserHacks_CPUSpriteRenderLevel) &&
|
2022-10-22 10:43:29 +00:00
|
|
|
OpEqu(UserHacks_CPUCLUTRender) &&
|
2023-01-02 13:14:10 +00:00
|
|
|
OpEqu(UserHacks_GPUTargetCLUTMode) &&
|
2023-02-26 12:15:48 +00:00
|
|
|
OpEqu(UserHacks_TextureInsideRt) &&
|
2022-01-05 11:13:27 +00:00
|
|
|
OpEqu(OverrideTextureBarriers) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
|
2022-11-20 14:20:40 +00:00
|
|
|
OpEqu(CAS_Sharpness) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
OpEqu(ShadeBoost_Brightness) &&
|
|
|
|
OpEqu(ShadeBoost_Contrast) &&
|
|
|
|
OpEqu(ShadeBoost_Saturation) &&
|
2022-12-24 03:46:11 +00:00
|
|
|
OpEqu(PNGCompressionLevel) &&
|
2022-02-24 19:45:27 +00:00
|
|
|
OpEqu(SaveN) &&
|
|
|
|
OpEqu(SaveL) &&
|
2022-12-10 09:11:08 +00:00
|
|
|
|
2023-04-29 15:35:04 +00:00
|
|
|
OpEqu(ExclusiveFullscreenControl) &&
|
2022-12-10 09:11:08 +00:00
|
|
|
OpEqu(ScreenshotSize) &&
|
|
|
|
OpEqu(ScreenshotFormat) &&
|
|
|
|
OpEqu(ScreenshotQuality) &&
|
|
|
|
|
2023-01-19 14:01:54 +00:00
|
|
|
OpEqu(CaptureContainer) &&
|
2022-12-18 13:05:00 +00:00
|
|
|
OpEqu(VideoCaptureCodec) &&
|
2023-01-12 09:30:39 +00:00
|
|
|
OpEqu(VideoCaptureParameters) &&
|
2023-01-19 14:01:54 +00:00
|
|
|
OpEqu(AudioCaptureCodec) &&
|
|
|
|
OpEqu(AudioCaptureParameters) &&
|
|
|
|
OpEqu(VideoCaptureBitrate) &&
|
|
|
|
OpEqu(VideoCaptureWidth) &&
|
|
|
|
OpEqu(VideoCaptureHeight) &&
|
|
|
|
OpEqu(AudioCaptureBitrate) &&
|
2022-12-18 13:05:00 +00:00
|
|
|
|
2022-12-24 03:47:10 +00:00
|
|
|
OpEqu(Adapter) &&
|
|
|
|
|
|
|
|
OpEqu(HWDumpDirectory) &&
|
|
|
|
OpEqu(SWDumpDirectory));
|
2021-12-18 14:43:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::GSOptions::operator!=(const GSOptions& right) const
|
|
|
|
{
|
|
|
|
return !operator==(right);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::GSOptions::RestartOptionsAreEqual(const GSOptions& right) const
|
|
|
|
{
|
2022-02-24 19:45:27 +00:00
|
|
|
return OpEqu(Renderer) &&
|
|
|
|
OpEqu(Adapter) &&
|
|
|
|
OpEqu(UseDebugDevice) &&
|
|
|
|
OpEqu(UseBlitSwapChain) &&
|
|
|
|
OpEqu(DisableShaderCache) &&
|
2021-12-31 07:29:26 +00:00
|
|
|
OpEqu(DisableDualSourceBlend) &&
|
2022-03-07 14:36:05 +00:00
|
|
|
OpEqu(DisableFramebufferFetch) &&
|
2023-05-11 09:45:57 +00:00
|
|
|
OpEqu(DisableVertexShaderExpand) &&
|
2023-01-06 15:10:58 +00:00
|
|
|
OpEqu(DisableThreadedPresentation) &&
|
2023-04-29 15:35:04 +00:00
|
|
|
OpEqu(OverrideTextureBarriers) &&
|
|
|
|
OpEqu(ExclusiveFullscreenControl);
|
2021-12-18 14:43:50 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::GSOptions::LoadSave(SettingsWrapper& wrap)
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/GS");
|
2009-12-03 15:51:39 +00:00
|
|
|
|
2021-10-05 01:59:03 +00:00
|
|
|
#ifdef PCSX2_DEVBUILD
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(SynchronousMTGS);
|
2021-09-28 11:11:12 +00:00
|
|
|
#endif
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(VsyncQueueSize);
|
2010-01-04 11:51:09 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(FrameLimitEnable);
|
|
|
|
wrap.EnumEntry(CURRENT_SETTINGS_SECTION, "VsyncEnable", VsyncEnable, NULL, VsyncEnable);
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
// LimitScalar is set at runtime.
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(FramerateNTSC);
|
|
|
|
SettingsWrapEntry(FrameratePAL);
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2022-02-06 12:17:48 +00:00
|
|
|
SettingsWrapBitBool(SyncToHostRefreshRate);
|
2021-12-18 14:43:50 +00:00
|
|
|
SettingsWrapEnumEx(AspectRatio, "AspectRatio", AspectRatioNames);
|
|
|
|
SettingsWrapEnumEx(FMVAspectRatioSwitch, "FMVAspectRatioSwitch", FMVAspectRatioSwitchNames);
|
2022-12-10 09:11:08 +00:00
|
|
|
SettingsWrapIntEnumEx(ScreenshotSize, "ScreenshotSize");
|
|
|
|
SettingsWrapIntEnumEx(ScreenshotFormat, "ScreenshotFormat");
|
|
|
|
SettingsWrapEntry(ScreenshotQuality);
|
2021-12-18 14:43:50 +00:00
|
|
|
SettingsWrapEntry(StretchY);
|
2022-06-29 12:45:01 +00:00
|
|
|
SettingsWrapEntryEx(Crop[0], "CropLeft");
|
|
|
|
SettingsWrapEntryEx(Crop[1], "CropTop");
|
|
|
|
SettingsWrapEntryEx(Crop[2], "CropRight");
|
|
|
|
SettingsWrapEntryEx(Crop[3], "CropBottom");
|
2021-09-16 10:54:06 +00:00
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
#define GSSettingInt(var) SettingsWrapBitfield(var)
|
|
|
|
#define GSSettingIntEx(var, name) SettingsWrapBitfieldEx(var, name)
|
|
|
|
#define GSSettingBool(var) SettingsWrapBitBool(var)
|
|
|
|
#define GSSettingBoolEx(var, name) SettingsWrapBitBoolEx(var, name)
|
2022-07-19 10:46:59 +00:00
|
|
|
#define GSSettingFloat(var) SettingsWrapEntry(var)
|
|
|
|
#define GSSettingFloatEx(var, name) SettingsWrapEntryEx(var, name)
|
2021-12-18 14:43:50 +00:00
|
|
|
#define GSSettingIntEnumEx(var, name) SettingsWrapIntEnumEx(var, name)
|
|
|
|
#define GSSettingString(var) SettingsWrapEntry(var)
|
|
|
|
#define GSSettingStringEx(var, name) SettingsWrapEntryEx(var, name)
|
|
|
|
|
|
|
|
// Unfortunately, because code in the GS still reads the setting by key instead of
|
|
|
|
// using these variables, we need to use the old names. Maybe post 2.0 we can change this.
|
2022-06-14 22:54:08 +00:00
|
|
|
GSSettingBoolEx(PCRTCAntiBlur, "pcrtc_antiblur");
|
2022-05-20 17:17:35 +00:00
|
|
|
GSSettingBoolEx(DisableInterlaceOffset, "disable_interlace_offset");
|
2022-04-10 14:30:55 +00:00
|
|
|
GSSettingBoolEx(PCRTCOffsets, "pcrtc_offsets");
|
2022-06-05 17:03:13 +00:00
|
|
|
GSSettingBoolEx(PCRTCOverscan, "pcrtc_overscan");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBool(IntegerScaling);
|
|
|
|
GSSettingBool(UseDebugDevice);
|
|
|
|
GSSettingBool(UseBlitSwapChain);
|
2023-05-08 10:57:40 +00:00
|
|
|
GSSettingBool(DisableShaderCache);
|
2021-12-31 07:29:26 +00:00
|
|
|
GSSettingBool(DisableDualSourceBlend);
|
2022-03-07 14:36:05 +00:00
|
|
|
GSSettingBool(DisableFramebufferFetch);
|
2023-05-11 09:45:57 +00:00
|
|
|
GSSettingBool(DisableVertexShaderExpand);
|
2023-01-06 15:10:58 +00:00
|
|
|
GSSettingBool(DisableThreadedPresentation);
|
2022-01-09 09:27:19 +00:00
|
|
|
GSSettingBool(SkipDuplicateFrames);
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBool(OsdShowMessages);
|
|
|
|
GSSettingBool(OsdShowSpeed);
|
|
|
|
GSSettingBool(OsdShowFPS);
|
|
|
|
GSSettingBool(OsdShowCPU);
|
2022-03-11 12:05:38 +00:00
|
|
|
GSSettingBool(OsdShowGPU);
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBool(OsdShowResolution);
|
|
|
|
GSSettingBool(OsdShowGSStats);
|
2022-02-23 11:52:18 +00:00
|
|
|
GSSettingBool(OsdShowIndicators);
|
2022-09-17 12:45:03 +00:00
|
|
|
GSSettingBool(OsdShowSettings);
|
|
|
|
GSSettingBool(OsdShowInputs);
|
2022-11-30 14:25:16 +00:00
|
|
|
GSSettingBool(OsdShowFrameTimes);
|
2021-12-18 14:43:50 +00:00
|
|
|
|
2022-09-18 01:46:27 +00:00
|
|
|
GSSettingBool(HWSpinGPUForReadbacks);
|
2022-09-28 06:54:33 +00:00
|
|
|
GSSettingBool(HWSpinCPUForReadbacks);
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBoolEx(GPUPaletteConversion, "paltex");
|
|
|
|
GSSettingBoolEx(AutoFlushSW, "autoflush_sw");
|
|
|
|
GSSettingBoolEx(PreloadFrameWithGSData, "preload_frame_with_gs_data");
|
|
|
|
GSSettingBoolEx(Mipmap, "mipmap");
|
2022-03-03 12:36:05 +00:00
|
|
|
GSSettingBoolEx(ManualUserHacks, "UserHacks");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBoolEx(UserHacks_AlignSpriteX, "UserHacks_align_sprite_X");
|
2023-04-23 06:50:17 +00:00
|
|
|
GSSettingIntEnumEx(UserHacks_AutoFlush, "UserHacks_AutoFlushLevel");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBoolEx(UserHacks_CPUFBConversion, "UserHacks_CPU_FB_Conversion");
|
2023-02-23 11:00:48 +00:00
|
|
|
GSSettingBoolEx(UserHacks_ReadTCOnClose, "UserHacks_ReadTCOnClose");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBoolEx(UserHacks_DisableDepthSupport, "UserHacks_DisableDepthSupport");
|
|
|
|
GSSettingBoolEx(UserHacks_DisablePartialInvalidation, "UserHacks_DisablePartialInvalidation");
|
|
|
|
GSSettingBoolEx(UserHacks_DisableSafeFeatures, "UserHacks_Disable_Safe_Features");
|
2023-05-11 10:41:26 +00:00
|
|
|
GSSettingBoolEx(UserHacks_DisableRenderFixes, "UserHacks_DisableRenderFixes");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBoolEx(UserHacks_MergePPSprite, "UserHacks_merge_pp_sprite");
|
|
|
|
GSSettingBoolEx(UserHacks_WildHack, "UserHacks_WildHack");
|
2023-03-16 02:50:59 +00:00
|
|
|
GSSettingBoolEx(UserHacks_BilinearHack, "UserHacks_BilinearHack");
|
2023-03-31 13:19:07 +00:00
|
|
|
GSSettingBoolEx(UserHacks_NativePaletteDraw, "UserHacks_NativePaletteDraw");
|
2023-02-26 12:15:48 +00:00
|
|
|
GSSettingIntEnumEx(UserHacks_TextureInsideRt, "UserHacks_TextureInsideRt");
|
2023-02-24 14:06:53 +00:00
|
|
|
GSSettingBoolEx(UserHacks_TargetPartialInvalidation, "UserHacks_TargetPartialInvalidation");
|
2023-02-15 11:51:34 +00:00
|
|
|
GSSettingBoolEx(UserHacks_EstimateTextureRegion, "UserHacks_EstimateTextureRegion");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingBoolEx(FXAA, "fxaa");
|
|
|
|
GSSettingBool(ShadeBoost);
|
|
|
|
GSSettingBoolEx(DumpGSData, "dump");
|
|
|
|
GSSettingBoolEx(SaveRT, "save");
|
|
|
|
GSSettingBoolEx(SaveFrame, "savef");
|
|
|
|
GSSettingBoolEx(SaveTexture, "savet");
|
|
|
|
GSSettingBoolEx(SaveDepth, "savez");
|
2022-05-11 10:36:04 +00:00
|
|
|
GSSettingBool(DumpReplaceableTextures);
|
|
|
|
GSSettingBool(DumpReplaceableMipmaps);
|
|
|
|
GSSettingBool(DumpTexturesWithFMVActive);
|
|
|
|
GSSettingBool(DumpDirectTextures);
|
|
|
|
GSSettingBool(DumpPaletteTextures);
|
|
|
|
GSSettingBool(LoadTextureReplacements);
|
|
|
|
GSSettingBool(LoadTextureReplacementsAsync);
|
|
|
|
GSSettingBool(PrecacheTextureReplacements);
|
2023-01-19 14:01:54 +00:00
|
|
|
GSSettingBool(EnableVideoCapture);
|
2023-01-12 09:30:39 +00:00
|
|
|
GSSettingBool(EnableVideoCaptureParameters);
|
2023-01-19 14:01:54 +00:00
|
|
|
GSSettingBool(VideoCaptureAutoResolution);
|
|
|
|
GSSettingBool(EnableAudioCapture);
|
|
|
|
GSSettingBool(EnableAudioCaptureParameters);
|
2021-12-18 14:43:50 +00:00
|
|
|
|
2022-11-22 14:12:06 +00:00
|
|
|
GSSettingIntEnumEx(LinearPresent, "linear_present_mode");
|
2022-11-11 21:29:02 +00:00
|
|
|
GSSettingIntEnumEx(InterlaceMode, "deinterlace_mode");
|
2021-12-18 14:43:50 +00:00
|
|
|
|
|
|
|
GSSettingFloat(OsdScale);
|
|
|
|
|
|
|
|
GSSettingIntEnumEx(Renderer, "Renderer");
|
2022-07-19 10:46:59 +00:00
|
|
|
GSSettingFloatEx(UpscaleMultiplier, "upscale_multiplier");
|
|
|
|
|
|
|
|
// ~51x would the upper bound here for 32768x32768 textures, but you'll run out VRAM long before then.
|
|
|
|
UpscaleMultiplier = std::clamp(UpscaleMultiplier, 0.5f, 50.0f);
|
2021-12-18 14:43:50 +00:00
|
|
|
|
|
|
|
GSSettingIntEnumEx(HWMipmap, "mipmap_hw");
|
|
|
|
GSSettingIntEnumEx(AccurateBlendingUnit, "accurate_blending_unit");
|
|
|
|
GSSettingIntEnumEx(TextureFiltering, "filter");
|
2022-01-23 05:19:06 +00:00
|
|
|
GSSettingIntEnumEx(TexturePreloading, "texture_preloading");
|
2022-05-16 11:10:34 +00:00
|
|
|
GSSettingIntEnumEx(GSDumpCompression, "GSDumpCompression");
|
2022-06-06 11:01:31 +00:00
|
|
|
GSSettingIntEnumEx(HWDownloadMode, "HWDownloadMode");
|
2022-11-20 14:20:40 +00:00
|
|
|
GSSettingIntEnumEx(CASMode, "CASMode");
|
|
|
|
GSSettingIntEx(CAS_Sharpness, "CASSharpness");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingIntEx(Dithering, "dithering_ps2");
|
|
|
|
GSSettingIntEx(MaxAnisotropy, "MaxAnisotropy");
|
|
|
|
GSSettingIntEx(SWExtraThreads, "extrathreads");
|
|
|
|
GSSettingIntEx(SWExtraThreadsHeight, "extrathreads_height");
|
|
|
|
GSSettingIntEx(TVShader, "TVShader");
|
2022-03-19 00:08:30 +00:00
|
|
|
GSSettingIntEx(SkipDrawStart, "UserHacks_SkipDraw_Start");
|
|
|
|
GSSettingIntEx(SkipDrawEnd, "UserHacks_SkipDraw_End");
|
2022-03-03 12:36:05 +00:00
|
|
|
SkipDrawEnd = std::max(SkipDrawStart, SkipDrawEnd);
|
2021-12-18 14:43:50 +00:00
|
|
|
|
|
|
|
GSSettingIntEx(UserHacks_HalfBottomOverride, "UserHacks_Half_Bottom_Override");
|
|
|
|
GSSettingIntEx(UserHacks_HalfPixelOffset, "UserHacks_HalfPixelOffset");
|
|
|
|
GSSettingIntEx(UserHacks_RoundSprite, "UserHacks_round_sprite_offset");
|
|
|
|
GSSettingIntEx(UserHacks_TCOffsetX, "UserHacks_TCOffsetX");
|
|
|
|
GSSettingIntEx(UserHacks_TCOffsetY, "UserHacks_TCOffsetY");
|
2022-06-02 15:00:39 +00:00
|
|
|
GSSettingIntEx(UserHacks_CPUSpriteRenderBW, "UserHacks_CPUSpriteRenderBW");
|
2023-03-19 12:24:29 +00:00
|
|
|
GSSettingIntEx(UserHacks_CPUSpriteRenderLevel, "UserHacks_CPUSpriteRenderLevel");
|
2022-10-22 10:43:29 +00:00
|
|
|
GSSettingIntEx(UserHacks_CPUCLUTRender, "UserHacks_CPUCLUTRender");
|
2023-01-02 13:14:10 +00:00
|
|
|
GSSettingIntEnumEx(UserHacks_GPUTargetCLUTMode, "UserHacks_GPUTargetCLUTMode");
|
2022-10-01 03:32:31 +00:00
|
|
|
GSSettingIntEnumEx(TriFilter, "TriFilter");
|
2022-01-05 11:13:27 +00:00
|
|
|
GSSettingIntEx(OverrideTextureBarriers, "OverrideTextureBarriers");
|
2021-12-18 14:43:50 +00:00
|
|
|
|
|
|
|
GSSettingInt(ShadeBoost_Brightness);
|
|
|
|
GSSettingInt(ShadeBoost_Contrast);
|
|
|
|
GSSettingInt(ShadeBoost_Saturation);
|
2023-04-29 15:35:04 +00:00
|
|
|
GSSettingInt(ExclusiveFullscreenControl);
|
2022-12-24 03:46:11 +00:00
|
|
|
GSSettingIntEx(PNGCompressionLevel, "png_compression_level");
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingIntEx(SaveN, "saven");
|
|
|
|
GSSettingIntEx(SaveL, "savel");
|
|
|
|
|
2023-01-19 14:01:54 +00:00
|
|
|
GSSettingStringEx(CaptureContainer, "CaptureContainer");
|
2022-12-18 13:05:00 +00:00
|
|
|
GSSettingStringEx(VideoCaptureCodec, "VideoCaptureCodec");
|
2023-01-12 09:30:39 +00:00
|
|
|
GSSettingStringEx(VideoCaptureParameters, "VideoCaptureParameters");
|
2023-01-19 14:01:54 +00:00
|
|
|
GSSettingStringEx(AudioCaptureCodec, "AudioCaptureCodec");
|
|
|
|
GSSettingStringEx(AudioCaptureParameters, "AudioCaptureParameters");
|
|
|
|
GSSettingIntEx(VideoCaptureBitrate, "VideoCaptureBitrate");
|
|
|
|
GSSettingIntEx(VideoCaptureWidth, "VideoCaptureWidth");
|
|
|
|
GSSettingIntEx(VideoCaptureHeight, "VideoCaptureHeight");
|
|
|
|
GSSettingIntEx(AudioCaptureBitrate, "AudioCaptureBitrate");
|
2022-12-18 13:05:00 +00:00
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
GSSettingString(Adapter);
|
2022-12-24 03:47:10 +00:00
|
|
|
GSSettingString(HWDumpDirectory);
|
|
|
|
if (!HWDumpDirectory.empty() && !Path::IsAbsolute(HWDumpDirectory))
|
|
|
|
HWDumpDirectory = Path::Combine(EmuFolders::DataRoot, HWDumpDirectory);
|
|
|
|
GSSettingString(SWDumpDirectory);
|
|
|
|
if (!SWDumpDirectory.empty() && !Path::IsAbsolute(SWDumpDirectory))
|
|
|
|
SWDumpDirectory = Path::Combine(EmuFolders::DataRoot, SWDumpDirectory);
|
2021-12-18 14:43:50 +00:00
|
|
|
|
|
|
|
#undef GSSettingInt
|
|
|
|
#undef GSSettingIntEx
|
|
|
|
#undef GSSettingBool
|
|
|
|
#undef GSSettingBoolEx
|
|
|
|
#undef GSSettingFloat
|
|
|
|
#undef GSSettingEnumEx
|
|
|
|
#undef GSSettingIntEnumEx
|
|
|
|
#undef GSSettingString
|
|
|
|
#undef GSSettingStringEx
|
2022-12-24 03:47:10 +00:00
|
|
|
|
|
|
|
// Sanity check: don't dump a bunch of crap in the current working directory.
|
|
|
|
const std::string& dump_dir = UseHardwareRenderer() ? HWDumpDirectory : SWDumpDirectory;
|
|
|
|
if (DumpGSData && dump_dir.empty())
|
|
|
|
{
|
|
|
|
Console.Error("Draw dumping is enabled but directory is unconfigured, please set one.");
|
|
|
|
DumpGSData = false;
|
|
|
|
}
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
void Pcsx2Config::GSOptions::MaskUserHacks()
|
2017-07-14 13:10:46 +00:00
|
|
|
{
|
2022-03-03 12:36:05 +00:00
|
|
|
if (ManualUserHacks)
|
2021-12-18 14:43:50 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
UserHacks_AlignSpriteX = false;
|
|
|
|
UserHacks_MergePPSprite = false;
|
2022-03-14 11:08:39 +00:00
|
|
|
UserHacks_WildHack = false;
|
2023-03-16 02:50:59 +00:00
|
|
|
UserHacks_BilinearHack = false;
|
2023-03-31 13:19:07 +00:00
|
|
|
UserHacks_NativePaletteDraw = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
UserHacks_DisableSafeFeatures = false;
|
2023-05-11 10:41:26 +00:00
|
|
|
UserHacks_DisableRenderFixes = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
UserHacks_HalfBottomOverride = -1;
|
|
|
|
UserHacks_HalfPixelOffset = 0;
|
|
|
|
UserHacks_RoundSprite = 0;
|
2023-04-23 06:50:17 +00:00
|
|
|
UserHacks_AutoFlush = GSHWAutoFlushLevel::Disabled;
|
2021-12-18 14:43:50 +00:00
|
|
|
PreloadFrameWithGSData = false;
|
|
|
|
UserHacks_DisablePartialInvalidation = false;
|
|
|
|
UserHacks_DisableDepthSupport = false;
|
|
|
|
UserHacks_CPUFBConversion = false;
|
2023-02-23 11:00:48 +00:00
|
|
|
UserHacks_ReadTCOnClose = false;
|
2023-02-26 12:15:48 +00:00
|
|
|
UserHacks_TextureInsideRt = GSTextureInRtMode::Disabled;
|
2023-02-24 14:06:53 +00:00
|
|
|
UserHacks_TargetPartialInvalidation = false;
|
2023-02-15 11:51:34 +00:00
|
|
|
UserHacks_EstimateTextureRegion = false;
|
2021-12-18 14:43:50 +00:00
|
|
|
UserHacks_TCOffsetX = 0;
|
|
|
|
UserHacks_TCOffsetY = 0;
|
2022-06-02 15:00:39 +00:00
|
|
|
UserHacks_CPUSpriteRenderBW = 0;
|
2023-03-19 12:24:29 +00:00
|
|
|
UserHacks_CPUSpriteRenderLevel = 0;
|
2022-10-22 10:43:29 +00:00
|
|
|
UserHacks_CPUCLUTRender = 0;
|
2023-01-02 13:14:10 +00:00
|
|
|
UserHacks_GPUTargetCLUTMode = GSGPUTargetCLUTMode::Disabled;
|
2022-03-03 12:36:05 +00:00
|
|
|
SkipDrawStart = 0;
|
|
|
|
SkipDrawEnd = 0;
|
2021-12-18 14:43:50 +00:00
|
|
|
}
|
2017-07-14 13:10:46 +00:00
|
|
|
|
2022-03-03 11:32:32 +00:00
|
|
|
void Pcsx2Config::GSOptions::MaskUpscalingHacks()
|
|
|
|
{
|
2023-06-24 03:14:54 +00:00
|
|
|
if (UpscaleMultiplier > 1.0f)
|
2022-03-03 11:32:32 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
UserHacks_AlignSpriteX = false;
|
|
|
|
UserHacks_MergePPSprite = false;
|
2022-06-22 10:25:25 +00:00
|
|
|
UserHacks_WildHack = false;
|
2023-03-16 02:50:59 +00:00
|
|
|
UserHacks_BilinearHack = false;
|
2023-03-31 13:19:07 +00:00
|
|
|
UserHacks_NativePaletteDraw = false;
|
2022-03-03 11:32:32 +00:00
|
|
|
UserHacks_HalfPixelOffset = 0;
|
|
|
|
UserHacks_RoundSprite = 0;
|
2022-06-22 10:25:25 +00:00
|
|
|
UserHacks_TCOffsetX = 0;
|
|
|
|
UserHacks_TCOffsetY = 0;
|
2022-03-03 11:32:32 +00:00
|
|
|
}
|
|
|
|
|
2021-12-18 14:43:50 +00:00
|
|
|
bool Pcsx2Config::GSOptions::UseHardwareRenderer() const
|
|
|
|
{
|
2022-05-01 23:22:43 +00:00
|
|
|
return (Renderer != GSRendererType::Null && Renderer != GSRendererType::SW);
|
2021-12-18 14:43:50 +00:00
|
|
|
}
|
|
|
|
|
2021-12-18 14:23:43 +00:00
|
|
|
Pcsx2Config::SPU2Options::SPU2Options()
|
|
|
|
{
|
2022-10-01 03:23:25 +00:00
|
|
|
bitset = 0;
|
2021-12-18 14:23:43 +00:00
|
|
|
OutputModule = "cubeb";
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::SPU2Options::LoadSave(SettingsWrapper& wrap)
|
|
|
|
{
|
2022-12-30 05:35:16 +00:00
|
|
|
{
|
|
|
|
SettingsWrapSection("SPU2/Debug");
|
|
|
|
|
|
|
|
SettingsWrapBitBoolEx(DebugEnabled, "Global_Enable");
|
|
|
|
SettingsWrapBitBoolEx(MsgToConsole, "Show_Messages");
|
|
|
|
SettingsWrapBitBoolEx(MsgKeyOnOff, "Show_Messages_Key_On_Off");
|
|
|
|
SettingsWrapBitBoolEx(MsgVoiceOff, "Show_Messages_Voice_Off");
|
|
|
|
SettingsWrapBitBoolEx(MsgDMA, "Show_Messages_DMA_Transfer");
|
|
|
|
SettingsWrapBitBoolEx(MsgAutoDMA, "Show_Messages_AutoDMA");
|
|
|
|
SettingsWrapBitBoolEx(MsgOverruns, "Show_Messages_Overruns");
|
|
|
|
SettingsWrapBitBoolEx(MsgCache, "Show_Messages_CacheStats");
|
|
|
|
|
|
|
|
SettingsWrapBitBoolEx(AccessLog, "Log_Register_Access");
|
|
|
|
SettingsWrapBitBoolEx(DMALog, "Log_DMA_Transfers");
|
|
|
|
SettingsWrapBitBoolEx(WaveLog, "Log_WAVE_Output");
|
|
|
|
|
|
|
|
SettingsWrapBitBoolEx(CoresDump, "Dump_Info");
|
|
|
|
SettingsWrapBitBoolEx(MemDump, "Dump_Memory");
|
|
|
|
SettingsWrapBitBoolEx(RegDump, "Dump_Regs");
|
|
|
|
|
|
|
|
// If the global switch is off, save runtime checks.
|
|
|
|
if (wrap.IsLoading() && !DebugEnabled)
|
|
|
|
{
|
|
|
|
MsgToConsole = false;
|
|
|
|
MsgKeyOnOff = false;
|
|
|
|
MsgVoiceOff = false;
|
|
|
|
MsgDMA = false;
|
|
|
|
MsgAutoDMA = false;
|
|
|
|
MsgOverruns = false;
|
|
|
|
MsgCache = false;
|
|
|
|
AccessLog = false;
|
|
|
|
DMALog = false;
|
|
|
|
WaveLog = false;
|
|
|
|
CoresDump = false;
|
|
|
|
MemDump = false;
|
|
|
|
RegDump = false;
|
|
|
|
}
|
|
|
|
}
|
2021-12-18 14:23:43 +00:00
|
|
|
{
|
|
|
|
SettingsWrapSection("SPU2/Mixing");
|
|
|
|
|
|
|
|
SettingsWrapEntry(FinalVolume);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
SettingsWrapSection("SPU2/Output");
|
|
|
|
|
|
|
|
SettingsWrapEntry(OutputModule);
|
2022-10-01 03:23:25 +00:00
|
|
|
SettingsWrapEntry(BackendName);
|
2022-12-30 10:51:16 +00:00
|
|
|
SettingsWrapEntry(DeviceName);
|
2021-12-18 14:23:43 +00:00
|
|
|
SettingsWrapEntry(Latency);
|
2022-12-30 07:39:41 +00:00
|
|
|
SettingsWrapEntry(OutputLatency);
|
|
|
|
SettingsWrapBitBool(OutputLatencyMinimal);
|
2021-12-18 14:23:43 +00:00
|
|
|
SynchMode = static_cast<SynchronizationMode>(wrap.EntryBitfield(CURRENT_SETTINGS_SECTION, "SynchMode", static_cast<int>(SynchMode), static_cast<int>(SynchMode)));
|
|
|
|
SettingsWrapEntry(SpeakerConfiguration);
|
2022-08-14 01:23:52 +00:00
|
|
|
SettingsWrapEntry(DplDecodingLevel);
|
2021-12-18 14:23:43 +00:00
|
|
|
}
|
2022-12-30 05:35:16 +00:00
|
|
|
|
|
|
|
// clampy clamp
|
2021-12-18 14:23:43 +00:00
|
|
|
}
|
|
|
|
|
2022-02-07 23:38:50 +00:00
|
|
|
const char* Pcsx2Config::DEV9Options::NetApiNames[] = {
|
|
|
|
"Unset",
|
|
|
|
"PCAP Bridged",
|
|
|
|
"PCAP Switched",
|
|
|
|
"TAP",
|
2021-02-27 19:37:48 +00:00
|
|
|
"Sockets",
|
2022-02-07 23:38:50 +00:00
|
|
|
nullptr};
|
|
|
|
|
2022-03-07 20:39:51 +00:00
|
|
|
const char* Pcsx2Config::DEV9Options::DnsModeNames[] = {
|
|
|
|
"Manual",
|
|
|
|
"Auto",
|
|
|
|
"Internal",
|
|
|
|
nullptr};
|
|
|
|
|
2022-02-07 23:38:50 +00:00
|
|
|
Pcsx2Config::DEV9Options::DEV9Options()
|
|
|
|
{
|
|
|
|
HddFile = "DEV9hdd.raw";
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::DEV9Options::LoadSave(SettingsWrapper& wrap)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SettingsWrapSection("DEV9/Eth");
|
|
|
|
SettingsWrapEntry(EthEnable);
|
|
|
|
SettingsWrapEnumEx(EthApi, "EthApi", NetApiNames);
|
|
|
|
SettingsWrapEntry(EthDevice);
|
|
|
|
SettingsWrapEntry(EthLogDNS);
|
|
|
|
|
|
|
|
SettingsWrapEntry(InterceptDHCP);
|
|
|
|
|
|
|
|
std::string ps2IPStr = "0.0.0.0";
|
2022-03-03 15:02:08 +00:00
|
|
|
std::string maskStr = "0.0.0.0";
|
2022-02-07 23:38:50 +00:00
|
|
|
std::string gatewayStr = "0.0.0.0";
|
|
|
|
std::string dns1Str = "0.0.0.0";
|
|
|
|
std::string dns2Str = "0.0.0.0";
|
|
|
|
if (wrap.IsSaving())
|
|
|
|
{
|
|
|
|
ps2IPStr = SaveIPHelper(PS2IP);
|
2022-03-03 15:02:08 +00:00
|
|
|
maskStr = SaveIPHelper(Mask);
|
2022-02-07 23:38:50 +00:00
|
|
|
gatewayStr = SaveIPHelper(Gateway);
|
|
|
|
dns1Str = SaveIPHelper(DNS1);
|
|
|
|
dns2Str = SaveIPHelper(DNS2);
|
|
|
|
}
|
|
|
|
SettingsWrapEntryEx(ps2IPStr, "PS2IP");
|
2022-03-03 15:02:08 +00:00
|
|
|
SettingsWrapEntryEx(maskStr, "Mask");
|
2022-02-07 23:38:50 +00:00
|
|
|
SettingsWrapEntryEx(gatewayStr, "Gateway");
|
|
|
|
SettingsWrapEntryEx(dns1Str, "DNS1");
|
|
|
|
SettingsWrapEntryEx(dns2Str, "DNS2");
|
|
|
|
if (wrap.IsLoading())
|
|
|
|
{
|
|
|
|
LoadIPHelper(PS2IP, ps2IPStr);
|
2022-03-03 15:02:08 +00:00
|
|
|
LoadIPHelper(Mask, maskStr);
|
2022-02-07 23:38:50 +00:00
|
|
|
LoadIPHelper(Gateway, gatewayStr);
|
|
|
|
LoadIPHelper(DNS1, dns1Str);
|
|
|
|
LoadIPHelper(DNS1, dns1Str);
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsWrapEntry(AutoMask);
|
|
|
|
SettingsWrapEntry(AutoGateway);
|
2022-03-07 20:39:51 +00:00
|
|
|
SettingsWrapEnumEx(ModeDNS1, "ModeDNS1", DnsModeNames);
|
|
|
|
SettingsWrapEnumEx(ModeDNS2, "ModeDNS2", DnsModeNames);
|
2022-02-07 23:38:50 +00:00
|
|
|
}
|
|
|
|
|
2022-03-07 20:40:40 +00:00
|
|
|
if (wrap.IsLoading())
|
|
|
|
EthHosts.clear();
|
|
|
|
|
|
|
|
int hostCount = static_cast<int>(EthHosts.size());
|
|
|
|
{
|
|
|
|
SettingsWrapSection("DEV9/Eth/Hosts");
|
|
|
|
SettingsWrapEntryEx(hostCount, "Count");
|
|
|
|
}
|
|
|
|
|
2022-05-24 15:12:56 +00:00
|
|
|
for (int i = 0; i < hostCount; i++)
|
2022-03-07 20:40:40 +00:00
|
|
|
{
|
|
|
|
std::string section = "DEV9/Eth/Hosts/Host" + std::to_string(i);
|
|
|
|
SettingsWrapSection(section.c_str());
|
|
|
|
|
|
|
|
HostEntry entry;
|
|
|
|
if (wrap.IsSaving())
|
|
|
|
entry = EthHosts[i];
|
|
|
|
|
|
|
|
SettingsWrapEntryEx(entry.Url, "Url");
|
|
|
|
SettingsWrapEntryEx(entry.Desc, "Desc");
|
|
|
|
|
|
|
|
std::string addrStr = "0.0.0.0";
|
|
|
|
if (wrap.IsSaving())
|
|
|
|
addrStr = SaveIPHelper(entry.Address);
|
|
|
|
SettingsWrapEntryEx(addrStr, "Address");
|
|
|
|
if (wrap.IsLoading())
|
|
|
|
LoadIPHelper(entry.Address, addrStr);
|
|
|
|
|
|
|
|
SettingsWrapEntryEx(entry.Enabled, "Enabled");
|
|
|
|
|
|
|
|
if (wrap.IsLoading())
|
|
|
|
{
|
|
|
|
EthHosts.push_back(entry);
|
|
|
|
|
|
|
|
if (EthLogDNS && entry.Enabled)
|
|
|
|
Console.WriteLn("DEV9: Host entry %i: url %s mapped to %s", i, entry.Url.c_str(), addrStr.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-07 23:38:50 +00:00
|
|
|
{
|
|
|
|
SettingsWrapSection("DEV9/Hdd");
|
|
|
|
SettingsWrapEntry(HddEnable);
|
|
|
|
SettingsWrapEntry(HddFile);
|
|
|
|
SettingsWrapEntry(HddSizeSectors);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::DEV9Options::LoadIPHelper(u8* field, const std::string& setting)
|
|
|
|
{
|
|
|
|
if (4 == sscanf(setting.c_str(), "%hhu.%hhu.%hhu.%hhu", &field[0], &field[1], &field[2], &field[3]))
|
|
|
|
return;
|
|
|
|
Console.Error("Invalid IP address in settings file");
|
|
|
|
std::fill(field, field + 4, 0);
|
|
|
|
}
|
|
|
|
std::string Pcsx2Config::DEV9Options::SaveIPHelper(u8* field)
|
|
|
|
{
|
|
|
|
return StringUtil::StdStringFromFormat("%u.%u.%u.%u", field[0], field[1], field[2], field[3]);
|
|
|
|
}
|
|
|
|
|
2021-12-18 15:08:12 +00:00
|
|
|
static const char* const tbl_GamefixNames[] =
|
2022-03-01 00:54:18 +00:00
|
|
|
{
|
|
|
|
"FpuMul",
|
|
|
|
"FpuNegDiv",
|
|
|
|
"GoemonTlb",
|
|
|
|
"SoftwareRendererFMV",
|
|
|
|
"SkipMPEG",
|
|
|
|
"OPHFlag",
|
|
|
|
"EETiming",
|
2022-11-06 18:48:35 +00:00
|
|
|
"InstantDMA",
|
2022-03-01 00:54:18 +00:00
|
|
|
"DMABusy",
|
|
|
|
"GIFFIFO",
|
|
|
|
"VIFFIFO",
|
|
|
|
"VIF1Stall",
|
|
|
|
"VuAddSub",
|
|
|
|
"Ibit",
|
|
|
|
"VUSync",
|
|
|
|
"VUOverflow",
|
2022-04-23 06:37:11 +00:00
|
|
|
"XGKick",
|
2022-10-29 03:39:19 +00:00
|
|
|
"BlitInternalFPS",
|
|
|
|
"FullVU0Sync",
|
2022-03-01 00:54:18 +00:00
|
|
|
};
|
2021-12-10 11:12:15 +00:00
|
|
|
|
|
|
|
const char* EnumToString(GamefixId id)
|
2010-06-15 14:13:23 +00:00
|
|
|
{
|
|
|
|
return tbl_GamefixNames[id];
|
|
|
|
}
|
|
|
|
|
2010-09-29 13:48:36 +00:00
|
|
|
// all gamefixes are disabled by default.
|
|
|
|
Pcsx2Config::GamefixOptions::GamefixOptions()
|
|
|
|
{
|
|
|
|
DisableAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
Pcsx2Config::GamefixOptions& Pcsx2Config::GamefixOptions::DisableAll()
|
|
|
|
{
|
|
|
|
bitset = 0;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::GamefixOptions::Set(GamefixId id, bool enabled)
|
2010-06-15 14:13:23 +00:00
|
|
|
{
|
2022-05-18 13:27:23 +00:00
|
|
|
pxAssert(EnumIsValid(id));
|
2021-09-22 07:38:30 +00:00
|
|
|
switch (id)
|
2010-06-15 14:13:23 +00:00
|
|
|
{
|
2022-03-01 00:54:18 +00:00
|
|
|
case Fix_VuAddSub: VuAddSubHack = enabled; break;
|
|
|
|
case Fix_FpuMultiply: FpuMulHack = enabled; break;
|
|
|
|
case Fix_FpuNegDiv: FpuNegDivHack = enabled; break;
|
|
|
|
case Fix_XGKick: XgKickHack = enabled; break;
|
|
|
|
case Fix_EETiming: EETimingHack = enabled; break;
|
2022-11-06 18:48:35 +00:00
|
|
|
case Fix_InstantDMA: InstantDMAHack = enabled; break;
|
2022-03-01 00:54:18 +00:00
|
|
|
case Fix_SoftwareRendererFMV: SoftwareRendererFMVHack = enabled; break;
|
|
|
|
case Fix_SkipMpeg: SkipMPEGHack = enabled; break;
|
|
|
|
case Fix_OPHFlag: OPHFlagHack = enabled; break;
|
|
|
|
case Fix_DMABusy: DMABusyHack = enabled; break;
|
|
|
|
case Fix_VIFFIFO: VIFFIFOHack = enabled; break;
|
|
|
|
case Fix_VIF1Stall: VIF1StallHack = enabled; break;
|
|
|
|
case Fix_GIFFIFO: GIFFIFOHack = enabled; break;
|
|
|
|
case Fix_GoemonTlbMiss: GoemonTlbHack = enabled; break;
|
|
|
|
case Fix_Ibit: IbitHack = enabled; break;
|
|
|
|
case Fix_VUSync: VUSyncHack = enabled; break;
|
|
|
|
case Fix_VUOverflow: VUOverflowHack = enabled; break;
|
2022-04-23 06:37:11 +00:00
|
|
|
case Fix_BlitInternalFPS: BlitInternalFPSHack = enabled; break;
|
2022-10-29 03:39:19 +00:00
|
|
|
case Fix_FullVU0Sync: FullVU0SyncHack = enabled; break;
|
2022-03-01 00:54:18 +00:00
|
|
|
jNO_DEFAULT;
|
2010-06-15 14:13:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
bool Pcsx2Config::GamefixOptions::Get(GamefixId id) const
|
2010-06-15 14:13:23 +00:00
|
|
|
{
|
2022-05-18 13:27:23 +00:00
|
|
|
pxAssert(EnumIsValid(id));
|
2021-09-22 07:38:30 +00:00
|
|
|
switch (id)
|
2010-06-15 14:13:23 +00:00
|
|
|
{
|
2022-03-01 00:54:18 +00:00
|
|
|
case Fix_VuAddSub: return VuAddSubHack;
|
|
|
|
case Fix_FpuMultiply: return FpuMulHack;
|
|
|
|
case Fix_FpuNegDiv: return FpuNegDivHack;
|
|
|
|
case Fix_XGKick: return XgKickHack;
|
|
|
|
case Fix_EETiming: return EETimingHack;
|
2022-11-06 18:48:35 +00:00
|
|
|
case Fix_InstantDMA: return InstantDMAHack;
|
2022-03-01 00:54:18 +00:00
|
|
|
case Fix_SoftwareRendererFMV: return SoftwareRendererFMVHack;
|
|
|
|
case Fix_SkipMpeg: return SkipMPEGHack;
|
|
|
|
case Fix_OPHFlag: return OPHFlagHack;
|
|
|
|
case Fix_DMABusy: return DMABusyHack;
|
|
|
|
case Fix_VIFFIFO: return VIFFIFOHack;
|
|
|
|
case Fix_VIF1Stall: return VIF1StallHack;
|
|
|
|
case Fix_GIFFIFO: return GIFFIFOHack;
|
|
|
|
case Fix_GoemonTlbMiss: return GoemonTlbHack;
|
|
|
|
case Fix_Ibit: return IbitHack;
|
|
|
|
case Fix_VUSync: return VUSyncHack;
|
|
|
|
case Fix_VUOverflow: return VUOverflowHack;
|
2022-04-23 06:37:11 +00:00
|
|
|
case Fix_BlitInternalFPS: return BlitInternalFPSHack;
|
2022-10-29 03:39:19 +00:00
|
|
|
case Fix_FullVU0Sync: return FullVU0SyncHack;
|
2022-03-01 00:54:18 +00:00
|
|
|
jNO_DEFAULT;
|
2010-06-15 14:13:23 +00:00
|
|
|
}
|
2021-09-22 07:38:30 +00:00
|
|
|
return false; // unreachable, but we still need to suppress warnings >_<
|
2010-06-15 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::GamefixOptions::LoadSave(SettingsWrapper& wrap)
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/Gamefixes");
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-10-05 01:59:03 +00:00
|
|
|
SettingsWrapBitBool(VuAddSubHack);
|
|
|
|
SettingsWrapBitBool(FpuMulHack);
|
|
|
|
SettingsWrapBitBool(FpuNegDivHack);
|
|
|
|
SettingsWrapBitBool(XgKickHack);
|
|
|
|
SettingsWrapBitBool(EETimingHack);
|
2022-11-06 18:48:35 +00:00
|
|
|
SettingsWrapBitBool(InstantDMAHack);
|
2021-12-18 14:43:50 +00:00
|
|
|
SettingsWrapBitBool(SoftwareRendererFMVHack);
|
2021-10-05 01:59:03 +00:00
|
|
|
SettingsWrapBitBool(SkipMPEGHack);
|
|
|
|
SettingsWrapBitBool(OPHFlagHack);
|
|
|
|
SettingsWrapBitBool(DMABusyHack);
|
|
|
|
SettingsWrapBitBool(VIFFIFOHack);
|
|
|
|
SettingsWrapBitBool(VIF1StallHack);
|
|
|
|
SettingsWrapBitBool(GIFFIFOHack);
|
|
|
|
SettingsWrapBitBool(GoemonTlbHack);
|
|
|
|
SettingsWrapBitBool(IbitHack);
|
2022-02-27 21:58:42 +00:00
|
|
|
SettingsWrapBitBool(VUSyncHack);
|
2021-10-05 01:59:03 +00:00
|
|
|
SettingsWrapBitBool(VUOverflowHack);
|
2022-04-23 06:37:11 +00:00
|
|
|
SettingsWrapBitBool(BlitInternalFPSHack);
|
2022-10-29 03:39:19 +00:00
|
|
|
SettingsWrapBitBool(FullVU0SyncHack);
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2014-02-24 10:48:06 +00:00
|
|
|
|
|
|
|
Pcsx2Config::DebugOptions::DebugOptions()
|
|
|
|
{
|
|
|
|
ShowDebuggerOnStart = false;
|
2017-04-15 07:41:40 +00:00
|
|
|
AlignMemoryWindowStart = true;
|
2014-02-24 10:48:06 +00:00
|
|
|
FontWidth = 8;
|
|
|
|
FontHeight = 12;
|
2015-12-28 16:41:19 +00:00
|
|
|
WindowWidth = 0;
|
|
|
|
WindowHeight = 0;
|
2017-04-15 07:41:40 +00:00
|
|
|
MemoryViewBytesPerRow = 16;
|
2014-02-24 10:48:06 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::DebugOptions::LoadSave(SettingsWrapper& wrap)
|
2014-02-24 10:48:06 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore/Debugger");
|
2014-02-24 10:48:06 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(ShowDebuggerOnStart);
|
|
|
|
SettingsWrapBitBool(AlignMemoryWindowStart);
|
|
|
|
SettingsWrapBitfield(FontWidth);
|
|
|
|
SettingsWrapBitfield(FontHeight);
|
|
|
|
SettingsWrapBitfield(WindowWidth);
|
|
|
|
SettingsWrapBitfield(WindowHeight);
|
|
|
|
SettingsWrapBitfield(MemoryViewBytesPerRow);
|
2014-02-24 10:48:06 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:58 +00:00
|
|
|
Pcsx2Config::FilenameOptions::FilenameOptions()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::FilenameOptions::LoadSave(SettingsWrapper& wrap)
|
2021-09-16 10:14:42 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("Filenames");
|
2021-09-16 10:14:42 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
wrap.Entry(CURRENT_SETTINGS_SECTION, "BIOS", Bios, Bios);
|
2021-09-16 10:14:42 +00:00
|
|
|
}
|
2014-02-24 10:48:06 +00:00
|
|
|
|
2021-09-16 10:54:06 +00:00
|
|
|
void Pcsx2Config::FramerateOptions::SanityCheck()
|
|
|
|
{
|
|
|
|
// Ensure Conformation of various options...
|
|
|
|
|
2022-09-08 13:08:10 +00:00
|
|
|
NominalScalar = std::clamp(NominalScalar, 0.05f, 10.0f);
|
|
|
|
TurboScalar = std::clamp(TurboScalar, 0.05f, 10.0f);
|
|
|
|
SlomoScalar = std::clamp(SlomoScalar, 0.05f, 10.0f);
|
2021-09-16 10:54:06 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::FramerateOptions::LoadSave(SettingsWrapper& wrap)
|
2021-09-16 10:54:06 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("Framerate");
|
2021-09-16 10:54:06 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(NominalScalar);
|
|
|
|
SettingsWrapEntry(TurboScalar);
|
|
|
|
SettingsWrapEntry(SlomoScalar);
|
2021-09-16 10:54:06 +00:00
|
|
|
}
|
|
|
|
|
2022-12-04 15:00:06 +00:00
|
|
|
Pcsx2Config::USBOptions::USBOptions()
|
|
|
|
{
|
|
|
|
for (u32 i = 0; i < static_cast<u32>(Ports.size()); i++)
|
|
|
|
{
|
|
|
|
Ports[i].DeviceType = -1;
|
|
|
|
Ports[i].DeviceSubtype = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::USBOptions::LoadSave(SettingsWrapper& wrap)
|
|
|
|
{
|
|
|
|
for (u32 i = 0; i < static_cast<u32>(Ports.size()); i++)
|
|
|
|
{
|
2022-12-19 10:45:02 +00:00
|
|
|
const std::string section(USB::GetConfigSection(i));
|
2022-12-04 15:00:06 +00:00
|
|
|
|
|
|
|
std::string device = USB::DeviceTypeIndexToName(Ports[i].DeviceType);
|
|
|
|
wrap.Entry(section.c_str(), "Type", device, device);
|
|
|
|
|
|
|
|
if (wrap.IsLoading())
|
|
|
|
Ports[i].DeviceType = USB::DeviceTypeNameToIndex(device);
|
|
|
|
|
2022-12-19 10:45:02 +00:00
|
|
|
if (Ports[i].DeviceType >= 0)
|
|
|
|
{
|
|
|
|
const std::string subtype_key(fmt::format("{}_subtype", USB::DeviceTypeIndexToName(Ports[i].DeviceType)));
|
|
|
|
wrap.Entry(section.c_str(), subtype_key.c_str(), Ports[i].DeviceSubtype);
|
|
|
|
}
|
2022-12-04 15:00:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::USBOptions::Port::operator==(const USBOptions::Port& right) const
|
|
|
|
{
|
|
|
|
return OpEqu(DeviceType) && OpEqu(DeviceSubtype);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::USBOptions::Port::operator!=(const USBOptions::Port& right) const
|
|
|
|
{
|
|
|
|
return !this->operator==(right);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::USBOptions::operator==(const USBOptions& right) const
|
|
|
|
{
|
|
|
|
for (u32 i = 0; i < static_cast<u32>(Ports.size()); i++)
|
|
|
|
{
|
|
|
|
if (!OpEqu(Ports[i]))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Pcsx2Config::USBOptions::operator!=(const USBOptions& right) const
|
|
|
|
{
|
|
|
|
return !this->operator==(right);
|
|
|
|
}
|
|
|
|
|
2022-04-18 13:35:14 +00:00
|
|
|
#ifdef ENABLE_ACHIEVEMENTS
|
|
|
|
|
|
|
|
Pcsx2Config::AchievementsOptions::AchievementsOptions()
|
|
|
|
{
|
|
|
|
Enabled = false;
|
|
|
|
TestMode = false;
|
|
|
|
UnofficialTestMode = false;
|
|
|
|
RichPresence = true;
|
|
|
|
ChallengeMode = false;
|
|
|
|
Leaderboards = true;
|
2022-12-06 14:46:26 +00:00
|
|
|
Notifications = true;
|
2022-04-18 13:35:14 +00:00
|
|
|
SoundEffects = true;
|
2022-10-06 09:38:53 +00:00
|
|
|
PrimedIndicators = true;
|
2022-04-18 13:35:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Pcsx2Config::AchievementsOptions::LoadSave(SettingsWrapper& wrap)
|
|
|
|
{
|
|
|
|
SettingsWrapSection("Achievements");
|
|
|
|
|
|
|
|
SettingsWrapBitBool(Enabled);
|
|
|
|
SettingsWrapBitBool(TestMode);
|
|
|
|
SettingsWrapBitBool(UnofficialTestMode);
|
|
|
|
SettingsWrapBitBool(RichPresence);
|
|
|
|
SettingsWrapBitBool(ChallengeMode);
|
|
|
|
SettingsWrapBitBool(Leaderboards);
|
2022-12-06 14:46:26 +00:00
|
|
|
SettingsWrapBitBool(Notifications);
|
2022-04-18 13:35:14 +00:00
|
|
|
SettingsWrapBitBool(SoundEffects);
|
2022-10-06 09:38:53 +00:00
|
|
|
SettingsWrapBitBool(PrimedIndicators);
|
2022-04-18 13:35:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2009-12-03 15:51:39 +00:00
|
|
|
Pcsx2Config::Pcsx2Config()
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2009-12-03 15:51:39 +00:00
|
|
|
bitset = 0;
|
2010-09-26 17:31:23 +00:00
|
|
|
// Set defaults for fresh installs / reset settings
|
2010-05-26 23:06:31 +00:00
|
|
|
McdEnableEjection = true;
|
2015-05-25 12:39:35 +00:00
|
|
|
McdFolderAutoManage = true;
|
2010-09-26 17:31:23 +00:00
|
|
|
EnablePatches = true;
|
2023-06-13 12:43:11 +00:00
|
|
|
EnableFastBoot = true;
|
|
|
|
EnablePerGameSettings = true;
|
2022-04-04 00:06:59 +00:00
|
|
|
EnableRecordingTools = true;
|
2022-03-30 18:26:48 +00:00
|
|
|
EnableGameFixes = true;
|
2022-10-02 13:05:05 +00:00
|
|
|
InhibitScreensaver = true;
|
2011-08-30 06:33:05 +00:00
|
|
|
BackupSavestate = true;
|
2022-04-12 08:41:22 +00:00
|
|
|
SavestateZstdCompression = true;
|
2021-09-16 10:14:42 +00:00
|
|
|
|
2022-12-22 09:10:43 +00:00
|
|
|
#ifdef _WIN32
|
2021-09-17 08:42:39 +00:00
|
|
|
McdCompressNTFS = true;
|
|
|
|
#endif
|
|
|
|
|
2022-08-01 05:32:21 +00:00
|
|
|
WarnAboutUnsafeSettings = true;
|
|
|
|
|
2021-09-17 08:42:39 +00:00
|
|
|
// To be moved to FileMemoryCard pluign (someday)
|
|
|
|
for (uint slot = 0; slot < 8; ++slot)
|
|
|
|
{
|
|
|
|
Mcd[slot].Enabled = !FileMcd_IsMultitapSlot(slot); // enables main 2 slots
|
|
|
|
Mcd[slot].Filename = FileMcd_GetDefaultName(slot);
|
|
|
|
// Folder memory card is autodetected later.
|
2021-10-02 09:47:10 +00:00
|
|
|
Mcd[slot].Type = MemoryCardType::File;
|
2021-09-17 08:42:39 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 10:05:11 +00:00
|
|
|
GzipIsoIndexTemplate = "$(f).pindex.tmp";
|
2023-01-24 19:28:03 +00:00
|
|
|
PINESlot = 28011;
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::LoadSave(SettingsWrapper& wrap)
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2022-09-08 13:08:10 +00:00
|
|
|
// Switch the rounding mode back to the system default for loading settings.
|
|
|
|
// That way, we'll get exactly the same values as what we loaded when we first started.
|
|
|
|
const SSE_MXCSR prev_mxcsr(SSE_MXCSR::GetCurrent());
|
|
|
|
SSE_MXCSR::SetCurrent(SSE_MXCSR{SYSTEM_sseMXCSR});
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapSection("EmuCore");
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(CdvdVerboseReads);
|
|
|
|
SettingsWrapBitBool(CdvdDumpBlocks);
|
|
|
|
SettingsWrapBitBool(CdvdShareWrite);
|
|
|
|
SettingsWrapBitBool(EnablePatches);
|
|
|
|
SettingsWrapBitBool(EnableCheats);
|
2021-05-29 16:01:27 +00:00
|
|
|
SettingsWrapBitBool(EnablePINE);
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(EnableWideScreenPatches);
|
2022-05-01 05:47:00 +00:00
|
|
|
SettingsWrapBitBool(EnableNoInterlacingPatches);
|
2023-06-13 12:43:11 +00:00
|
|
|
SettingsWrapBitBool(EnableFastBoot);
|
|
|
|
SettingsWrapBitBool(EnableFastBootFastForward);
|
|
|
|
SettingsWrapBitBool(EnablePerGameSettings);
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(EnableRecordingTools);
|
2022-03-30 18:26:48 +00:00
|
|
|
SettingsWrapBitBool(EnableGameFixes);
|
2022-05-07 12:56:44 +00:00
|
|
|
SettingsWrapBitBool(SaveStateOnShutdown);
|
2022-10-01 12:28:48 +00:00
|
|
|
SettingsWrapBitBool(EnableDiscordPresence);
|
2022-10-02 13:05:05 +00:00
|
|
|
SettingsWrapBitBool(InhibitScreensaver);
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(ConsoleToStdio);
|
|
|
|
SettingsWrapBitBool(HostFs);
|
2009-11-12 12:51:00 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(BackupSavestate);
|
2022-04-12 08:41:22 +00:00
|
|
|
SettingsWrapBitBool(SavestateZstdCompression);
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapBitBool(McdEnableEjection);
|
|
|
|
SettingsWrapBitBool(McdFolderAutoManage);
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2022-08-01 05:32:21 +00:00
|
|
|
SettingsWrapBitBool(WarnAboutUnsafeSettings);
|
|
|
|
|
2009-09-12 02:58:22 +00:00
|
|
|
// Process various sub-components:
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
Speedhacks.LoadSave(wrap);
|
|
|
|
Cpu.LoadSave(wrap);
|
|
|
|
GS.LoadSave(wrap);
|
2021-12-18 14:23:43 +00:00
|
|
|
SPU2.LoadSave(wrap);
|
2022-02-07 23:38:50 +00:00
|
|
|
DEV9.LoadSave(wrap);
|
2021-09-22 07:38:30 +00:00
|
|
|
Gamefixes.LoadSave(wrap);
|
|
|
|
Profiler.LoadSave(wrap);
|
2009-09-12 02:58:22 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
Debugger.LoadSave(wrap);
|
|
|
|
Trace.LoadSave(wrap);
|
2022-12-04 15:00:06 +00:00
|
|
|
USB.LoadSave(wrap);
|
2009-11-11 11:36:13 +00:00
|
|
|
|
2022-04-18 13:35:14 +00:00
|
|
|
#ifdef ENABLE_ACHIEVEMENTS
|
|
|
|
Achievements.LoadSave(wrap);
|
|
|
|
#endif
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(GzipIsoIndexTemplate);
|
2023-01-24 19:28:03 +00:00
|
|
|
SettingsWrapEntry(PINESlot);
|
2021-09-17 08:25:52 +00:00
|
|
|
|
2021-09-16 10:14:42 +00:00
|
|
|
// For now, this in the derived config for backwards ini compatibility.
|
2022-05-24 12:22:15 +00:00
|
|
|
SettingsWrapEntryEx(CurrentBlockdump, "BlockDumpSaveDirectory");
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
BaseFilenames.LoadSave(wrap);
|
|
|
|
Framerate.LoadSave(wrap);
|
|
|
|
LoadSaveMemcards(wrap);
|
2021-09-17 08:42:39 +00:00
|
|
|
|
2022-12-22 09:10:43 +00:00
|
|
|
#ifdef _WIN32
|
2021-09-22 07:38:30 +00:00
|
|
|
SettingsWrapEntry(McdCompressNTFS);
|
2021-09-16 10:54:06 +00:00
|
|
|
#endif
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
if (wrap.IsLoading())
|
2021-09-16 10:54:06 +00:00
|
|
|
{
|
|
|
|
CurrentAspectRatio = GS.AspectRatio;
|
|
|
|
}
|
2022-09-08 13:08:10 +00:00
|
|
|
|
|
|
|
SSE_MXCSR::SetCurrent(prev_mxcsr);
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
void Pcsx2Config::LoadSaveMemcards(SettingsWrapper& wrap)
|
2021-09-17 08:42:39 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
for (uint slot = 0; slot < 2; ++slot)
|
2021-09-17 08:42:39 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
wrap.Entry("MemoryCards", StringUtil::StdStringFromFormat("Slot%u_Enable", slot + 1).c_str(),
|
|
|
|
Mcd[slot].Enabled, Mcd[slot].Enabled);
|
|
|
|
wrap.Entry("MemoryCards", StringUtil::StdStringFromFormat("Slot%u_Filename", slot + 1).c_str(),
|
|
|
|
Mcd[slot].Filename, Mcd[slot].Filename);
|
2021-09-17 08:42:39 +00:00
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
for (uint slot = 2; slot < 8; ++slot)
|
2021-09-17 08:42:39 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
int mtport = FileMcd_GetMtapPort(slot) + 1;
|
|
|
|
int mtslot = FileMcd_GetMtapSlot(slot) + 1;
|
2021-09-17 08:42:39 +00:00
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
wrap.Entry("MemoryCards", StringUtil::StdStringFromFormat("Multitap%u_Slot%u_Enable", mtport, mtslot).c_str(),
|
|
|
|
Mcd[slot].Enabled, Mcd[slot].Enabled);
|
|
|
|
wrap.Entry("MemoryCards", StringUtil::StdStringFromFormat("Multitap%u_Slot%u_Filename", mtport, mtslot).c_str(),
|
|
|
|
Mcd[slot].Filename, Mcd[slot].Filename);
|
2021-09-17 08:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-22 07:38:30 +00:00
|
|
|
bool Pcsx2Config::MultitapEnabled(uint port) const
|
2009-09-12 02:58:22 +00:00
|
|
|
{
|
2021-09-22 07:38:30 +00:00
|
|
|
pxAssert(port < 2);
|
|
|
|
return (port == 0) ? MultitapPort0_Enabled : MultitapPort1_Enabled;
|
2009-09-12 02:58:22 +00:00
|
|
|
}
|
2021-09-16 10:14:42 +00:00
|
|
|
|
2021-09-25 04:35:21 +00:00
|
|
|
std::string Pcsx2Config::FullpathToBios() const
|
2021-09-16 10:14:42 +00:00
|
|
|
{
|
2021-10-06 07:47:46 +00:00
|
|
|
std::string ret;
|
|
|
|
if (!BaseFilenames.Bios.empty())
|
2022-05-19 14:46:33 +00:00
|
|
|
ret = Path::Combine(EmuFolders::Bios, BaseFilenames.Bios);
|
2021-10-06 07:47:46 +00:00
|
|
|
return ret;
|
2021-09-16 10:14:42 +00:00
|
|
|
}
|
|
|
|
|
2022-05-19 14:46:33 +00:00
|
|
|
std::string Pcsx2Config::FullpathToMcd(uint slot) const
|
2021-09-17 08:42:39 +00:00
|
|
|
{
|
2022-05-19 14:46:33 +00:00
|
|
|
return Path::Combine(EmuFolders::MemoryCards, Mcd[slot].Filename);
|
2021-09-17 08:42:39 +00:00
|
|
|
}
|
|
|
|
|
2021-10-05 01:58:34 +00:00
|
|
|
bool Pcsx2Config::operator==(const Pcsx2Config& right) const
|
|
|
|
{
|
|
|
|
bool equal =
|
|
|
|
OpEqu(bitset) &&
|
|
|
|
OpEqu(Cpu) &&
|
|
|
|
OpEqu(GS) &&
|
2022-02-07 23:38:50 +00:00
|
|
|
OpEqu(DEV9) &&
|
2021-10-05 01:58:34 +00:00
|
|
|
OpEqu(Speedhacks) &&
|
|
|
|
OpEqu(Gamefixes) &&
|
|
|
|
OpEqu(Profiler) &&
|
|
|
|
OpEqu(Debugger) &&
|
|
|
|
OpEqu(Framerate) &&
|
|
|
|
OpEqu(Trace) &&
|
|
|
|
OpEqu(BaseFilenames) &&
|
2023-01-24 19:28:03 +00:00
|
|
|
OpEqu(GzipIsoIndexTemplate) &&
|
|
|
|
OpEqu(PINESlot);
|
2021-10-05 01:58:34 +00:00
|
|
|
for (u32 i = 0; i < sizeof(Mcd) / sizeof(Mcd[0]); i++)
|
|
|
|
{
|
|
|
|
equal &= OpEqu(Mcd[i].Enabled);
|
|
|
|
equal &= OpEqu(Mcd[i].Filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
return equal;
|
|
|
|
}
|
|
|
|
|
2022-09-12 14:56:26 +00:00
|
|
|
void Pcsx2Config::CopyRuntimeConfig(Pcsx2Config& cfg)
|
|
|
|
{
|
|
|
|
GS.LimitScalar = cfg.GS.LimitScalar;
|
|
|
|
CurrentBlockdump = std::move(cfg.CurrentBlockdump);
|
|
|
|
CurrentIRX = std::move(cfg.CurrentIRX);
|
|
|
|
CurrentGameArgs = std::move(cfg.CurrentGameArgs);
|
|
|
|
CurrentAspectRatio = cfg.CurrentAspectRatio;
|
|
|
|
LimiterMode = cfg.LimiterMode;
|
2022-09-18 11:38:34 +00:00
|
|
|
|
|
|
|
for (u32 i = 0; i < sizeof(Mcd) / sizeof(Mcd[0]); i++)
|
|
|
|
{
|
|
|
|
Mcd[i].Type = cfg.Mcd[i].Type;
|
|
|
|
}
|
2022-09-12 14:56:26 +00:00
|
|
|
}
|
|
|
|
|
2023-05-13 10:22:46 +00:00
|
|
|
bool EmuFolders::InitializeCriticalFolders()
|
|
|
|
{
|
|
|
|
SetAppRoot();
|
|
|
|
SetResourcesDirectory();
|
|
|
|
SetDataDirectory();
|
|
|
|
|
|
|
|
// logging of directories in case something goes wrong super early
|
|
|
|
Console.WriteLn("AppRoot Directory: %s", AppRoot.c_str());
|
|
|
|
Console.WriteLn("DataRoot Directory: %s", DataRoot.c_str());
|
|
|
|
Console.WriteLn("Resources Directory: %s", Resources.c_str());
|
|
|
|
|
|
|
|
// allow SetDataDirectory() to change settings directory (if we want to split config later on)
|
|
|
|
if (Settings.empty())
|
|
|
|
{
|
|
|
|
Settings = Path::Combine(DataRoot, "inis");
|
|
|
|
|
|
|
|
// Create settings directory if it doesn't exist. If we're not using portable mode, it won't.
|
|
|
|
if (!FileSystem::DirectoryExists(Settings.c_str()))
|
|
|
|
FileSystem::CreateDirectoryPath(Settings.c_str(), false);
|
|
|
|
}
|
|
|
|
|
|
|
|
// the resources directory should exist, bail out if not
|
|
|
|
if (!FileSystem::DirectoryExists(Resources.c_str()))
|
|
|
|
{
|
|
|
|
Console.Error("Resources directory is missing.");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EmuFolders::SetAppRoot()
|
|
|
|
{
|
|
|
|
std::string program_path(FileSystem::GetProgramPath());
|
|
|
|
Console.WriteLn("Program Path: %s", program_path.c_str());
|
|
|
|
|
|
|
|
AppRoot = Path::Canonicalize(Path::GetDirectory(program_path));
|
|
|
|
}
|
|
|
|
|
|
|
|
void EmuFolders::SetResourcesDirectory()
|
|
|
|
{
|
|
|
|
#ifndef __APPLE__
|
|
|
|
// On Windows/Linux, these are in the binary directory.
|
|
|
|
Resources = Path::Combine(AppRoot, "resources");
|
|
|
|
#else
|
|
|
|
// On macOS, this is in the bundle resources directory.
|
|
|
|
Resources = Path::Canonicalize(Path::Combine(AppRoot, "../Resources"));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EmuFolders::ShouldUsePortableMode()
|
|
|
|
{
|
|
|
|
// Check whether portable.ini exists in the program directory.
|
|
|
|
return FileSystem::FileExists(Path::Combine(AppRoot, "portable.ini").c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
void EmuFolders::SetDataDirectory()
|
|
|
|
{
|
|
|
|
if (ShouldUsePortableMode())
|
|
|
|
{
|
|
|
|
DataRoot = AppRoot;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
|
|
|
// On Windows, use My Documents\PCSX2 to match old installs.
|
|
|
|
PWSTR documents_directory;
|
|
|
|
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Documents, 0, NULL, &documents_directory)))
|
|
|
|
{
|
|
|
|
if (std::wcslen(documents_directory) > 0)
|
|
|
|
DataRoot = Path::Combine(StringUtil::WideStringToUTF8String(documents_directory), "PCSX2");
|
|
|
|
CoTaskMemFree(documents_directory);
|
|
|
|
}
|
|
|
|
#elif defined(__linux__) || defined(__FreeBSD__)
|
|
|
|
// Use $XDG_CONFIG_HOME/PCSX2 if it exists.
|
|
|
|
const char* xdg_config_home = getenv("XDG_CONFIG_HOME");
|
|
|
|
if (xdg_config_home && Path::IsAbsolute(xdg_config_home))
|
|
|
|
{
|
|
|
|
DataRoot = Path::Combine(xdg_config_home, "PCSX2");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Use ~/PCSX2 for non-XDG, and ~/.config/PCSX2 for XDG.
|
|
|
|
// Maybe we should drop the former when Qt goes live.
|
|
|
|
const char* home_dir = getenv("HOME");
|
|
|
|
if (home_dir)
|
|
|
|
{
|
|
|
|
#ifdef USE_LEGACY_USER_DIRECTORY
|
|
|
|
DataRoot = Path::Combine(home_dir, "PCSX2");
|
|
|
|
#else
|
|
|
|
// ~/.config should exist, but just in case it doesn't and this is a fresh profile..
|
|
|
|
const std::string config_dir(Path::Combine(home_dir, ".config"));
|
|
|
|
if (!FileSystem::DirectoryExists(config_dir.c_str()))
|
|
|
|
FileSystem::CreateDirectoryPath(config_dir.c_str(), false);
|
|
|
|
|
|
|
|
DataRoot = Path::Combine(config_dir, "PCSX2");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
static constexpr char MAC_DATA_DIR[] = "Library/Application Support/PCSX2";
|
|
|
|
const char* home_dir = getenv("HOME");
|
|
|
|
if (home_dir)
|
|
|
|
DataRoot = Path::Combine(home_dir, MAC_DATA_DIR);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// make sure it exists
|
|
|
|
if (!DataRoot.empty() && !FileSystem::DirectoryExists(DataRoot.c_str()))
|
|
|
|
{
|
|
|
|
// we're in trouble if we fail to create this directory... but try to hobble on with portable
|
|
|
|
if (!FileSystem::CreateDirectoryPath(DataRoot.c_str(), false))
|
|
|
|
DataRoot.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// couldn't determine the data directory? fallback to portable.
|
|
|
|
if (DataRoot.empty())
|
|
|
|
DataRoot = AppRoot;
|
|
|
|
}
|
|
|
|
|
2022-09-07 07:44:10 +00:00
|
|
|
void EmuFolders::SetDefaults(SettingsInterface& si)
|
2021-12-18 15:08:12 +00:00
|
|
|
{
|
2022-09-07 07:44:10 +00:00
|
|
|
si.SetStringValue("Folders", "Bios", "bios");
|
|
|
|
si.SetStringValue("Folders", "Snapshots", "snaps");
|
|
|
|
si.SetStringValue("Folders", "Savestates", "sstates");
|
|
|
|
si.SetStringValue("Folders", "MemoryCards", "memcards");
|
|
|
|
si.SetStringValue("Folders", "Logs", "logs");
|
|
|
|
si.SetStringValue("Folders", "Cheats", "cheats");
|
2023-05-25 16:24:01 +00:00
|
|
|
si.SetStringValue("Folders", "Patches", "patches");
|
2022-09-07 07:44:10 +00:00
|
|
|
si.SetStringValue("Folders", "Cache", "cache");
|
|
|
|
si.SetStringValue("Folders", "Textures", "textures");
|
|
|
|
si.SetStringValue("Folders", "InputProfiles", "inputprofiles");
|
2023-01-12 09:30:39 +00:00
|
|
|
si.SetStringValue("Folders", "Videos", "videos");
|
2021-12-18 15:08:12 +00:00
|
|
|
}
|
|
|
|
|
2022-05-19 14:46:33 +00:00
|
|
|
static std::string LoadPathFromSettings(SettingsInterface& si, const std::string& root, const char* name, const char* def)
|
2021-12-18 15:08:12 +00:00
|
|
|
{
|
|
|
|
std::string value = si.GetStringValue("Folders", name, def);
|
2022-05-19 14:46:33 +00:00
|
|
|
if (!Path::IsAbsolute(value))
|
|
|
|
value = Path::Combine(root, value);
|
|
|
|
return value;
|
2021-12-18 15:08:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EmuFolders::LoadConfig(SettingsInterface& si)
|
|
|
|
{
|
|
|
|
Bios = LoadPathFromSettings(si, DataRoot, "Bios", "bios");
|
|
|
|
Snapshots = LoadPathFromSettings(si, DataRoot, "Snapshots", "snaps");
|
|
|
|
Savestates = LoadPathFromSettings(si, DataRoot, "Savestates", "sstates");
|
|
|
|
MemoryCards = LoadPathFromSettings(si, DataRoot, "MemoryCards", "memcards");
|
|
|
|
Logs = LoadPathFromSettings(si, DataRoot, "Logs", "logs");
|
|
|
|
Cheats = LoadPathFromSettings(si, DataRoot, "Cheats", "cheats");
|
2023-05-25 16:24:01 +00:00
|
|
|
Patches = LoadPathFromSettings(si, DataRoot, "Patches", "patches");
|
2021-12-18 15:08:12 +00:00
|
|
|
Covers = LoadPathFromSettings(si, DataRoot, "Covers", "covers");
|
|
|
|
GameSettings = LoadPathFromSettings(si, DataRoot, "GameSettings", "gamesettings");
|
|
|
|
Cache = LoadPathFromSettings(si, DataRoot, "Cache", "cache");
|
2022-02-19 14:20:18 +00:00
|
|
|
Textures = LoadPathFromSettings(si, DataRoot, "Textures", "textures");
|
2022-04-02 12:17:26 +00:00
|
|
|
InputProfiles = LoadPathFromSettings(si, DataRoot, "InputProfiles", "inputprofiles");
|
2023-01-12 09:30:39 +00:00
|
|
|
Videos = LoadPathFromSettings(si, DataRoot, "Videos", "videos");
|
2021-12-18 15:08:12 +00:00
|
|
|
|
2022-05-19 14:46:33 +00:00
|
|
|
Console.WriteLn("BIOS Directory: %s", Bios.c_str());
|
|
|
|
Console.WriteLn("Snapshots Directory: %s", Snapshots.c_str());
|
|
|
|
Console.WriteLn("Savestates Directory: %s", Savestates.c_str());
|
|
|
|
Console.WriteLn("MemoryCards Directory: %s", MemoryCards.c_str());
|
|
|
|
Console.WriteLn("Logs Directory: %s", Logs.c_str());
|
|
|
|
Console.WriteLn("Cheats Directory: %s", Cheats.c_str());
|
2023-05-25 16:24:01 +00:00
|
|
|
Console.WriteLn("Patches Directory: %s", Patches.c_str());
|
2022-05-19 14:46:33 +00:00
|
|
|
Console.WriteLn("Covers Directory: %s", Covers.c_str());
|
|
|
|
Console.WriteLn("Game Settings Directory: %s", GameSettings.c_str());
|
|
|
|
Console.WriteLn("Cache Directory: %s", Cache.c_str());
|
|
|
|
Console.WriteLn("Textures Directory: %s", Textures.c_str());
|
2022-04-02 12:17:26 +00:00
|
|
|
Console.WriteLn("Input Profile Directory: %s", InputProfiles.c_str());
|
2023-01-12 09:30:39 +00:00
|
|
|
Console.WriteLn("Video Dumping Directory: %s", Videos.c_str());
|
2021-12-18 15:08:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool EmuFolders::EnsureFoldersExist()
|
|
|
|
{
|
2022-05-19 14:46:33 +00:00
|
|
|
bool result = FileSystem::CreateDirectoryPath(Bios.c_str(), false);
|
|
|
|
result = FileSystem::CreateDirectoryPath(Settings.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(Snapshots.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(Savestates.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(MemoryCards.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(Logs.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(Cheats.c_str(), false) && result;
|
2023-05-25 16:24:01 +00:00
|
|
|
result = FileSystem::CreateDirectoryPath(Patches.c_str(), false) && result;
|
2022-05-19 14:46:33 +00:00
|
|
|
result = FileSystem::CreateDirectoryPath(Covers.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(GameSettings.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(Cache.c_str(), false) && result;
|
|
|
|
result = FileSystem::CreateDirectoryPath(Textures.c_str(), false) && result;
|
2022-04-02 12:17:26 +00:00
|
|
|
result = FileSystem::CreateDirectoryPath(InputProfiles.c_str(), false) && result;
|
2023-01-12 09:30:39 +00:00
|
|
|
result = FileSystem::CreateDirectoryPath(Videos.c_str(), false) && result;
|
2021-12-18 15:08:12 +00:00
|
|
|
return result;
|
|
|
|
}
|
2022-12-30 05:35:16 +00:00
|
|
|
|
|
|
|
std::FILE* EmuFolders::OpenLogFile(const std::string_view& name, const char* mode)
|
|
|
|
{
|
|
|
|
if (name.empty())
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
const std::string path(Path::Combine(Logs, name));
|
|
|
|
return FileSystem::OpenCFile(path.c_str(), mode);
|
|
|
|
}
|