User Data Migration from Citron, Sudachi, and Yuzu (#91)

Includes citron, sudachi, yuzu

currently broken, because the eden dir is always made early?

Signed-off-by: swurl <swurl@swurl.xyz>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/91
Co-authored-by: swurl <swurl@swurl.xyz>
Co-committed-by: swurl <swurl@swurl.xyz>
This commit is contained in:
swurl 2025-05-08 22:16:07 +00:00 committed by crueter
parent d659d6f5b4
commit f786802b9b
62 changed files with 703 additions and 384 deletions

View file

@ -25,7 +25,7 @@ Config::Config(const ConfigType config_type)
: type(config_type), global{config_type == ConfigType::GlobalConfig} {}
void Config::Initialize(const std::string& config_name) {
const std::filesystem::path fs_config_loc = FS::GetYuzuPath(FS::YuzuPath::ConfigDir);
const std::filesystem::path fs_config_loc = FS::GetEdenPath(FS::EdenPath::ConfigDir);
const auto config_file = fmt::format("{}.ini", config_name);
switch (type) {
@ -51,7 +51,7 @@ void Config::Initialize(const std::string& config_name) {
void Config::Initialize(const std::optional<std::string> config_path) {
const std::filesystem::path default_sdl_config_path =
FS::GetYuzuPath(FS::YuzuPath::ConfigDir) / "sdl2-config.ini";
FS::GetEdenPath(FS::EdenPath::ConfigDir) / "sdl2-config.ini";
config_loc = config_path.value_or(FS::PathToUTF8String(default_sdl_config_path));
void(FS::CreateParentDir(config_loc));
SetUpIni();
@ -275,11 +275,11 @@ void Config::ReadCoreValues() {
void Config::ReadDataStorageValues() {
BeginGroup(Settings::TranslateCategory(Settings::Category::DataStorage));
FS::SetYuzuPath(FS::YuzuPath::NANDDir, ReadStringSetting(std::string("nand_directory")));
FS::SetYuzuPath(FS::YuzuPath::SDMCDir, ReadStringSetting(std::string("sdmc_directory")));
FS::SetYuzuPath(FS::YuzuPath::LoadDir, ReadStringSetting(std::string("load_directory")));
FS::SetYuzuPath(FS::YuzuPath::DumpDir, ReadStringSetting(std::string("dump_directory")));
FS::SetYuzuPath(FS::YuzuPath::TASDir, ReadStringSetting(std::string("tas_directory")));
FS::SetEdenPath(FS::EdenPath::NANDDir, ReadStringSetting(std::string("nand_directory")));
FS::SetEdenPath(FS::EdenPath::SDMCDir, ReadStringSetting(std::string("sdmc_directory")));
FS::SetEdenPath(FS::EdenPath::LoadDir, ReadStringSetting(std::string("load_directory")));
FS::SetEdenPath(FS::EdenPath::DumpDir, ReadStringSetting(std::string("dump_directory")));
FS::SetEdenPath(FS::EdenPath::TASDir, ReadStringSetting(std::string("tas_directory")));
ReadCategory(Settings::Category::DataStorage);
@ -372,7 +372,7 @@ void Config::ReadScreenshotValues() {
BeginGroup(Settings::TranslateCategory(Settings::Category::Screenshots));
ReadCategory(Settings::Category::Screenshots);
FS::SetYuzuPath(FS::YuzuPath::ScreenshotsDir,
FS::SetEdenPath(FS::EdenPath::ScreenshotsDir,
ReadStringSetting(std::string("screenshot_path")));
EndGroup();
@ -578,16 +578,16 @@ void Config::SaveCoreValues() {
void Config::SaveDataStorageValues() {
BeginGroup(Settings::TranslateCategory(Settings::Category::DataStorage));
WriteStringSetting(std::string("nand_directory"), FS::GetYuzuPathString(FS::YuzuPath::NANDDir),
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::NANDDir)));
WriteStringSetting(std::string("sdmc_directory"), FS::GetYuzuPathString(FS::YuzuPath::SDMCDir),
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::SDMCDir)));
WriteStringSetting(std::string("load_directory"), FS::GetYuzuPathString(FS::YuzuPath::LoadDir),
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::LoadDir)));
WriteStringSetting(std::string("dump_directory"), FS::GetYuzuPathString(FS::YuzuPath::DumpDir),
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::DumpDir)));
WriteStringSetting(std::string("tas_directory"), FS::GetYuzuPathString(FS::YuzuPath::TASDir),
std::make_optional(FS::GetYuzuPathString(FS::YuzuPath::TASDir)));
WriteStringSetting(std::string("nand_directory"), FS::GetEdenPathString(FS::EdenPath::NANDDir),
std::make_optional(FS::GetEdenPathString(FS::EdenPath::NANDDir)));
WriteStringSetting(std::string("sdmc_directory"), FS::GetEdenPathString(FS::EdenPath::SDMCDir),
std::make_optional(FS::GetEdenPathString(FS::EdenPath::SDMCDir)));
WriteStringSetting(std::string("load_directory"), FS::GetEdenPathString(FS::EdenPath::LoadDir),
std::make_optional(FS::GetEdenPathString(FS::EdenPath::LoadDir)));
WriteStringSetting(std::string("dump_directory"), FS::GetEdenPathString(FS::EdenPath::DumpDir),
std::make_optional(FS::GetEdenPathString(FS::EdenPath::DumpDir)));
WriteStringSetting(std::string("tas_directory"), FS::GetEdenPathString(FS::EdenPath::TASDir),
std::make_optional(FS::GetEdenPathString(FS::EdenPath::TASDir)));
WriteCategory(Settings::Category::DataStorage);
@ -681,7 +681,7 @@ void Config::SaveScreenshotValues() {
BeginGroup(Settings::TranslateCategory(Settings::Category::Screenshots));
WriteStringSetting(std::string("screenshot_path"),
FS::GetYuzuPathString(FS::YuzuPath::ScreenshotsDir));
FS::GetEdenPathString(FS::EdenPath::ScreenshotsDir));
WriteCategory(Settings::Category::Screenshots);
EndGroup();