diff options
| -rw-r--r-- | src/core/hle/service/set/set_sys.cpp | 69 | ||||
| -rw-r--r-- | src/core/hle/service/set/set_sys.h | 38 |
2 files changed, 100 insertions, 7 deletions
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp index 297e78379..165b97dad 100644 --- a/src/core/hle/service/set/set_sys.cpp +++ b/src/core/hle/service/set/set_sys.cpp | |||
| @@ -75,6 +75,16 @@ void GetFirmwareVersionImpl(HLERequestContext& ctx, GetFirmwareVersionType type) | |||
| 75 | } | 75 | } |
| 76 | } // Anonymous namespace | 76 | } // Anonymous namespace |
| 77 | 77 | ||
| 78 | void SET_SYS::SetLanguageCode(HLERequestContext& ctx) { | ||
| 79 | IPC::RequestParser rp{ctx}; | ||
| 80 | language_code_setting = rp.PopEnum<LanguageCode>(); | ||
| 81 | |||
| 82 | LOG_INFO(Service_SET, "called, language_code={}", language_code_setting); | ||
| 83 | |||
| 84 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 85 | rb.Push(ResultSuccess); | ||
| 86 | } | ||
| 87 | |||
| 78 | void SET_SYS::GetFirmwareVersion(HLERequestContext& ctx) { | 88 | void SET_SYS::GetFirmwareVersion(HLERequestContext& ctx) { |
| 79 | LOG_DEBUG(Service_SET, "called"); | 89 | LOG_DEBUG(Service_SET, "called"); |
| 80 | GetFirmwareVersionImpl(ctx, GetFirmwareVersionType::Version1); | 90 | GetFirmwareVersionImpl(ctx, GetFirmwareVersionType::Version1); |
| @@ -103,6 +113,33 @@ void SET_SYS::SetAccountSettings(HLERequestContext& ctx) { | |||
| 103 | rb.Push(ResultSuccess); | 113 | rb.Push(ResultSuccess); |
| 104 | } | 114 | } |
| 105 | 115 | ||
| 116 | void SET_SYS::GetEulaVersions(HLERequestContext& ctx) { | ||
| 117 | LOG_INFO(Service_SET, "called"); | ||
| 118 | |||
| 119 | ctx.WriteBuffer(eula_versions); | ||
| 120 | |||
| 121 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 122 | rb.Push(ResultSuccess); | ||
| 123 | rb.Push(static_cast<u32>(eula_versions.size())); | ||
| 124 | } | ||
| 125 | |||
| 126 | void SET_SYS::SetEulaVersions(HLERequestContext& ctx) { | ||
| 127 | const auto elements = ctx.GetReadBufferNumElements<EulaVersion>(); | ||
| 128 | const auto buffer_data = ctx.ReadBuffer(); | ||
| 129 | |||
| 130 | LOG_INFO(Service_SET, "called, elements={}", elements); | ||
| 131 | |||
| 132 | eula_versions.resize(elements); | ||
| 133 | for (std::size_t index = 0; index < elements; index++) { | ||
| 134 | const std::size_t start_index = index * sizeof(EulaVersion); | ||
| 135 | memcpy(eula_versions.data() + start_index, buffer_data.data() + start_index, | ||
| 136 | sizeof(EulaVersion)); | ||
| 137 | } | ||
| 138 | |||
| 139 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 140 | rb.Push(ResultSuccess); | ||
| 141 | } | ||
| 142 | |||
| 106 | void SET_SYS::GetColorSetId(HLERequestContext& ctx) { | 143 | void SET_SYS::GetColorSetId(HLERequestContext& ctx) { |
| 107 | LOG_DEBUG(Service_SET, "called"); | 144 | LOG_DEBUG(Service_SET, "called"); |
| 108 | 145 | ||
| @@ -149,7 +186,7 @@ void SET_SYS::GetAccountNotificationSettings(HLERequestContext& ctx) { | |||
| 149 | 186 | ||
| 150 | IPC::ResponseBuilder rb{ctx, 3}; | 187 | IPC::ResponseBuilder rb{ctx, 3}; |
| 151 | rb.Push(ResultSuccess); | 188 | rb.Push(ResultSuccess); |
| 152 | rb.Push(account_notifications.size()); | 189 | rb.Push(static_cast<u32>(account_notifications.size())); |
| 153 | } | 190 | } |
| 154 | 191 | ||
| 155 | void SET_SYS::SetAccountNotificationSettings(HLERequestContext& ctx) { | 192 | void SET_SYS::SetAccountNotificationSettings(HLERequestContext& ctx) { |
| @@ -275,6 +312,16 @@ void SET_SYS::GetQuestFlag(HLERequestContext& ctx) { | |||
| 275 | rb.PushEnum(QuestFlag::Retail); | 312 | rb.PushEnum(QuestFlag::Retail); |
| 276 | } | 313 | } |
| 277 | 314 | ||
| 315 | void SET_SYS::SetRegionCode(HLERequestContext& ctx) { | ||
| 316 | IPC::RequestParser rp{ctx}; | ||
| 317 | region_code = rp.PopEnum<RegionCode>(); | ||
| 318 | |||
| 319 | LOG_INFO(Service_SET, "called, region_code={}", region_code); | ||
| 320 | |||
| 321 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 322 | rb.Push(ResultSuccess); | ||
| 323 | } | ||
| 324 | |||
| 278 | void SET_SYS::GetPrimaryAlbumStorage(HLERequestContext& ctx) { | 325 | void SET_SYS::GetPrimaryAlbumStorage(HLERequestContext& ctx) { |
| 279 | LOG_WARNING(Service_SET, "(STUBBED) called"); | 326 | LOG_WARNING(Service_SET, "(STUBBED) called"); |
| 280 | 327 | ||
| @@ -286,7 +333,7 @@ void SET_SYS::GetPrimaryAlbumStorage(HLERequestContext& ctx) { | |||
| 286 | void SET_SYS::GetSleepSettings(HLERequestContext& ctx) { | 333 | void SET_SYS::GetSleepSettings(HLERequestContext& ctx) { |
| 287 | LOG_INFO(Service_SET, "called"); | 334 | LOG_INFO(Service_SET, "called"); |
| 288 | 335 | ||
| 289 | IPC::ResponseBuilder rb{ctx, 7}; | 336 | IPC::ResponseBuilder rb{ctx, 5}; |
| 290 | rb.Push(ResultSuccess); | 337 | rb.Push(ResultSuccess); |
| 291 | rb.PushRaw(sleep_settings); | 338 | rb.PushRaw(sleep_settings); |
| 292 | } | 339 | } |
| @@ -434,10 +481,18 @@ void SET_SYS::GetChineseTraditionalInputMethod(HLERequestContext& ctx) { | |||
| 434 | rb.PushEnum(ChineseTraditionalInputMethod::Unknown0); | 481 | rb.PushEnum(ChineseTraditionalInputMethod::Unknown0); |
| 435 | } | 482 | } |
| 436 | 483 | ||
| 484 | void SET_SYS::GetFieldTestingFlag(HLERequestContext& ctx) { | ||
| 485 | LOG_WARNING(Service_SET, "(STUBBED) called"); | ||
| 486 | |||
| 487 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 488 | rb.Push(ResultSuccess); | ||
| 489 | rb.Push<u8>(false); | ||
| 490 | } | ||
| 491 | |||
| 437 | SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { | 492 | SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { |
| 438 | // clang-format off | 493 | // clang-format off |
| 439 | static const FunctionInfo functions[] = { | 494 | static const FunctionInfo functions[] = { |
| 440 | {0, nullptr, "SetLanguageCode"}, | 495 | {0, &SET_SYS::SetLanguageCode, "SetLanguageCode"}, |
| 441 | {1, nullptr, "SetNetworkSettings"}, | 496 | {1, nullptr, "SetNetworkSettings"}, |
| 442 | {2, nullptr, "GetNetworkSettings"}, | 497 | {2, nullptr, "GetNetworkSettings"}, |
| 443 | {3, &SET_SYS::GetFirmwareVersion, "GetFirmwareVersion"}, | 498 | {3, &SET_SYS::GetFirmwareVersion, "GetFirmwareVersion"}, |
| @@ -457,8 +512,8 @@ SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { | |||
| 457 | {18, &SET_SYS::SetAccountSettings, "SetAccountSettings"}, | 512 | {18, &SET_SYS::SetAccountSettings, "SetAccountSettings"}, |
| 458 | {19, nullptr, "GetAudioVolume"}, | 513 | {19, nullptr, "GetAudioVolume"}, |
| 459 | {20, nullptr, "SetAudioVolume"}, | 514 | {20, nullptr, "SetAudioVolume"}, |
| 460 | {21, nullptr, "GetEulaVersions"}, | 515 | {21, &SET_SYS::GetEulaVersions, "GetEulaVersions"}, |
| 461 | {22, nullptr, "SetEulaVersions"}, | 516 | {22, &SET_SYS::SetEulaVersions, "SetEulaVersions"}, |
| 462 | {23, &SET_SYS::GetColorSetId, "GetColorSetId"}, | 517 | {23, &SET_SYS::GetColorSetId, "GetColorSetId"}, |
| 463 | {24, &SET_SYS::SetColorSetId, "SetColorSetId"}, | 518 | {24, &SET_SYS::SetColorSetId, "SetColorSetId"}, |
| 464 | {25, nullptr, "GetConsoleInformationUploadFlag"}, | 519 | {25, nullptr, "GetConsoleInformationUploadFlag"}, |
| @@ -491,7 +546,7 @@ SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { | |||
| 491 | {54, nullptr, "SetDeviceTimeZoneLocationName"}, | 546 | {54, nullptr, "SetDeviceTimeZoneLocationName"}, |
| 492 | {55, nullptr, "GetWirelessCertificationFileSize"}, | 547 | {55, nullptr, "GetWirelessCertificationFileSize"}, |
| 493 | {56, nullptr, "GetWirelessCertificationFile"}, | 548 | {56, nullptr, "GetWirelessCertificationFile"}, |
| 494 | {57, nullptr, "SetRegionCode"}, | 549 | {57, &SET_SYS::SetRegionCode, "SetRegionCode"}, |
| 495 | {58, nullptr, "GetNetworkSystemClockContext"}, | 550 | {58, nullptr, "GetNetworkSystemClockContext"}, |
| 496 | {59, nullptr, "SetNetworkSystemClockContext"}, | 551 | {59, nullptr, "SetNetworkSystemClockContext"}, |
| 497 | {60, nullptr, "IsUserSystemClockAutomaticCorrectionEnabled"}, | 552 | {60, nullptr, "IsUserSystemClockAutomaticCorrectionEnabled"}, |
| @@ -635,7 +690,7 @@ SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { | |||
| 635 | {198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"}, | 690 | {198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"}, |
| 636 | {199, nullptr, "GetButtonConfigRegisteredSettings"}, | 691 | {199, nullptr, "GetButtonConfigRegisteredSettings"}, |
| 637 | {200, nullptr, "SetButtonConfigRegisteredSettings"}, | 692 | {200, nullptr, "SetButtonConfigRegisteredSettings"}, |
| 638 | {201, nullptr, "GetFieldTestingFlag"}, | 693 | {201, &SET_SYS::GetFieldTestingFlag, "GetFieldTestingFlag"}, |
| 639 | {202, nullptr, "SetFieldTestingFlag"}, | 694 | {202, nullptr, "SetFieldTestingFlag"}, |
| 640 | {203, nullptr, "GetPanelCrcMode"}, | 695 | {203, nullptr, "GetPanelCrcMode"}, |
| 641 | {204, nullptr, "SetPanelCrcMode"}, | 696 | {204, nullptr, "SetPanelCrcMode"}, |
diff --git a/src/core/hle/service/set/set_sys.h b/src/core/hle/service/set/set_sys.h index 16624d3fd..c7dba2a9e 100644 --- a/src/core/hle/service/set/set_sys.h +++ b/src/core/hle/service/set/set_sys.h | |||
| @@ -118,6 +118,22 @@ private: | |||
| 118 | Never, | 118 | Never, |
| 119 | }; | 119 | }; |
| 120 | 120 | ||
| 121 | /// This is nn::settings::system::RegionCode | ||
| 122 | enum class RegionCode : u32 { | ||
| 123 | Japan, | ||
| 124 | Usa, | ||
| 125 | Europe, | ||
| 126 | Australia, | ||
| 127 | HongKongTaiwanKorea, | ||
| 128 | China, | ||
| 129 | }; | ||
| 130 | |||
| 131 | /// This is nn::settings::system::EulaVersionClockType | ||
| 132 | enum class EulaVersionClockType : u32 { | ||
| 133 | NetworkSystemClock, | ||
| 134 | SteadyClock, | ||
| 135 | }; | ||
| 136 | |||
| 121 | /// This is nn::settings::system::SleepFlag | 137 | /// This is nn::settings::system::SleepFlag |
| 122 | struct SleepFlag { | 138 | struct SleepFlag { |
| 123 | union { | 139 | union { |
| @@ -242,10 +258,24 @@ private: | |||
| 242 | }; | 258 | }; |
| 243 | static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size"); | 259 | static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size"); |
| 244 | 260 | ||
| 261 | /// This is nn::settings::system::InitialLaunchSettings | ||
| 262 | struct EulaVersion { | ||
| 263 | u32 version; | ||
| 264 | RegionCode region_code; | ||
| 265 | EulaVersionClockType clock_type; | ||
| 266 | INSERT_PADDING_BYTES(0x4); | ||
| 267 | s64 posix_time; | ||
| 268 | Time::Clock::SteadyClockTimePoint timestamp; | ||
| 269 | }; | ||
| 270 | static_assert(sizeof(EulaVersion) == 0x30, "EulaVersion is incorrect size"); | ||
| 271 | |||
| 272 | void SetLanguageCode(HLERequestContext& ctx); | ||
| 245 | void GetFirmwareVersion(HLERequestContext& ctx); | 273 | void GetFirmwareVersion(HLERequestContext& ctx); |
| 246 | void GetFirmwareVersion2(HLERequestContext& ctx); | 274 | void GetFirmwareVersion2(HLERequestContext& ctx); |
| 247 | void GetAccountSettings(HLERequestContext& ctx); | 275 | void GetAccountSettings(HLERequestContext& ctx); |
| 248 | void SetAccountSettings(HLERequestContext& ctx); | 276 | void SetAccountSettings(HLERequestContext& ctx); |
| 277 | void GetEulaVersions(HLERequestContext& ctx); | ||
| 278 | void SetEulaVersions(HLERequestContext& ctx); | ||
| 249 | void GetColorSetId(HLERequestContext& ctx); | 279 | void GetColorSetId(HLERequestContext& ctx); |
| 250 | void SetColorSetId(HLERequestContext& ctx); | 280 | void SetColorSetId(HLERequestContext& ctx); |
| 251 | void GetNotificationSettings(HLERequestContext& ctx); | 281 | void GetNotificationSettings(HLERequestContext& ctx); |
| @@ -257,6 +287,7 @@ private: | |||
| 257 | void GetTvSettings(HLERequestContext& ctx); | 287 | void GetTvSettings(HLERequestContext& ctx); |
| 258 | void SetTvSettings(HLERequestContext& ctx); | 288 | void SetTvSettings(HLERequestContext& ctx); |
| 259 | void GetQuestFlag(HLERequestContext& ctx); | 289 | void GetQuestFlag(HLERequestContext& ctx); |
| 290 | void SetRegionCode(HLERequestContext& ctx); | ||
| 260 | void GetPrimaryAlbumStorage(HLERequestContext& ctx); | 291 | void GetPrimaryAlbumStorage(HLERequestContext& ctx); |
| 261 | void GetSleepSettings(HLERequestContext& ctx); | 292 | void GetSleepSettings(HLERequestContext& ctx); |
| 262 | void SetSleepSettings(HLERequestContext& ctx); | 293 | void SetSleepSettings(HLERequestContext& ctx); |
| @@ -273,6 +304,7 @@ private: | |||
| 273 | void SetAppletLaunchFlags(HLERequestContext& ctx); | 304 | void SetAppletLaunchFlags(HLERequestContext& ctx); |
| 274 | void GetKeyboardLayout(HLERequestContext& ctx); | 305 | void GetKeyboardLayout(HLERequestContext& ctx); |
| 275 | void GetChineseTraditionalInputMethod(HLERequestContext& ctx); | 306 | void GetChineseTraditionalInputMethod(HLERequestContext& ctx); |
| 307 | void GetFieldTestingFlag(HLERequestContext& ctx); | ||
| 276 | 308 | ||
| 277 | AccountSettings account_settings{ | 309 | AccountSettings account_settings{ |
| 278 | .flags = {}, | 310 | .flags = {}, |
| @@ -312,6 +344,12 @@ private: | |||
| 312 | }; | 344 | }; |
| 313 | 345 | ||
| 314 | u32 applet_launch_flag{}; | 346 | u32 applet_launch_flag{}; |
| 347 | |||
| 348 | std::vector<EulaVersion> eula_versions{}; | ||
| 349 | |||
| 350 | RegionCode region_code; | ||
| 351 | |||
| 352 | LanguageCode language_code_setting; | ||
| 315 | }; | 353 | }; |
| 316 | 354 | ||
| 317 | } // namespace Service::Set | 355 | } // namespace Service::Set |