diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 5bcc0b588..9e12c76fc 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -111,6 +111,14 @@ void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) {
rb.PushEnum(available_language_codes[Settings::values.language_index]);
}
+void SET::GetRegionCode(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_SET, "called");
+
+ IPC::ResponseBuilder rb{ctx, 3};
+ rb.Push(RESULT_SUCCESS);
+ rb.Push(Settings::values.region_index);
+}
+
SET::SET() : ServiceFramework("set") {
// clang-format off
static const FunctionInfo functions[] = {
@@ -118,7 +126,7 @@ SET::SET() : ServiceFramework("set") {
{1, &SET::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"},
{2, &SET::MakeLanguageCode, "MakeLanguageCode"},
{3, &SET::GetAvailableLanguageCodeCount, "GetAvailableLanguageCodeCount"},
- {4, nullptr, "GetRegionCode"},
+ {4, &SET::GetRegionCode, "GetRegionCode"},
{5, &SET::GetAvailableLanguageCodes2, "GetAvailableLanguageCodes2"},
{6, &SET::GetAvailableLanguageCodeCount2, "GetAvailableLanguageCodeCount2"},
{7, nullptr, "GetKeyCodeMap"},
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h
index b154e08aa..6084b345d 100644
--- a/src/core/hle/service/set/set.h
+++ b/src/core/hle/service/set/set.h
@@ -43,6 +43,7 @@ private:
void GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx);
void GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx);
void GetQuestFlag(Kernel::HLERequestContext& ctx);
+ void GetRegionCode(Kernel::HLERequestContext& ctx);
};
} // namespace Service::Set
diff --git a/src/core/settings.cpp b/src/core/settings.cpp
index 7c0303684..c1282cb80 100644
--- a/src/core/settings.cpp
+++ b/src/core/settings.cpp
@@ -86,6 +86,7 @@ void LogSettings() {
LogSetting("System_RngSeed", Settings::values.rng_seed.value_or(0));
LogSetting("System_CurrentUser", Settings::values.current_user);
LogSetting("System_LanguageIndex", Settings::values.language_index);
+ LogSetting("System_RegionIndex", Settings::values.region_index);
LogSetting("Core_UseMultiCore", Settings::values.use_multi_core);
LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor);
LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit);
diff --git a/src/core/settings.h b/src/core/settings.h
index 12e2cc9e7..79ec01731 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -387,6 +387,7 @@ struct Values {
s32 current_user;
s32 language_index;
+ s32 region_index;
s32 sound_index;
// Controls
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 16e67cc0a..3b9ab38dd 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -682,6 +682,8 @@ void Config::ReadSystemValues() {
Settings::values.language_index = ReadSetting(QStringLiteral("language_index"), 1).toInt();
+ Settings::values.region_index = ReadSetting(QStringLiteral("region_index"), 1).toInt();
+
const auto rng_seed_enabled = ReadSetting(QStringLiteral("rng_seed_enabled"), false).toBool();
if (rng_seed_enabled) {
Settings::values.rng_seed = ReadSetting(QStringLiteral("rng_seed"), 0).toULongLong();
@@ -1116,6 +1118,7 @@ void Config::SaveSystemValues() {
WriteSetting(QStringLiteral("use_docked_mode"), Settings::values.use_docked_mode, false);
WriteSetting(QStringLiteral("current_user"), Settings::values.current_user, 0);
WriteSetting(QStringLiteral("language_index"), Settings::values.language_index, 1);
+ WriteSetting(QStringLiteral("region_index"), Settings::values.region_index, 1);
WriteSetting(QStringLiteral("rng_seed_enabled"), Settings::values.rng_seed.has_value(), false);
WriteSetting(QStringLiteral("rng_seed"), Settings::values.rng_seed.value_or(0), 0);
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp
index f9a5b4fbe..f49cd4c8f 100644
--- a/src/yuzu/configuration/configure_system.cpp
+++ b/src/yuzu/configuration/configure_system.cpp
@@ -56,6 +56,7 @@ void ConfigureSystem::SetConfiguration() {
enabled = !Core::System::GetInstance().IsPoweredOn();
ui->combo_language->setCurrentIndex(Settings::values.language_index);
+ ui->combo_region->setCurrentIndex(Settings::values.region_index);
ui->combo_sound->setCurrentIndex(Settings::values.sound_index);
ui->rng_seed_checkbox->setChecked(Settings::values.rng_seed.has_value());
@@ -82,6 +83,7 @@ void ConfigureSystem::ApplyConfiguration() {
}
Settings::values.language_index = ui->combo_language->currentIndex();
+ Settings::values.region_index = ui->combo_region->currentIndex();
Settings::values.sound_index = ui->combo_sound->currentIndex();
if (ui->rng_seed_checkbox->isChecked()) {
diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h
index 1eab3781d..d8fa2d2cc 100644
--- a/src/yuzu/configuration/configure_system.h
+++ b/src/yuzu/configuration/configure_system.h
@@ -36,5 +36,6 @@ private:
bool enabled = false;
int language_index = 0;
+ int region_index = 0;
int sound_index = 0;
};
diff --git a/src/yuzu/configuration/configure_system.ui b/src/yuzu/configuration/configure_system.ui
index 65745a2f8..4e2c7e76e 100644
--- a/src/yuzu/configuration/configure_system.ui
+++ b/src/yuzu/configuration/configure_system.ui
@@ -22,14 +22,14 @@
System Settings
- -
+
-
Sound output mode
- -
+
-
Console ID:
@@ -128,14 +128,60 @@
- -
+
-
+
+
+ Region:
+
+
+
+ -
+
+
-
+
+ Japan
+
+
+ -
+
+ USA
+
+
+ -
+
+ Europe
+
+
+ -
+
+ Australia
+
+
+ -
+
+ China
+
+
+ -
+
+ Korea
+
+
+ -
+
+ Taiwan
+
+
+
+
+ -
RNG Seed
- -
+
-
-
@@ -161,7 +207,7 @@
- -
+
-
@@ -177,14 +223,14 @@
- -
+
-
Custom RTC
- -
+
-
@@ -198,7 +244,7 @@
- -
+
-