diff options
| author | 2023-02-19 14:42:12 -0500 | |
|---|---|---|
| committer | 2023-03-01 10:39:49 -0500 | |
| commit | 65be230fdda302b25447f2f09b06e3238bd09e79 (patch) | |
| tree | 68250d7bc8151041b236dcd79483df98938952cd /src/core/hle/service/set | |
| parent | sm:: remove unused member (diff) | |
| download | yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.gz yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.xz yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.zip | |
service: move hle_ipc from kernel
Diffstat (limited to 'src/core/hle/service/set')
| -rw-r--r-- | src/core/hle/service/set/set.cpp | 30 | ||||
| -rw-r--r-- | src/core/hle/service/set/set.h | 22 | ||||
| -rw-r--r-- | src/core/hle/service/set/set_sys.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/service/set/set_sys.h | 14 |
4 files changed, 42 insertions, 42 deletions
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index 16c5eaf75..88df52331 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include <chrono> | 6 | #include <chrono> |
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "common/settings.h" | 8 | #include "common/settings.h" |
| 9 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/service/ipc_helpers.h" |
| 10 | #include "core/hle/service/set/set.h" | 10 | #include "core/hle/service/set/set.h" |
| 11 | 11 | ||
| 12 | namespace Service::Set { | 12 | namespace Service::Set { |
| @@ -76,13 +76,13 @@ constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40; | |||
| 76 | 76 | ||
| 77 | constexpr Result ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625}; | 77 | constexpr Result ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625}; |
| 78 | 78 | ||
| 79 | void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_language_codes) { | 79 | void PushResponseLanguageCode(HLERequestContext& ctx, std::size_t num_language_codes) { |
| 80 | IPC::ResponseBuilder rb{ctx, 3}; | 80 | IPC::ResponseBuilder rb{ctx, 3}; |
| 81 | rb.Push(ResultSuccess); | 81 | rb.Push(ResultSuccess); |
| 82 | rb.Push(static_cast<u32>(num_language_codes)); | 82 | rb.Push(static_cast<u32>(num_language_codes)); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t max_entries) { | 85 | void GetAvailableLanguageCodesImpl(HLERequestContext& ctx, std::size_t max_entries) { |
| 86 | const std::size_t requested_amount = ctx.GetWriteBufferNumElements<LanguageCode>(); | 86 | const std::size_t requested_amount = ctx.GetWriteBufferNumElements<LanguageCode>(); |
| 87 | const std::size_t max_amount = std::min(requested_amount, max_entries); | 87 | const std::size_t max_amount = std::min(requested_amount, max_entries); |
| 88 | const std::size_t copy_amount = std::min(available_language_codes.size(), max_amount); | 88 | const std::size_t copy_amount = std::min(available_language_codes.size(), max_amount); |
| @@ -92,7 +92,7 @@ void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t m | |||
| 92 | PushResponseLanguageCode(ctx, copy_amount); | 92 | PushResponseLanguageCode(ctx, copy_amount); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | void GetKeyCodeMapImpl(Kernel::HLERequestContext& ctx) { | 95 | void GetKeyCodeMapImpl(HLERequestContext& ctx) { |
| 96 | const auto language_code = available_language_codes[Settings::values.language_index.GetValue()]; | 96 | const auto language_code = available_language_codes[Settings::values.language_index.GetValue()]; |
| 97 | const auto key_code = | 97 | const auto key_code = |
| 98 | std::find_if(language_to_layout.cbegin(), language_to_layout.cend(), | 98 | std::find_if(language_to_layout.cbegin(), language_to_layout.cend(), |
| @@ -117,13 +117,13 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t index) { | |||
| 117 | return available_language_codes.at(index); | 117 | return available_language_codes.at(index); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { | 120 | void SET::GetAvailableLanguageCodes(HLERequestContext& ctx) { |
| 121 | LOG_DEBUG(Service_SET, "called"); | 121 | LOG_DEBUG(Service_SET, "called"); |
| 122 | 122 | ||
| 123 | GetAvailableLanguageCodesImpl(ctx, PRE_4_0_0_MAX_ENTRIES); | 123 | GetAvailableLanguageCodesImpl(ctx, PRE_4_0_0_MAX_ENTRIES); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { | 126 | void SET::MakeLanguageCode(HLERequestContext& ctx) { |
| 127 | IPC::RequestParser rp{ctx}; | 127 | IPC::RequestParser rp{ctx}; |
| 128 | const auto index = rp.Pop<u32>(); | 128 | const auto index = rp.Pop<u32>(); |
| 129 | 129 | ||
| @@ -139,25 +139,25 @@ void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) { | |||
| 139 | rb.PushEnum(available_language_codes[index]); | 139 | rb.PushEnum(available_language_codes[index]); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) { | 142 | void SET::GetAvailableLanguageCodes2(HLERequestContext& ctx) { |
| 143 | LOG_DEBUG(Service_SET, "called"); | 143 | LOG_DEBUG(Service_SET, "called"); |
| 144 | 144 | ||
| 145 | GetAvailableLanguageCodesImpl(ctx, POST_4_0_0_MAX_ENTRIES); | 145 | GetAvailableLanguageCodesImpl(ctx, POST_4_0_0_MAX_ENTRIES); |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) { | 148 | void SET::GetAvailableLanguageCodeCount(HLERequestContext& ctx) { |
| 149 | LOG_DEBUG(Service_SET, "called"); | 149 | LOG_DEBUG(Service_SET, "called"); |
| 150 | 150 | ||
| 151 | PushResponseLanguageCode(ctx, PRE_4_0_0_MAX_ENTRIES); | 151 | PushResponseLanguageCode(ctx, PRE_4_0_0_MAX_ENTRIES); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) { | 154 | void SET::GetAvailableLanguageCodeCount2(HLERequestContext& ctx) { |
| 155 | LOG_DEBUG(Service_SET, "called"); | 155 | LOG_DEBUG(Service_SET, "called"); |
| 156 | 156 | ||
| 157 | PushResponseLanguageCode(ctx, POST_4_0_0_MAX_ENTRIES); | 157 | PushResponseLanguageCode(ctx, POST_4_0_0_MAX_ENTRIES); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | void SET::GetQuestFlag(Kernel::HLERequestContext& ctx) { | 160 | void SET::GetQuestFlag(HLERequestContext& ctx) { |
| 161 | LOG_DEBUG(Service_SET, "called"); | 161 | LOG_DEBUG(Service_SET, "called"); |
| 162 | 162 | ||
| 163 | IPC::ResponseBuilder rb{ctx, 3}; | 163 | IPC::ResponseBuilder rb{ctx, 3}; |
| @@ -165,7 +165,7 @@ void SET::GetQuestFlag(Kernel::HLERequestContext& ctx) { | |||
| 165 | rb.Push(static_cast<u32>(Settings::values.quest_flag.GetValue())); | 165 | rb.Push(static_cast<u32>(Settings::values.quest_flag.GetValue())); |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) { | 168 | void SET::GetLanguageCode(HLERequestContext& ctx) { |
| 169 | LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index.GetValue()); | 169 | LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index.GetValue()); |
| 170 | 170 | ||
| 171 | IPC::ResponseBuilder rb{ctx, 4}; | 171 | IPC::ResponseBuilder rb{ctx, 4}; |
| @@ -173,7 +173,7 @@ void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) { | |||
| 173 | rb.PushEnum(available_language_codes[Settings::values.language_index.GetValue()]); | 173 | rb.PushEnum(available_language_codes[Settings::values.language_index.GetValue()]); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | void SET::GetRegionCode(Kernel::HLERequestContext& ctx) { | 176 | void SET::GetRegionCode(HLERequestContext& ctx) { |
| 177 | LOG_DEBUG(Service_SET, "called"); | 177 | LOG_DEBUG(Service_SET, "called"); |
| 178 | 178 | ||
| 179 | IPC::ResponseBuilder rb{ctx, 3}; | 179 | IPC::ResponseBuilder rb{ctx, 3}; |
| @@ -181,17 +181,17 @@ void SET::GetRegionCode(Kernel::HLERequestContext& ctx) { | |||
| 181 | rb.Push(Settings::values.region_index.GetValue()); | 181 | rb.Push(Settings::values.region_index.GetValue()); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | void SET::GetKeyCodeMap(Kernel::HLERequestContext& ctx) { | 184 | void SET::GetKeyCodeMap(HLERequestContext& ctx) { |
| 185 | LOG_DEBUG(Service_SET, "Called {}", ctx.Description()); | 185 | LOG_DEBUG(Service_SET, "Called {}", ctx.Description()); |
| 186 | GetKeyCodeMapImpl(ctx); | 186 | GetKeyCodeMapImpl(ctx); |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | void SET::GetKeyCodeMap2(Kernel::HLERequestContext& ctx) { | 189 | void SET::GetKeyCodeMap2(HLERequestContext& ctx) { |
| 190 | LOG_DEBUG(Service_SET, "Called {}", ctx.Description()); | 190 | LOG_DEBUG(Service_SET, "Called {}", ctx.Description()); |
| 191 | GetKeyCodeMapImpl(ctx); | 191 | GetKeyCodeMapImpl(ctx); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | void SET::GetDeviceNickName(Kernel::HLERequestContext& ctx) { | 194 | void SET::GetDeviceNickName(HLERequestContext& ctx) { |
| 195 | LOG_DEBUG(Service_SET, "called"); | 195 | LOG_DEBUG(Service_SET, "called"); |
| 196 | IPC::ResponseBuilder rb{ctx, 2}; | 196 | IPC::ResponseBuilder rb{ctx, 2}; |
| 197 | rb.Push(ResultSuccess); | 197 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/set/set.h b/src/core/hle/service/set/set.h index 375975711..7fd3a7654 100644 --- a/src/core/hle/service/set/set.h +++ b/src/core/hle/service/set/set.h | |||
| @@ -40,17 +40,17 @@ public: | |||
| 40 | ~SET() override; | 40 | ~SET() override; |
| 41 | 41 | ||
| 42 | private: | 42 | private: |
| 43 | void GetLanguageCode(Kernel::HLERequestContext& ctx); | 43 | void GetLanguageCode(HLERequestContext& ctx); |
| 44 | void GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx); | 44 | void GetAvailableLanguageCodes(HLERequestContext& ctx); |
| 45 | void MakeLanguageCode(Kernel::HLERequestContext& ctx); | 45 | void MakeLanguageCode(HLERequestContext& ctx); |
| 46 | void GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx); | 46 | void GetAvailableLanguageCodes2(HLERequestContext& ctx); |
| 47 | void GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx); | 47 | void GetAvailableLanguageCodeCount(HLERequestContext& ctx); |
| 48 | void GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx); | 48 | void GetAvailableLanguageCodeCount2(HLERequestContext& ctx); |
| 49 | void GetQuestFlag(Kernel::HLERequestContext& ctx); | 49 | void GetQuestFlag(HLERequestContext& ctx); |
| 50 | void GetRegionCode(Kernel::HLERequestContext& ctx); | 50 | void GetRegionCode(HLERequestContext& ctx); |
| 51 | void GetKeyCodeMap(Kernel::HLERequestContext& ctx); | 51 | void GetKeyCodeMap(HLERequestContext& ctx); |
| 52 | void GetKeyCodeMap2(Kernel::HLERequestContext& ctx); | 52 | void GetKeyCodeMap2(HLERequestContext& ctx); |
| 53 | void GetDeviceNickName(Kernel::HLERequestContext& ctx); | 53 | void GetDeviceNickName(HLERequestContext& ctx); |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | } // namespace Service::Set | 56 | } // namespace Service::Set |
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp index 94c20edda..2e38d1cfc 100644 --- a/src/core/hle/service/set/set_sys.cpp +++ b/src/core/hle/service/set/set_sys.cpp | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | #include "common/settings.h" | 6 | #include "common/settings.h" |
| 7 | #include "core/file_sys/errors.h" | 7 | #include "core/file_sys/errors.h" |
| 8 | #include "core/file_sys/system_archive/system_version.h" | 8 | #include "core/file_sys/system_archive/system_version.h" |
| 9 | #include "core/hle/ipc_helpers.h" | ||
| 10 | #include "core/hle/service/filesystem/filesystem.h" | 9 | #include "core/hle/service/filesystem/filesystem.h" |
| 10 | #include "core/hle/service/ipc_helpers.h" | ||
| 11 | #include "core/hle/service/set/set_sys.h" | 11 | #include "core/hle/service/set/set_sys.h" |
| 12 | 12 | ||
| 13 | namespace Service::Set { | 13 | namespace Service::Set { |
| @@ -20,7 +20,7 @@ enum class GetFirmwareVersionType { | |||
| 20 | Version2, | 20 | Version2, |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionType type) { | 23 | void GetFirmwareVersionImpl(HLERequestContext& ctx, GetFirmwareVersionType type) { |
| 24 | LOG_WARNING(Service_SET, "called - Using hardcoded firmware version '{}'", | 24 | LOG_WARNING(Service_SET, "called - Using hardcoded firmware version '{}'", |
| 25 | FileSys::SystemArchive::GetLongDisplayVersion()); | 25 | FileSys::SystemArchive::GetLongDisplayVersion()); |
| 26 | 26 | ||
| @@ -73,17 +73,17 @@ void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionTy | |||
| 73 | } | 73 | } |
| 74 | } // Anonymous namespace | 74 | } // Anonymous namespace |
| 75 | 75 | ||
| 76 | void SET_SYS::GetFirmwareVersion(Kernel::HLERequestContext& ctx) { | 76 | void SET_SYS::GetFirmwareVersion(HLERequestContext& ctx) { |
| 77 | LOG_DEBUG(Service_SET, "called"); | 77 | LOG_DEBUG(Service_SET, "called"); |
| 78 | GetFirmwareVersionImpl(ctx, GetFirmwareVersionType::Version1); | 78 | GetFirmwareVersionImpl(ctx, GetFirmwareVersionType::Version1); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void SET_SYS::GetFirmwareVersion2(Kernel::HLERequestContext& ctx) { | 81 | void SET_SYS::GetFirmwareVersion2(HLERequestContext& ctx) { |
| 82 | LOG_DEBUG(Service_SET, "called"); | 82 | LOG_DEBUG(Service_SET, "called"); |
| 83 | GetFirmwareVersionImpl(ctx, GetFirmwareVersionType::Version2); | 83 | GetFirmwareVersionImpl(ctx, GetFirmwareVersionType::Version2); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) { | 86 | void SET_SYS::GetColorSetId(HLERequestContext& ctx) { |
| 87 | LOG_DEBUG(Service_SET, "called"); | 87 | LOG_DEBUG(Service_SET, "called"); |
| 88 | 88 | ||
| 89 | IPC::ResponseBuilder rb{ctx, 3}; | 89 | IPC::ResponseBuilder rb{ctx, 3}; |
| @@ -92,7 +92,7 @@ void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) { | |||
| 92 | rb.PushEnum(color_set); | 92 | rb.PushEnum(color_set); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) { | 95 | void SET_SYS::SetColorSetId(HLERequestContext& ctx) { |
| 96 | LOG_DEBUG(Service_SET, "called"); | 96 | LOG_DEBUG(Service_SET, "called"); |
| 97 | 97 | ||
| 98 | IPC::RequestParser rp{ctx}; | 98 | IPC::RequestParser rp{ctx}; |
| @@ -126,7 +126,7 @@ static Settings GetSettings() { | |||
| 126 | return ret; | 126 | return ret; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | void SET_SYS::GetSettingsItemValueSize(Kernel::HLERequestContext& ctx) { | 129 | void SET_SYS::GetSettingsItemValueSize(HLERequestContext& ctx) { |
| 130 | LOG_DEBUG(Service_SET, "called"); | 130 | LOG_DEBUG(Service_SET, "called"); |
| 131 | 131 | ||
| 132 | // The category of the setting. This corresponds to the top-level keys of | 132 | // The category of the setting. This corresponds to the top-level keys of |
| @@ -151,7 +151,7 @@ void SET_SYS::GetSettingsItemValueSize(Kernel::HLERequestContext& ctx) { | |||
| 151 | rb.Push(response_size); | 151 | rb.Push(response_size); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | void SET_SYS::GetSettingsItemValue(Kernel::HLERequestContext& ctx) { | 154 | void SET_SYS::GetSettingsItemValue(HLERequestContext& ctx) { |
| 155 | LOG_DEBUG(Service_SET, "called"); | 155 | LOG_DEBUG(Service_SET, "called"); |
| 156 | 156 | ||
| 157 | // The category of the setting. This corresponds to the top-level keys of | 157 | // The category of the setting. This corresponds to the top-level keys of |
| @@ -177,7 +177,7 @@ void SET_SYS::GetSettingsItemValue(Kernel::HLERequestContext& ctx) { | |||
| 177 | rb.Push(response); | 177 | rb.Push(response); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | void SET_SYS::GetDeviceNickName(Kernel::HLERequestContext& ctx) { | 180 | void SET_SYS::GetDeviceNickName(HLERequestContext& ctx) { |
| 181 | LOG_DEBUG(Service_SET, "called"); | 181 | LOG_DEBUG(Service_SET, "called"); |
| 182 | IPC::ResponseBuilder rb{ctx, 2}; | 182 | IPC::ResponseBuilder rb{ctx, 2}; |
| 183 | rb.Push(ResultSuccess); | 183 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/set/set_sys.h b/src/core/hle/service/set/set_sys.h index 464ac3da1..1efbcc97a 100644 --- a/src/core/hle/service/set/set_sys.h +++ b/src/core/hle/service/set/set_sys.h | |||
| @@ -23,13 +23,13 @@ private: | |||
| 23 | BasicBlack = 1, | 23 | BasicBlack = 1, |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | void GetSettingsItemValueSize(Kernel::HLERequestContext& ctx); | 26 | void GetSettingsItemValueSize(HLERequestContext& ctx); |
| 27 | void GetSettingsItemValue(Kernel::HLERequestContext& ctx); | 27 | void GetSettingsItemValue(HLERequestContext& ctx); |
| 28 | void GetFirmwareVersion(Kernel::HLERequestContext& ctx); | 28 | void GetFirmwareVersion(HLERequestContext& ctx); |
| 29 | void GetFirmwareVersion2(Kernel::HLERequestContext& ctx); | 29 | void GetFirmwareVersion2(HLERequestContext& ctx); |
| 30 | void GetColorSetId(Kernel::HLERequestContext& ctx); | 30 | void GetColorSetId(HLERequestContext& ctx); |
| 31 | void SetColorSetId(Kernel::HLERequestContext& ctx); | 31 | void SetColorSetId(HLERequestContext& ctx); |
| 32 | void GetDeviceNickName(Kernel::HLERequestContext& ctx); | 32 | void GetDeviceNickName(HLERequestContext& ctx); |
| 33 | 33 | ||
| 34 | ColorSet color_set = ColorSet::BasicWhite; | 34 | ColorSet color_set = ColorSet::BasicWhite; |
| 35 | }; | 35 | }; |