diff options
author | bunnei <bunneidev@gmail.com> | 2021-07-30 23:42:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 23:42:11 +0200 |
commit | 47f13a9df48ac84b9353772e826ac92b3c0be813 (patch) | |
tree | 5c54a237f4c4128f450abd6f0f6f53415b8d6898 /src/core/hle/service/set | |
parent | Merge pull request #6775 from lat9nq/cmd-remove-global-core (diff) | |
parent | configure_system: Add Brazilian Portuguese to the list of languages (diff) | |
download | yuzu-47f13a9df48ac84b9353772e826ac92b3c0be813.tar yuzu-47f13a9df48ac84b9353772e826ac92b3c0be813.tar.gz yuzu-47f13a9df48ac84b9353772e826ac92b3c0be813.tar.bz2 yuzu-47f13a9df48ac84b9353772e826ac92b3c0be813.tar.lz yuzu-47f13a9df48ac84b9353772e826ac92b3c0be813.tar.xz yuzu-47f13a9df48ac84b9353772e826ac92b3c0be813.tar.zst yuzu-47f13a9df48ac84b9353772e826ac92b3c0be813.zip |
Diffstat (limited to 'src/core/hle/service/set')
-rw-r--r-- | src/core/hle/service/set/set.cpp | 22 | ||||
-rw-r--r-- | src/core/hle/service/set/set.h | 1 |
2 files changed, 13 insertions, 10 deletions
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 @@ namespace Service::Set { namespace { -constexpr std::array<LanguageCode, 17> available_language_codes = {{ +constexpr std::array<LanguageCode, 18> available_language_codes = {{ LanguageCode::JA, LanguageCode::EN_US, LanguageCode::FR, @@ -30,6 +30,7 @@ constexpr std::array<LanguageCode, 17> available_language_codes = {{ LanguageCode::ES_419, LanguageCode::ZH_HANS, LanguageCode::ZH_HANT, + LanguageCode::PT_BR, }}; enum class KeyboardLayout : u64 { @@ -50,7 +51,7 @@ enum class KeyboardLayout : u64 { ChineseTraditional = 14, }; -constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 17> language_to_layout{{ +constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_layout{{ {LanguageCode::JA, KeyboardLayout::Japanese}, {LanguageCode::EN_US, KeyboardLayout::EnglishUs}, {LanguageCode::FR, KeyboardLayout::French}, @@ -68,10 +69,11 @@ constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 17> language_to_la {LanguageCode::ES_419, KeyboardLayout::SpanishLatin}, {LanguageCode::ZH_HANS, KeyboardLayout::ChineseSimplified}, {LanguageCode::ZH_HANT, KeyboardLayout::ChineseTraditional}, + {LanguageCode::PT_BR, KeyboardLayout::Portuguese}, }}; -constexpr std::size_t pre4_0_0_max_entries = 15; -constexpr std::size_t post4_0_0_max_entries = 17; +constexpr std::size_t PRE_4_0_0_MAX_ENTRIES = 0xF; +constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40; constexpr ResultCode ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625}; @@ -81,9 +83,9 @@ void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_la rb.Push(static_cast<u32>(num_language_codes)); } -void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_size) { +void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_entries) { const std::size_t requested_amount = ctx.GetWriteBufferSize() / sizeof(LanguageCode); - const std::size_t copy_amount = std::min(requested_amount, max_size); + const std::size_t copy_amount = std::min(requested_amount, max_entries); const std::size_t copy_size = copy_amount * sizeof(LanguageCode); ctx.WriteBuffer(available_language_codes.data(), copy_size); @@ -118,7 +120,7 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t index) { void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - GetAvailableLanguageCodesImpl(ctx, pre4_0_0_max_entries); + GetAvailableLanguageCodesImpl(ctx, PRE_4_0_0_MAX_ENTRIES); } void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { @@ -140,19 +142,19 @@ void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - GetAvailableLanguageCodesImpl(ctx, post4_0_0_max_entries); + GetAvailableLanguageCodesImpl(ctx, POST_4_0_0_MAX_ENTRIES); } void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - PushResponseLanguageCode(ctx, pre4_0_0_max_entries); + PushResponseLanguageCode(ctx, PRE_4_0_0_MAX_ENTRIES); } void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SET, "called"); - PushResponseLanguageCode(ctx, post4_0_0_max_entries); + PushResponseLanguageCode(ctx, POST_4_0_0_MAX_ENTRIES); } void 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 { ES_419 = 0x00003931342D7365, ZH_HANS = 0x00736E61482D687A, ZH_HANT = 0x00746E61482D687A, + PT_BR = 0x00000052422D7470, }; LanguageCode GetLanguageCodeFromIndex(std::size_t idx); |