diff options
Diffstat (limited to 'src/yuzu_tester')
| -rw-r--r-- | src/yuzu_tester/config.cpp | 21 | ||||
| -rw-r--r-- | src/yuzu_tester/yuzu.cpp | 7 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/yuzu_tester/config.cpp b/src/yuzu_tester/config.cpp index acb22885e..74022af23 100644 --- a/src/yuzu_tester/config.cpp +++ b/src/yuzu_tester/config.cpp | |||
| @@ -15,10 +15,11 @@ | |||
| 15 | #include "yuzu_tester/config.h" | 15 | #include "yuzu_tester/config.h" |
| 16 | #include "yuzu_tester/default_ini.h" | 16 | #include "yuzu_tester/default_ini.h" |
| 17 | 17 | ||
| 18 | namespace FS = Common::FS; | ||
| 19 | |||
| 18 | Config::Config() { | 20 | Config::Config() { |
| 19 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 21 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| 20 | sdl2_config_loc = | 22 | sdl2_config_loc = FS::GetUserPath(FS::UserPath::ConfigDir) + "sdl2-tester-config.ini"; |
| 21 | FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "sdl2-tester-config.ini"; | ||
| 22 | sdl2_config = std::make_unique<INIReader>(sdl2_config_loc); | 23 | sdl2_config = std::make_unique<INIReader>(sdl2_config_loc); |
| 23 | 24 | ||
| 24 | Reload(); | 25 | Reload(); |
| @@ -31,8 +32,8 @@ bool Config::LoadINI(const std::string& default_contents, bool retry) { | |||
| 31 | if (sdl2_config->ParseError() < 0) { | 32 | if (sdl2_config->ParseError() < 0) { |
| 32 | if (retry) { | 33 | if (retry) { |
| 33 | LOG_WARNING(Config, "Failed to load {}. Creating file from defaults...", location); | 34 | LOG_WARNING(Config, "Failed to load {}. Creating file from defaults...", location); |
| 34 | FileUtil::CreateFullPath(location); | 35 | FS::CreateFullPath(location); |
| 35 | FileUtil::WriteStringToFile(true, default_contents, location); | 36 | FS::WriteStringToFile(true, default_contents, location); |
| 36 | sdl2_config = std::make_unique<INIReader>(location); // Reopen file | 37 | sdl2_config = std::make_unique<INIReader>(location); // Reopen file |
| 37 | 38 | ||
| 38 | return LoadINI(default_contents, false); | 39 | return LoadINI(default_contents, false); |
| @@ -87,12 +88,12 @@ void Config::ReadValues() { | |||
| 87 | // Data Storage | 88 | // Data Storage |
| 88 | Settings::values.use_virtual_sd = | 89 | Settings::values.use_virtual_sd = |
| 89 | sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); | 90 | sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); |
| 90 | FileUtil::GetUserPath(FileUtil::UserPath::NANDDir, | 91 | FS::GetUserPath(Common::FS::UserPath::NANDDir, |
| 91 | sdl2_config->Get("Data Storage", "nand_directory", | 92 | sdl2_config->Get("Data Storage", "nand_directory", |
| 92 | FileUtil::GetUserPath(FileUtil::UserPath::NANDDir))); | 93 | Common::FS::GetUserPath(Common::FS::UserPath::NANDDir))); |
| 93 | FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir, | 94 | FS::GetUserPath(Common::FS::UserPath::SDMCDir, |
| 94 | sdl2_config->Get("Data Storage", "sdmc_directory", | 95 | sdl2_config->Get("Data Storage", "sdmc_directory", |
| 95 | FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))); | 96 | Common::FS::GetUserPath(Common::FS::UserPath::SDMCDir))); |
| 96 | 97 | ||
| 97 | // System | 98 | // System |
| 98 | Settings::values.current_user = std::clamp<int>( | 99 | Settings::values.current_user = std::clamp<int>( |
diff --git a/src/yuzu_tester/yuzu.cpp b/src/yuzu_tester/yuzu.cpp index 083667baf..7acf0caad 100644 --- a/src/yuzu_tester/yuzu.cpp +++ b/src/yuzu_tester/yuzu.cpp | |||
| @@ -79,8 +79,8 @@ static void InitializeLogging(bool console) { | |||
| 79 | if (console) | 79 | if (console) |
| 80 | Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); | 80 | Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); |
| 81 | 81 | ||
| 82 | const std::string& log_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir); | 82 | const std::string& log_dir = Common::FS::GetUserPath(Common::FS::UserPath::LogDir); |
| 83 | FileUtil::CreateFullPath(log_dir); | 83 | Common::FS::CreateFullPath(log_dir); |
| 84 | Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE)); | 84 | Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE)); |
| 85 | #ifdef _WIN32 | 85 | #ifdef _WIN32 |
| 86 | Log::AddBackend(std::make_unique<Log::DebuggerBackend>()); | 86 | Log::AddBackend(std::make_unique<Log::DebuggerBackend>()); |
| @@ -251,7 +251,8 @@ int main(int argc, char** argv) { | |||
| 251 | 251 | ||
| 252 | Service::Yuzu::InstallInterfaces(system.ServiceManager(), datastring, callback); | 252 | Service::Yuzu::InstallInterfaces(system.ServiceManager(), datastring, callback); |
| 253 | 253 | ||
| 254 | system.TelemetrySession().AddField(Telemetry::FieldType::App, "Frontend", "SDLHideTester"); | 254 | system.TelemetrySession().AddField(Common::Telemetry::FieldType::App, "Frontend", |
| 255 | "SDLHideTester"); | ||
| 255 | 256 | ||
| 256 | system.GPU().Start(); | 257 | system.GPU().Start(); |
| 257 | system.Renderer().Rasterizer().LoadDiskResources(); | 258 | system.Renderer().Rasterizer().LoadDiskResources(); |