Skip to content

Commit

Permalink
Merge pull request FEX-Emu#878 from Sonicadvance1/fexconfig_actual_de…
Browse files Browse the repository at this point in the history
…fault

Changes FEXConfig to actually load default configuration
  • Loading branch information
skmp authored Mar 22, 2021
2 parents fbc49c1 + 0c48f14 commit 82c2b49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
2 changes: 2 additions & 0 deletions External/FEXCore/include/FEXCore/Config/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ namespace DefaultValues {
#define P(x) x
#define OPT_BASE(type, group, enum, json, env, default) constexpr P(type) P(enum) = P(default);
#define OPT_STR(group, enum, json, env, default) const std::string P(enum) = P(default);
#define OPT_STRARRAY(group, enum, json, env, default) OPT_STR(group, enum, json, env, default)
#include <FEXCore/Config/ConfigValues.inl>

namespace Type {
#define OPT_BASE(type, group, enum, json, env, default) using P(enum) = P(type);
#define OPT_STR(group, enum, json, env, default) using P(enum) = std::string;
#define OPT_STRARRAY(group, enum, json, env, default) OPT_STR(group, enum, json, env, default)
#include <FEXCore/Config/ConfigValues.inl>
}
#define FEX_CONFIG_OPT(name, enum) \
Expand Down
2 changes: 1 addition & 1 deletion External/FEXCore/include/FEXCore/Config/ConfigValues.inl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ OPT_STR (EMULATION, THUNKHOSTLIBSPATH, ThunkHostLibs, THUNKHOSTLIBS, "")
OPT_STR (EMULATION, THUNKGUESTLIBSPATH, ThunkGuestLibs, THUNKGUESTLIBS, "")
OPT_STR (EMULATION, THUNKCONFIGPATH, ThunkConfig, THUNKCONFIG, "")

OPT_STR (EMULATION, ENVIRONMENT, Env, ENV, "")
OPT_STRARRAY (EMULATION, ENVIRONMENT, Env, ENV, "")

OPT_BOOL (DEBUG, SINGLESTEP, SingleStep, SINGLESTEP, false)
OPT_BOOL (DEBUG, GDBSERVER, GdbServer, GDBSERVER, false)
Expand Down
27 changes: 6 additions & 21 deletions Source/Tools/FEXConfig/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,12 @@ namespace {
ConfigOpen = true;
ConfigFilename = {};
LoadedConfig = std::make_unique<FEX::Config::EmptyMapper>();
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_DEFAULTCORE, "1");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_MAXBLOCKINST, "5000");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_SINGLESTEP, "0");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_MULTIBLOCK, "1");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_GDBSERVER, "0");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_EMULATED_CPU_CORES, "1");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_ROOTFSPATH, "");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_THUNKHOSTLIBSPATH, "");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_THUNKGUESTLIBSPATH, "");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_THUNKCONFIGPATH, "");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_SILENTLOGS, "0");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_ENVIRONMENT, "GALLIUM_THREAD=1");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_ENVIRONMENT, "GALLIUM_HUD=fps");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_ENVIRONMENT, "TERM=xterm");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_OUTPUTLOG, "");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_DUMPIR, "no"),
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_TSO_ENABLED, "1");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_SMC_CHECKS, "0");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_ABI_LOCAL_FLAGS, "0");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_ABI_NO_PF, "0");
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_DEBUG_DISABLE_OPTIMIZATION_PASSES, "0");
#define OPT_BASE(type, group, enum, json, env, default) \
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_##enum, std::to_string(default));
#define OPT_STR(group, enum, json, env, default) \
LoadedConfig->Set(FEXCore::Config::ConfigOption::CONFIG_##enum, default);
#define OPT_STRARRAY(group, enum, json, env, default) // Do nothing
#include <FEXCore/Config/ConfigValues.inl>
}

void SaveFile(std::string Filename) {
Expand Down

0 comments on commit 82c2b49

Please sign in to comment.