diff --git a/Source/Core/Common/CommonPaths.h b/Source/Core/Common/CommonPaths.h index 4afeb698a3..e4b4a67d86 100644 --- a/Source/Core/Common/CommonPaths.h +++ b/Source/Core/Common/CommonPaths.h @@ -34,6 +34,7 @@ // Subdirs in the User dir returned by GetUserPath(D_USER_IDX) #define GC_USER_DIR "GC" +#define GBA_USER_DIR "GBA" #define WII_USER_DIR "Wii" #define CONFIG_DIR "Config" #define GAMESETTINGS_DIR "GameSettings" @@ -61,6 +62,7 @@ #define RESOURCES_DIR "Resources" #define THEMES_DIR "Themes" #define STYLES_DIR "Styles" +#define GBASAVES_DIR "Saves" #define ANAGLYPH_DIR "Anaglyph" #define PASSIVE_DIR "Passive" #define PIPES_DIR "Pipes" @@ -119,6 +121,8 @@ #define GC_MEMCARDB "MemoryCardB" #define GC_MEMCARD_NETPLAY "NetPlayTemp" +#define GBA_BIOS "gba_bios.bin" + #define WII_STATE "state.dat" #define WII_SDCARD "sd.raw" diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index a65f58f793..d04fdc60a1 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -983,6 +983,10 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[F_MEMORYWATCHERSOCKET_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET; + s_user_paths[D_GBAUSER_IDX] = s_user_paths[D_USER_IDX] + GBA_USER_DIR DIR_SEP; + s_user_paths[D_GBASAVES_IDX] = s_user_paths[D_GBAUSER_IDX] + GBASAVES_DIR DIR_SEP; + s_user_paths[F_GBABIOS_IDX] = s_user_paths[D_GBAUSER_IDX] + GBA_BIOS; + // The shader cache has moved to the cache directory, so remove the old one. // TODO: remove that someday. File::DeleteDirRecursively(s_user_paths[D_USER_IDX] + SHADERCACHE_LEGACY_DIR DIR_SEP); diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index c4419fb317..1a487bbe4e 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -59,6 +59,8 @@ enum D_BACKUP_IDX, D_RESOURCEPACK_IDX, D_DYNAMICINPUT_IDX, + D_GBAUSER_IDX, + D_GBASAVES_IDX, F_DOLPHINCONFIG_IDX, F_GCPADCONFIG_IDX, F_WIIPADCONFIG_IDX, @@ -77,6 +79,7 @@ enum F_WIISDCARD_IDX, F_DUALSHOCKUDPCLIENTCONFIG_IDX, F_FREELOOKCONFIG_IDX, + F_GBABIOS_IDX, NUM_PATH_INDICES }; diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index dd3e633991..b3fa308160 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -145,6 +145,18 @@ const Info MAIN_RESOURCEPACK_PATH{{System::Main, "General", "Resour const Info MAIN_FS_PATH{{System::Main, "General", "NANDRootPath"}, ""}; const Info MAIN_SD_PATH{{System::Main, "General", "WiiSDCardPath"}, ""}; +// Main.GBA + +const Info MAIN_GBA_BIOS_PATH{{System::Main, "GBA", "BIOS"}, ""}; +const std::array, 4> MAIN_GBA_ROM_PATHS{ + Info{{System::Main, "GBA", "Rom1"}, ""}, + Info{{System::Main, "GBA", "Rom2"}, ""}, + Info{{System::Main, "GBA", "Rom3"}, ""}, + Info{{System::Main, "GBA", "Rom4"}, ""}}; +const Info MAIN_GBA_SAVES_PATH{{System::Main, "GBA", "SavesPath"}, ""}; +const Info MAIN_GBA_SAVES_IN_ROM_PATH{{System::Main, "GBA", "SavesInRomPath"}, false}; +const Info MAIN_GBA_THREADS{{System::Main, "GBA", "Threads"}, true}; + // Main.Network const Info MAIN_NETWORK_SSL_DUMP_READ{{System::Main, "Network", "SSLDumpRead"}, false}; diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h index 981b6c663f..4fad910606 100644 --- a/Source/Core/Core/Config/MainSettings.h +++ b/Source/Core/Core/Config/MainSettings.h @@ -3,6 +3,7 @@ #pragma once +#include #include #include "Common/Config/Config.h" @@ -119,6 +120,14 @@ extern const Info MAIN_RESOURCEPACK_PATH; extern const Info MAIN_FS_PATH; extern const Info MAIN_SD_PATH; +// Main.GBA + +extern const Info MAIN_GBA_BIOS_PATH; +extern const std::array, 4> MAIN_GBA_ROM_PATHS; +extern const Info MAIN_GBA_SAVES_PATH; +extern const Info MAIN_GBA_SAVES_IN_ROM_PATH; +extern const Info MAIN_GBA_THREADS; + // Main.Network extern const Info MAIN_NETWORK_SSL_DUMP_READ; diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index f2eb0eb930..1f8074518d 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -26,7 +26,7 @@ bool IsSettingSaveable(const Config::Location& config_location) if (config_location.system == Config::System::Main) { for (const std::string_view section : - {"NetPlay", "General", "Display", "Network", "Analytics", "AndroidOverlayButtons"}) + {"NetPlay", "General", "GBA", "Display", "Network", "Analytics", "AndroidOverlayButtons"}) { if (config_location.section == section) return true; diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index 40815f049f..a5e7450b85 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -81,9 +81,10 @@ static void InitCustomPaths() CreateLoadPath(Config::Get(Config::MAIN_LOAD_PATH)); CreateDumpPath(Config::Get(Config::MAIN_DUMP_PATH)); CreateResourcePackPath(Config::Get(Config::MAIN_RESOURCEPACK_PATH)); - const std::string sd_path = Config::Get(Config::MAIN_SD_PATH); - if (!sd_path.empty()) - File::SetUserPath(F_WIISDCARD_IDX, sd_path); + File::SetUserPath(F_WIISDCARD_IDX, Config::Get(Config::MAIN_SD_PATH)); + File::SetUserPath(F_GBABIOS_IDX, Config::Get(Config::MAIN_GBA_BIOS_PATH)); + File::SetUserPath(D_GBASAVES_IDX, Config::Get(Config::MAIN_GBA_SAVES_PATH)); + File::CreateFullPath(File::GetUserPath(D_GBASAVES_IDX)); } void Init()