diff --git a/src/config.cpp b/src/config.cpp index bfe84193e..9b2627444 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -27,6 +27,7 @@ void EmulatorConfig::load() { return; } + printf("Loading existing configuration file %s\n", path.string().c_str()); toml::value data; try { diff --git a/src/emulator.cpp b/src/emulator.cpp index 86adbf223..81a18f307 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -105,7 +105,13 @@ std::filesystem::path Emulator::getConfigPath() { if constexpr (Helpers::isAndroid()) { return getAndroidAppPath() / "config.toml"; } else { - return std::filesystem::current_path() / "config.toml"; + std::filesystem::path localPath = std::filesystem::current_path() / "config.toml"; + + if (std::filesystem::exists(localPath)) { + return localPath; + } else { + return getAppDataRoot() / "config.toml"; + } } } #endif @@ -468,4 +474,4 @@ void Emulator::reloadSettings() { } } #endif -} \ No newline at end of file +}