From b66cc1caf65b3642ef4df8ab23df77897e95e4e0 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 17 Apr 2022 04:10:36 +0200 Subject: [PATCH] Config and UICommon: Add config option and user path for Wii SD card sync folder. --- Source/Core/Common/CommonPaths.h | 1 + Source/Core/Common/FileUtil.cpp | 1 + Source/Core/Common/FileUtil.h | 1 + Source/Core/Core/Config/MainSettings.cpp | 4 ++++ Source/Core/Core/Config/MainSettings.h | 2 ++ Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp | 1 + Source/Core/UICommon/UICommon.cpp | 3 +++ 7 files changed, 13 insertions(+) diff --git a/Source/Core/Common/CommonPaths.h b/Source/Core/Common/CommonPaths.h index f697f6b383..9bb1aeb12e 100644 --- a/Source/Core/Common/CommonPaths.h +++ b/Source/Core/Common/CommonPaths.h @@ -73,6 +73,7 @@ #define RESOURCEPACK_DIR "ResourcePacks" #define DYNAMICINPUT_DIR "DynamicInputTextures" #define GRAPHICSMOD_DIR "GraphicMods" +#define WIISDSYNC_DIR "WiiSDSync" // This one is only used to remove it if it was present #define SHADERCACHE_LEGACY_DIR "ShaderCache" diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 030ae169a5..99e429eba4 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -978,6 +978,7 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[D_RESOURCEPACK_IDX] = s_user_paths[D_USER_IDX] + RESOURCEPACK_DIR DIR_SEP; s_user_paths[D_DYNAMICINPUT_IDX] = s_user_paths[D_LOAD_IDX] + DYNAMICINPUT_DIR DIR_SEP; s_user_paths[D_GRAPHICSMOD_IDX] = s_user_paths[D_LOAD_IDX] + GRAPHICSMOD_DIR DIR_SEP; + s_user_paths[D_WIISDCARDSYNCFOLDER_IDX] = s_user_paths[D_LOAD_IDX] + WIISDSYNC_DIR DIR_SEP; s_user_paths[F_DOLPHINCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DOLPHIN_CONFIG; s_user_paths[F_GCPADCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + GCPAD_CONFIG; s_user_paths[F_WIIPADCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + WIIPAD_CONFIG; diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index c0bcb8f451..ea29d05e40 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -63,6 +63,7 @@ enum D_GRAPHICSMOD_IDX, D_GBAUSER_IDX, D_GBASAVES_IDX, + D_WIISDCARDSYNCFOLDER_IDX, FIRST_FILE_USER_PATH_IDX, F_DOLPHINCONFIG_IDX = FIRST_FILE_USER_PATH_IDX, F_GCPADCONFIG_IDX, diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index 90b60000f3..3a41cdb631 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -159,6 +159,8 @@ const Info& GetInfoForSimulateKonga(int channel) } const Info MAIN_WII_SD_CARD{{System::Main, "Core", "WiiSDCard"}, true}; +const Info MAIN_WII_SD_CARD_ENABLE_FOLDER_SYNC{ + {System::Main, "Core", "WiiSDCardEnableFolderSync"}, false}; const Info MAIN_WII_KEYBOARD{{System::Main, "Core", "WiiKeyboard"}, false}; const Info MAIN_WIIMOTE_CONTINUOUS_SCANNING{ {System::Main, "Core", "WiimoteContinuousScanning"}, false}; @@ -269,6 +271,8 @@ const Info MAIN_LOAD_PATH{{System::Main, "General", "LoadPath"}, "" const Info MAIN_RESOURCEPACK_PATH{{System::Main, "General", "ResourcePackPath"}, ""}; const Info MAIN_FS_PATH{{System::Main, "General", "NANDRootPath"}, ""}; const Info MAIN_WII_SD_CARD_IMAGE_PATH{{System::Main, "General", "WiiSDCardPath"}, ""}; +const Info MAIN_WII_SD_CARD_SYNC_FOLDER_PATH{ + {System::Main, "General", "WiiSDCardSyncFolder"}, ""}; const Info MAIN_WFS_PATH{{System::Main, "General", "WFSPath"}, ""}; const Info MAIN_SHOW_LAG{{System::Main, "General", "ShowLag"}, false}; const Info MAIN_SHOW_FRAME_COUNT{{System::Main, "General", "ShowFrameCount"}, false}; diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h index d354414bf3..0f954c7f0d 100644 --- a/Source/Core/Core/Config/MainSettings.h +++ b/Source/Core/Core/Config/MainSettings.h @@ -92,6 +92,7 @@ const Info& GetInfoForSIDevice(int channel); const Info& GetInfoForAdapterRumble(int channel); const Info& GetInfoForSimulateKonga(int channel); extern const Info MAIN_WII_SD_CARD; +extern const Info MAIN_WII_SD_CARD_ENABLE_FOLDER_SYNC; extern const Info MAIN_WII_KEYBOARD; extern const Info MAIN_WIIMOTE_CONTINUOUS_SCANNING; extern const Info MAIN_WIIMOTE_ENABLE_SPEAKER; @@ -179,6 +180,7 @@ extern const Info MAIN_LOAD_PATH; extern const Info MAIN_RESOURCEPACK_PATH; extern const Info MAIN_FS_PATH; extern const Info MAIN_WII_SD_CARD_IMAGE_PATH; +extern const Info MAIN_WII_SD_CARD_SYNC_FOLDER_PATH; extern const Info MAIN_WFS_PATH; extern const Info MAIN_SHOW_LAG; extern const Info MAIN_SHOW_FRAME_COUNT; diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index fce77dd35f..3eb8245a29 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -110,6 +110,7 @@ bool IsSettingSaveable(const Config::Location& config_location) &Config::MAIN_FASTMEM.GetLocation(), &Config::MAIN_TIMING_VARIANCE.GetLocation(), &Config::MAIN_WII_SD_CARD.GetLocation(), + &Config::MAIN_WII_SD_CARD_ENABLE_FOLDER_SYNC.GetLocation(), &Config::MAIN_WII_KEYBOARD.GetLocation(), &Config::MAIN_WIIMOTE_CONTINUOUS_SCANNING.GetLocation(), &Config::MAIN_WIIMOTE_ENABLE_SPEAKER.GetLocation(), diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index b7a97a68a3..469c9b2c67 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -92,6 +92,9 @@ static void InitCustomPaths() CreateResourcePackPath(Config::Get(Config::MAIN_RESOURCEPACK_PATH)); CreateWFSPath(Config::Get(Config::MAIN_WFS_PATH)); File::SetUserPath(F_WIISDCARDIMAGE_IDX, Config::Get(Config::MAIN_WII_SD_CARD_IMAGE_PATH)); + File::SetUserPath(D_WIISDCARDSYNCFOLDER_IDX, + Config::Get(Config::MAIN_WII_SD_CARD_SYNC_FOLDER_PATH)); + File::CreateFullPath(File::GetUserPath(D_WIISDCARDSYNCFOLDER_IDX)); #ifdef HAS_LIBMGBA File::SetUserPath(F_GBABIOS_IDX, Config::Get(Config::MAIN_GBA_BIOS_PATH)); File::SetUserPath(D_GBASAVES_IDX, Config::Get(Config::MAIN_GBA_SAVES_PATH));