summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Enums.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-12-29 18:10:16 +0100
committerJosJuice <josjuice@gmail.com>2021-03-27 09:46:46 +0100
commita1000afacceef41697588c124f5dd2e7d18ff73b (patch)
tree182b99256736dcd227c763a70c83e20f9018ac07 /Source/Core/DiscIO/Enums.cpp
parent8d2b0fff8a066281365072f827321e47bfed8c72 (diff)
Add utility functions for GameCube language codes
Diffstat (limited to 'Source/Core/DiscIO/Enums.cpp')
-rw-r--r--Source/Core/DiscIO/Enums.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/Enums.cpp b/Source/Core/DiscIO/Enums.cpp
index c43132b7f2..7ee3ce78eb 100644
--- a/Source/Core/DiscIO/Enums.cpp
+++ b/Source/Core/DiscIO/Enums.cpp
@@ -126,6 +126,22 @@ bool IsNTSC(Region region)
return region == Region::NTSC_J || region == Region::NTSC_U || region == Region::NTSC_K;
}
+int ToGameCubeLanguage(Language language)
+{
+ if (language < Language::English || language > Language::Dutch)
+ return 0;
+ else
+ return static_cast<int>(language) - 1;
+}
+
+Language FromGameCubeLanguage(int language)
+{
+ if (language < 0 || language > 5)
+ return Language::Unknown;
+ else
+ return static_cast<Language>(language + 1);
+}
+
// Increment CACHE_REVISION (GameFileCache.cpp) if the code below is modified
Country TypicalCountryForRegion(Region region)