summaryrefslogtreecommitdiff
path: root/src/yuzu_tester/config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu_tester/config.cpp')
-rw-r--r--src/yuzu_tester/config.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/yuzu_tester/config.cpp b/src/yuzu_tester/config.cpp
index acb22885e..bc273fb51 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
18namespace FS = Common::FS;
19
18Config::Config() { 20Config::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);
@@ -74,6 +75,8 @@ void Config::ReadValues() {
74 Settings::values.debug_pad_analogs[i] = ""; 75 Settings::values.debug_pad_analogs[i] = "";
75 } 76 }
76 77
78 Settings::values.vibration_enabled = true;
79 Settings::values.motion_enabled = true;
77 Settings::values.touchscreen.enabled = ""; 80 Settings::values.touchscreen.enabled = "";
78 Settings::values.touchscreen.device = ""; 81 Settings::values.touchscreen.device = "";
79 Settings::values.touchscreen.finger = 0; 82 Settings::values.touchscreen.finger = 0;
@@ -87,12 +90,12 @@ void Config::ReadValues() {
87 // Data Storage 90 // Data Storage
88 Settings::values.use_virtual_sd = 91 Settings::values.use_virtual_sd =
89 sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); 92 sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
90 FileUtil::GetUserPath(FileUtil::UserPath::NANDDir, 93 FS::GetUserPath(Common::FS::UserPath::NANDDir,
91 sdl2_config->Get("Data Storage", "nand_directory", 94 sdl2_config->Get("Data Storage", "nand_directory",
92 FileUtil::GetUserPath(FileUtil::UserPath::NANDDir))); 95 Common::FS::GetUserPath(Common::FS::UserPath::NANDDir)));
93 FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir, 96 FS::GetUserPath(Common::FS::UserPath::SDMCDir,
94 sdl2_config->Get("Data Storage", "sdmc_directory", 97 sdl2_config->Get("Data Storage", "sdmc_directory",
95 FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))); 98 Common::FS::GetUserPath(Common::FS::UserPath::SDMCDir)));
96 99
97 // System 100 // System
98 Settings::values.current_user = std::clamp<int>( 101 Settings::values.current_user = std::clamp<int>(