summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2022-11-07 05:33:47 +0100
committerAdmiral H. Curtiss <pikachu025@gmail.com>2022-11-22 17:53:19 +0100
commit86d01c33997a313cc37213ffe183ddf9c0b513aa (patch)
treea220af6fd3f3ce427cc0d9b33809399f68206e3e /Source/Core
parent2132e005c32e137f8723abb68b314f57e02eb2e7 (diff)
Config: Add option to use JPN as the Japanese region directory in GetDirectoryForRegion().
See https://bugs.dolphin-emu.org/issues/13076 for motivation for this.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/CommonPaths.h2
-rw-r--r--Source/Core/Core/Config/MainSettings.cpp7
-rw-r--r--Source/Core/Core/Config/MainSettings.h10
3 files changed, 15 insertions, 4 deletions
diff --git a/Source/Core/Common/CommonPaths.h b/Source/Core/Common/CommonPaths.h
index cb8aacddf8..187231f743 100644
--- a/Source/Core/Common/CommonPaths.h
+++ b/Source/Core/Common/CommonPaths.h
@@ -28,9 +28,11 @@
#endif
// Dirs in both User and Sys
+// Legacy setups used /JAP/ while newer setups use /JPN/ by default.
#define EUR_DIR "EUR"
#define USA_DIR "USA"
#define JAP_DIR "JAP"
+#define JPN_DIR "JPN"
// Subdirs in the User dir returned by GetUserPath(D_USER_IDX)
#define GC_USER_DIR "GC"
diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp
index 091fd3504f..4a8ae957f0 100644
--- a/Source/Core/Core/Config/MainSettings.cpp
+++ b/Source/Core/Core/Config/MainSettings.cpp
@@ -561,7 +561,7 @@ DiscIO::Region ToGameCubeRegion(DiscIO::Region region)
return DiscIO::Region::NTSC_J;
}
-const char* GetDirectoryForRegion(DiscIO::Region region)
+const char* GetDirectoryForRegion(DiscIO::Region region, RegionDirectoryStyle style)
{
if (region == DiscIO::Region::Unknown)
region = ToGameCubeRegion(Config::Get(Config::MAIN_FALLBACK_REGION));
@@ -569,7 +569,7 @@ const char* GetDirectoryForRegion(DiscIO::Region region)
switch (region)
{
case DiscIO::Region::NTSC_J:
- return JAP_DIR;
+ return style == RegionDirectoryStyle::Legacy ? JAP_DIR : JPN_DIR;
case DiscIO::Region::NTSC_U:
return USA_DIR;
@@ -578,8 +578,9 @@ const char* GetDirectoryForRegion(DiscIO::Region region)
return EUR_DIR;
case DiscIO::Region::NTSC_K:
+ // See ToGameCubeRegion
ASSERT_MSG(BOOT, false, "NTSC-K is not a valid GameCube region");
- return JAP_DIR; // See ToGameCubeRegion
+ return style == RegionDirectoryStyle::Legacy ? JAP_DIR : JPN_DIR;
default:
ASSERT_MSG(BOOT, false, "Default case should not be reached");
diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h
index f30ef02a38..0730681f2d 100644
--- a/Source/Core/Core/Config/MainSettings.h
+++ b/Source/Core/Core/Config/MainSettings.h
@@ -344,8 +344,16 @@ void SetUSBDeviceWhitelist(const std::set<std::pair<u16, u16>>& devices);
// Replaces NTSC-K with some other region, and doesn't replace non-NTSC-K regions
DiscIO::Region ToGameCubeRegion(DiscIO::Region region);
+
// The region argument must be valid for GameCube (i.e. must not be NTSC-K)
-const char* GetDirectoryForRegion(DiscIO::Region region);
+enum class RegionDirectoryStyle
+{
+ Legacy,
+ Modern,
+};
+const char* GetDirectoryForRegion(DiscIO::Region region,
+ RegionDirectoryStyle style = RegionDirectoryStyle::Legacy);
+
std::string GetBootROMPath(const std::string& region_directory);
// Builds the memory card according to the configuration with the given region and size. If the
// given region is std::nullopt, the region in the configured path is used if there is one, or the