diff options
Diffstat (limited to 'src/core/hle/service/set/setting_formats')
-rw-r--r-- | src/core/hle/service/set/setting_formats/system_settings.cpp | 12 | ||||
-rw-r--r-- | src/core/hle/service/set/setting_formats/system_settings.h | 12 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/core/hle/service/set/setting_formats/system_settings.cpp b/src/core/hle/service/set/setting_formats/system_settings.cpp index 88a305f03..16ded43bf 100644 --- a/src/core/hle/service/set/setting_formats/system_settings.cpp +++ b/src/core/hle/service/set/setting_formats/system_settings.cpp @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include "common/settings.h" #include "core/hle/service/set/setting_formats/system_settings.h" namespace Service::Set { @@ -52,6 +53,17 @@ SystemSettings DefaultSystemSettings() { settings.chinese_traditional_input_method = ChineseTraditionalInputMethod::Unknown0; settings.vibration_master_volume = 1.0f; + const auto language_code = + available_language_codes[static_cast<s32>(::Settings::values.language_index.GetValue())]; + const auto key_code = + std::find_if(language_to_layout.cbegin(), language_to_layout.cend(), + [=](const auto& element) { return element.first == language_code; }); + + settings.keyboard_layout = KeyboardLayout::EnglishUs; + if (key_code != language_to_layout.end()) { + settings.keyboard_layout = key_code->second; + } + return settings; } diff --git a/src/core/hle/service/set/setting_formats/system_settings.h b/src/core/hle/service/set/setting_formats/system_settings.h index af5929fa9..ebc373da5 100644 --- a/src/core/hle/service/set/setting_formats/system_settings.h +++ b/src/core/hle/service/set/setting_formats/system_settings.h @@ -213,10 +213,9 @@ struct SystemSettings { // nn::settings::system::AudioVolume std::array<u8, 0x8> audio_volume_type0; std::array<u8, 0x8> audio_volume_type1; - // nn::settings::system::AudioOutputMode - s32 audio_output_mode_type0; - s32 audio_output_mode_type1; - s32 audio_output_mode_type2; + AudioOutputMode audio_output_mode_hdmi; + AudioOutputMode audio_output_mode_speaker; + AudioOutputMode audio_output_mode_headphone; bool force_mute_on_headphone_removed; INSERT_PADDING_BYTES(0x3); s32 headphone_volume_warning_count; @@ -224,9 +223,8 @@ struct SystemSettings { INSERT_PADDING_BYTES(0x3); // nn::settings::system::AudioVolume std::array<u8, 0x8> audio_volume_type2; - // nn::settings::system::AudioOutputMode - s32 audio_output_mode_type3; - s32 audio_output_mode_type4; + AudioOutputMode audio_output_mode_type3; + AudioOutputMode audio_output_mode_type4; bool hearing_protection_safeguard_flag; INSERT_PADDING_BYTES(0x3); INSERT_PADDING_BYTES(0x4); // Reserved |