summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/ns/language.cpp1
-rw-r--r--src/core/hle/service/set/set.cpp22
-rw-r--r--src/core/hle/service/set/set.h1
-rw-r--r--src/yuzu/configuration/configure_system.ui5
-rw-r--r--src/yuzu_cmd/default_ini.h2
5 files changed, 20 insertions, 11 deletions
diff --git a/src/core/hle/service/ns/language.cpp b/src/core/hle/service/ns/language.cpp
index 54b644830..7d9e4a20b 100644
--- a/src/core/hle/service/ns/language.cpp
+++ b/src/core/hle/service/ns/language.cpp
@@ -339,6 +339,7 @@ std::optional<ApplicationLanguage> ConvertToApplicationLanguage(
339 case Set::LanguageCode::FR_CA: 339 case Set::LanguageCode::FR_CA:
340 return ApplicationLanguage::CanadianFrench; 340 return ApplicationLanguage::CanadianFrench;
341 case Set::LanguageCode::PT: 341 case Set::LanguageCode::PT:
342 case Set::LanguageCode::PT_BR:
342 return ApplicationLanguage::Portuguese; 343 return ApplicationLanguage::Portuguese;
343 case Set::LanguageCode::RU: 344 case Set::LanguageCode::RU:
344 return ApplicationLanguage::Russian; 345 return ApplicationLanguage::Russian;
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 522a604a5..f2e2e8306 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -12,7 +12,7 @@
12 12
13namespace Service::Set { 13namespace Service::Set {
14namespace { 14namespace {
15constexpr std::array<LanguageCode, 17> available_language_codes = {{ 15constexpr std::array<LanguageCode, 18> available_language_codes = {{
16 LanguageCode::JA, 16 LanguageCode::JA,
17 LanguageCode::EN_US, 17 LanguageCode::EN_US,
18 LanguageCode::FR, 18 LanguageCode::FR,
@@ -30,6 +30,7 @@ constexpr std::array<LanguageCode, 17> available_language_codes = {{
30 LanguageCode::ES_419, 30 LanguageCode::ES_419,
31 LanguageCode::ZH_HANS, 31 LanguageCode::ZH_HANS,
32 LanguageCode::ZH_HANT, 32 LanguageCode::ZH_HANT,
33 LanguageCode::PT_BR,
33}}; 34}};
34 35
35enum class KeyboardLayout : u64 { 36enum class KeyboardLayout : u64 {
@@ -50,7 +51,7 @@ enum class KeyboardLayout : u64 {
50 ChineseTraditional = 14, 51 ChineseTraditional = 14,
51}; 52};
52 53
53constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 17> language_to_layout{{ 54constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_layout{{
54 {LanguageCode::JA, KeyboardLayout::Japanese}, 55 {LanguageCode::JA, KeyboardLayout::Japanese},
55 {LanguageCode::EN_US, KeyboardLayout::EnglishUs}, 56 {LanguageCode::EN_US, KeyboardLayout::EnglishUs},
56 {LanguageCode::FR, KeyboardLayout::French}, 57 {LanguageCode::FR, KeyboardLayout::French},
@@ -68,10 +69,11 @@ constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 17> language_to_la
68 {LanguageCode::ES_419, KeyboardLayout::SpanishLatin}, 69 {LanguageCode::ES_419, KeyboardLayout::SpanishLatin},
69 {LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified}, 70 {LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified},
70 {LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional}, 71 {LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional},
72 {LanguageCode::PT_BR, KeyboardLayout::Portuguese},
71}}; 73}};
72 74
73constexpr std::size_t pre4_0_0_max_entries = 15; 75constexpr std::size_t PRE_4_0_0_MAX_ENTRIES = 0xF;
74constexpr std::size_t post4_0_0_max_entries = 17; 76constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40;
75 77
76constexpr ResultCode ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625}; 78constexpr ResultCode ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625};
77 79
@@ -81,9 +83,9 @@ void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_la
81 rb.Push(static_cast<u32>(num_language_codes)); 83 rb.Push(static_cast<u32>(num_language_codes));
82} 84}
83 85
84void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_size) { 86void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_entries) {
85 const std::size_t requested_amount = ctx.GetWriteBufferSize() / sizeof(LanguageCode); 87 const std::size_t requested_amount = ctx.GetWriteBufferSize() / sizeof(LanguageCode);
86 const std::size_t copy_amount = std::min(requested_amount, max_size); 88 const std::size_t copy_amount = std::min(requested_amount, max_entries);
87 const std::size_t copy_size = copy_amount * sizeof(LanguageCode); 89 const std::size_t copy_size = copy_amount * sizeof(LanguageCode);
88 90
89 ctx.WriteBuffer(available_language_codes.data(), copy_size); 91 ctx.WriteBuffer(available_language_codes.data(), copy_size);
@@ -118,7 +120,7 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t index) {
118void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { 120void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
119 LOG_DEBUG(Service_SET, "called"); 121 LOG_DEBUG(Service_SET, "called");
120 122
121 GetAvailableLanguageCodesImpl(ctx, pre4_0_0_max_entries); 123 GetAvailableLanguageCodesImpl(ctx, PRE_4_0_0_MAX_ENTRIES);
122} 124}
123 125
124void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { 126void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) {
@@ -140,19 +142,19 @@ void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) {
140void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) { 142void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) {
141 LOG_DEBUG(Service_SET, "called"); 143 LOG_DEBUG(Service_SET, "called");
142 144
143 GetAvailableLanguageCodesImpl(ctx, post4_0_0_max_entries); 145 GetAvailableLanguageCodesImpl(ctx, POST_4_0_0_MAX_ENTRIES);
144} 146}
145 147
146void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) { 148void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) {
147 LOG_DEBUG(Service_SET, "called"); 149 LOG_DEBUG(Service_SET, "called");
148 150
149 PushResponseLanguageCode(ctx, pre4_0_0_max_entries); 151 PushResponseLanguageCode(ctx, PRE_4_0_0_MAX_ENTRIES);
150} 152}
151 153
152void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) { 154void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) {
153 LOG_DEBUG(Service_SET, "called"); 155 LOG_DEBUG(Service_SET, "called");
154 156
155 PushResponseLanguageCode(ctx, post4_0_0_max_entries); 157 PushResponseLanguageCode(ctx, POST_4_0_0_MAX_ENTRIES);
156} 158}
157 159
158void SET::GetQuestFlag(Kernel::HLERequestContext& ctx) { 160void SET::GetQuestFlag(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h
index d5bd7828d..acabebeaa 100644
--- a/src/core/hle/service/set/set.h
+++ b/src/core/hle/service/set/set.h
@@ -31,6 +31,7 @@ enum class LanguageCode : u64 {
31 ES_419 = 0x00003931342D7365, 31 ES_419 = 0x00003931342D7365,
32 ZH_HANS = 0x00736E61482D687A, 32 ZH_HANS = 0x00736E61482D687A,
33 ZH_HANT = 0x00746E61482D687A, 33 ZH_HANT = 0x00746E61482D687A,
34 PT_BR = 0x00000052422D7470,
34}; 35};
35LanguageCode GetLanguageCodeFromIndex(std::size_t idx); 36LanguageCode GetLanguageCodeFromIndex(std::size_t idx);
36 37
diff --git a/src/yuzu/configuration/configure_system.ui b/src/yuzu/configuration/configure_system.ui
index 53b95658b..27f552f59 100644
--- a/src/yuzu/configuration/configure_system.ui
+++ b/src/yuzu/configuration/configure_system.ui
@@ -401,6 +401,11 @@
401 <string>Traditional Chinese (正體中文)</string> 401 <string>Traditional Chinese (正體中文)</string>
402 </property> 402 </property>
403 </item> 403 </item>
404 <item>
405 <property name="text">
406 <string>Brazilian Portuguese (português do Brasil)</string>
407 </property>
408 </item>
404 </widget> 409 </widget>
405 </item> 410 </item>
406 <item row="5" column="0"> 411 <item row="5" column="0">
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index 0c0c128ae..e02eceb99 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -367,7 +367,7 @@ custom_rtc =
367# Sets the systems language index 367# Sets the systems language index
368# 0: Japanese, 1: English (default), 2: French, 3: German, 4: Italian, 5: Spanish, 6: Chinese, 368# 0: Japanese, 1: English (default), 2: French, 3: German, 4: Italian, 5: Spanish, 6: Chinese,
369# 7: Korean, 8: Dutch, 9: Portuguese, 10: Russian, 11: Taiwanese, 12: British English, 13: Canadian French, 369# 7: Korean, 8: Dutch, 9: Portuguese, 10: Russian, 11: Taiwanese, 12: British English, 13: Canadian French,
370# 14: Latin American Spanish, 15: Simplified Chinese, 16: Traditional Chinese 370# 14: Latin American Spanish, 15: Simplified Chinese, 16: Traditional Chinese, 17: Brazilian Portuguese
371language_index = 371language_index =
372 372
373# The system region that yuzu will use during emulation 373# The system region that yuzu will use during emulation