set_sys.cpp 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "common/assert.h"
  4. #include "common/logging/log.h"
  5. #include "common/settings.h"
  6. #include "common/string_util.h"
  7. #include "core/core.h"
  8. #include "core/file_sys/content_archive.h"
  9. #include "core/file_sys/errors.h"
  10. #include "core/file_sys/nca_metadata.h"
  11. #include "core/file_sys/registered_cache.h"
  12. #include "core/file_sys/romfs.h"
  13. #include "core/file_sys/system_archive/system_archive.h"
  14. #include "core/hle/service/filesystem/filesystem.h"
  15. #include "core/hle/service/ipc_helpers.h"
  16. #include "core/hle/service/set/set.h"
  17. #include "core/hle/service/set/set_sys.h"
  18. namespace Service::Set {
  19. Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& system,
  20. GetFirmwareVersionType type) {
  21. constexpr u64 FirmwareVersionSystemDataId = 0x0100000000000809;
  22. auto& fsc = system.GetFileSystemController();
  23. // Attempt to load version data from disk
  24. const FileSys::RegisteredCache* bis_system{};
  25. std::unique_ptr<FileSys::NCA> nca{};
  26. FileSys::VirtualDir romfs{};
  27. bis_system = fsc.GetSystemNANDContents();
  28. if (bis_system) {
  29. nca = bis_system->GetEntry(FirmwareVersionSystemDataId, FileSys::ContentRecordType::Data);
  30. }
  31. if (nca) {
  32. if (auto nca_romfs = nca->GetRomFS(); nca_romfs) {
  33. romfs = FileSys::ExtractRomFS(nca_romfs);
  34. }
  35. }
  36. if (!romfs) {
  37. romfs = FileSys::ExtractRomFS(
  38. FileSys::SystemArchive::SynthesizeSystemArchive(FirmwareVersionSystemDataId));
  39. }
  40. const auto early_exit_failure = [](std::string_view desc, Result code) {
  41. LOG_ERROR(Service_SET, "General failure while attempting to resolve firmware version ({}).",
  42. desc);
  43. return code;
  44. };
  45. const auto ver_file = romfs->GetFile("file");
  46. if (ver_file == nullptr) {
  47. return early_exit_failure("The system version archive didn't contain the file 'file'.",
  48. FileSys::ERROR_INVALID_ARGUMENT);
  49. }
  50. auto data = ver_file->ReadAllBytes();
  51. if (data.size() != sizeof(FirmwareVersionFormat)) {
  52. return early_exit_failure("The system version file 'file' was not the correct size.",
  53. FileSys::ERROR_OUT_OF_BOUNDS);
  54. }
  55. std::memcpy(&out_firmware, data.data(), sizeof(FirmwareVersionFormat));
  56. // If the command is GetFirmwareVersion (as opposed to GetFirmwareVersion2), hardware will
  57. // zero out the REVISION_MINOR field.
  58. if (type == GetFirmwareVersionType::Version1) {
  59. out_firmware.revision_minor = 0;
  60. }
  61. return ResultSuccess;
  62. }
  63. void SET_SYS::SetLanguageCode(HLERequestContext& ctx) {
  64. IPC::RequestParser rp{ctx};
  65. language_code_setting = rp.PopEnum<LanguageCode>();
  66. LOG_INFO(Service_SET, "called, language_code={}", language_code_setting);
  67. IPC::ResponseBuilder rb{ctx, 2};
  68. rb.Push(ResultSuccess);
  69. }
  70. void SET_SYS::GetFirmwareVersion(HLERequestContext& ctx) {
  71. LOG_DEBUG(Service_SET, "called");
  72. FirmwareVersionFormat firmware_data{};
  73. const auto result =
  74. GetFirmwareVersionImpl(firmware_data, system, GetFirmwareVersionType::Version1);
  75. if (result.IsSuccess()) {
  76. ctx.WriteBuffer(firmware_data);
  77. }
  78. IPC::ResponseBuilder rb{ctx, 2};
  79. rb.Push(result);
  80. }
  81. void SET_SYS::GetFirmwareVersion2(HLERequestContext& ctx) {
  82. LOG_DEBUG(Service_SET, "called");
  83. FirmwareVersionFormat firmware_data{};
  84. const auto result =
  85. GetFirmwareVersionImpl(firmware_data, system, GetFirmwareVersionType::Version2);
  86. if (result.IsSuccess()) {
  87. ctx.WriteBuffer(firmware_data);
  88. }
  89. IPC::ResponseBuilder rb{ctx, 2};
  90. rb.Push(result);
  91. }
  92. void SET_SYS::GetAccountSettings(HLERequestContext& ctx) {
  93. LOG_INFO(Service_SET, "called");
  94. IPC::ResponseBuilder rb{ctx, 3};
  95. rb.Push(ResultSuccess);
  96. rb.PushRaw(account_settings);
  97. }
  98. void SET_SYS::SetAccountSettings(HLERequestContext& ctx) {
  99. IPC::RequestParser rp{ctx};
  100. account_settings = rp.PopRaw<AccountSettings>();
  101. LOG_INFO(Service_SET, "called, account_settings_flags={}", account_settings.flags);
  102. IPC::ResponseBuilder rb{ctx, 2};
  103. rb.Push(ResultSuccess);
  104. }
  105. void SET_SYS::GetEulaVersions(HLERequestContext& ctx) {
  106. LOG_INFO(Service_SET, "called");
  107. ctx.WriteBuffer(eula_versions);
  108. IPC::ResponseBuilder rb{ctx, 3};
  109. rb.Push(ResultSuccess);
  110. rb.Push(static_cast<u32>(eula_versions.size()));
  111. }
  112. void SET_SYS::SetEulaVersions(HLERequestContext& ctx) {
  113. const auto elements = ctx.GetReadBufferNumElements<EulaVersion>();
  114. const auto buffer_data = ctx.ReadBuffer();
  115. LOG_INFO(Service_SET, "called, elements={}", elements);
  116. eula_versions.resize(elements);
  117. for (std::size_t index = 0; index < elements; index++) {
  118. const std::size_t start_index = index * sizeof(EulaVersion);
  119. memcpy(eula_versions.data() + start_index, buffer_data.data() + start_index,
  120. sizeof(EulaVersion));
  121. }
  122. IPC::ResponseBuilder rb{ctx, 2};
  123. rb.Push(ResultSuccess);
  124. }
  125. void SET_SYS::GetColorSetId(HLERequestContext& ctx) {
  126. LOG_DEBUG(Service_SET, "called");
  127. IPC::ResponseBuilder rb{ctx, 3};
  128. rb.Push(ResultSuccess);
  129. rb.PushEnum(color_set);
  130. }
  131. void SET_SYS::SetColorSetId(HLERequestContext& ctx) {
  132. IPC::RequestParser rp{ctx};
  133. color_set = rp.PopEnum<ColorSet>();
  134. LOG_DEBUG(Service_SET, "called, color_set={}", color_set);
  135. IPC::ResponseBuilder rb{ctx, 2};
  136. rb.Push(ResultSuccess);
  137. }
  138. void SET_SYS::GetNotificationSettings(HLERequestContext& ctx) {
  139. LOG_INFO(Service_SET, "called");
  140. IPC::ResponseBuilder rb{ctx, 8};
  141. rb.Push(ResultSuccess);
  142. rb.PushRaw(notification_settings);
  143. }
  144. void SET_SYS::SetNotificationSettings(HLERequestContext& ctx) {
  145. IPC::RequestParser rp{ctx};
  146. notification_settings = rp.PopRaw<NotificationSettings>();
  147. LOG_INFO(Service_SET, "called, flags={}, volume={}, head_time={}:{}, tailt_time={}:{}",
  148. notification_settings.flags.raw, notification_settings.volume,
  149. notification_settings.start_time.hour, notification_settings.start_time.minute,
  150. notification_settings.stop_time.hour, notification_settings.stop_time.minute);
  151. IPC::ResponseBuilder rb{ctx, 2};
  152. rb.Push(ResultSuccess);
  153. }
  154. void SET_SYS::GetAccountNotificationSettings(HLERequestContext& ctx) {
  155. LOG_INFO(Service_SET, "called");
  156. ctx.WriteBuffer(account_notifications);
  157. IPC::ResponseBuilder rb{ctx, 3};
  158. rb.Push(ResultSuccess);
  159. rb.Push(static_cast<u32>(account_notifications.size()));
  160. }
  161. void SET_SYS::SetAccountNotificationSettings(HLERequestContext& ctx) {
  162. const auto elements = ctx.GetReadBufferNumElements<AccountNotificationSettings>();
  163. const auto buffer_data = ctx.ReadBuffer();
  164. LOG_INFO(Service_SET, "called, elements={}", elements);
  165. account_notifications.resize(elements);
  166. for (std::size_t index = 0; index < elements; index++) {
  167. const std::size_t start_index = index * sizeof(AccountNotificationSettings);
  168. memcpy(account_notifications.data() + start_index, buffer_data.data() + start_index,
  169. sizeof(AccountNotificationSettings));
  170. }
  171. IPC::ResponseBuilder rb{ctx, 2};
  172. rb.Push(ResultSuccess);
  173. }
  174. // FIXME: implement support for the real system_settings.ini
  175. template <typename T>
  176. static std::vector<u8> ToBytes(const T& value) {
  177. static_assert(std::is_trivially_copyable_v<T>);
  178. const auto* begin = reinterpret_cast<const u8*>(&value);
  179. const auto* end = begin + sizeof(T);
  180. return std::vector<u8>(begin, end);
  181. }
  182. using Settings =
  183. std::map<std::string, std::map<std::string, std::vector<u8>, std::less<>>, std::less<>>;
  184. static Settings GetSettings() {
  185. Settings ret;
  186. ret["hbloader"]["applet_heap_size"] = ToBytes(u64{0x0});
  187. ret["hbloader"]["applet_heap_reservation_size"] = ToBytes(u64{0x8600000});
  188. return ret;
  189. }
  190. void SET_SYS::GetSettingsItemValueSize(HLERequestContext& ctx) {
  191. LOG_DEBUG(Service_SET, "called");
  192. // The category of the setting. This corresponds to the top-level keys of
  193. // system_settings.ini.
  194. const auto setting_category_buf{ctx.ReadBuffer(0)};
  195. const std::string setting_category{setting_category_buf.begin(), setting_category_buf.end()};
  196. // The name of the setting. This corresponds to the second-level keys of
  197. // system_settings.ini.
  198. const auto setting_name_buf{ctx.ReadBuffer(1)};
  199. const std::string setting_name{setting_name_buf.begin(), setting_name_buf.end()};
  200. auto settings{GetSettings()};
  201. u64 response_size{0};
  202. if (settings.contains(setting_category) && settings[setting_category].contains(setting_name)) {
  203. response_size = settings[setting_category][setting_name].size();
  204. }
  205. IPC::ResponseBuilder rb{ctx, 4};
  206. rb.Push(response_size == 0 ? ResultUnknown : ResultSuccess);
  207. rb.Push(response_size);
  208. }
  209. void SET_SYS::GetSettingsItemValue(HLERequestContext& ctx) {
  210. LOG_DEBUG(Service_SET, "called");
  211. // The category of the setting. This corresponds to the top-level keys of
  212. // system_settings.ini.
  213. const auto setting_category_buf{ctx.ReadBuffer(0)};
  214. const std::string setting_category{setting_category_buf.begin(), setting_category_buf.end()};
  215. // The name of the setting. This corresponds to the second-level keys of
  216. // system_settings.ini.
  217. const auto setting_name_buf{ctx.ReadBuffer(1)};
  218. const std::string setting_name{setting_name_buf.begin(), setting_name_buf.end()};
  219. auto settings{GetSettings()};
  220. Result response{ResultUnknown};
  221. if (settings.contains(setting_category) && settings[setting_category].contains(setting_name)) {
  222. auto setting_value = settings[setting_category][setting_name];
  223. ctx.WriteBuffer(setting_value.data(), setting_value.size());
  224. response = ResultSuccess;
  225. }
  226. IPC::ResponseBuilder rb{ctx, 2};
  227. rb.Push(response);
  228. }
  229. void SET_SYS::GetTvSettings(HLERequestContext& ctx) {
  230. LOG_INFO(Service_SET, "called");
  231. IPC::ResponseBuilder rb{ctx, 10};
  232. rb.Push(ResultSuccess);
  233. rb.PushRaw(tv_settings);
  234. }
  235. void SET_SYS::SetTvSettings(HLERequestContext& ctx) {
  236. IPC::RequestParser rp{ctx};
  237. tv_settings = rp.PopRaw<TvSettings>();
  238. LOG_INFO(Service_SET,
  239. "called, flags={}, cmu_mode={}, constrast_ratio={}, hdmi_content_type={}, "
  240. "rgb_range={}, tv_gama={}, tv_resolution={}, tv_underscan={}",
  241. tv_settings.flags.raw, tv_settings.cmu_mode, tv_settings.constrast_ratio,
  242. tv_settings.hdmi_content_type, tv_settings.rgb_range, tv_settings.tv_gama,
  243. tv_settings.tv_resolution, tv_settings.tv_underscan);
  244. IPC::ResponseBuilder rb{ctx, 2};
  245. rb.Push(ResultSuccess);
  246. }
  247. void SET_SYS::GetQuestFlag(HLERequestContext& ctx) {
  248. LOG_WARNING(Service_SET, "(STUBBED) called");
  249. IPC::ResponseBuilder rb{ctx, 3};
  250. rb.Push(ResultSuccess);
  251. rb.PushEnum(QuestFlag::Retail);
  252. }
  253. void SET_SYS::SetRegionCode(HLERequestContext& ctx) {
  254. IPC::RequestParser rp{ctx};
  255. region_code = rp.PopEnum<RegionCode>();
  256. LOG_INFO(Service_SET, "called, region_code={}", region_code);
  257. IPC::ResponseBuilder rb{ctx, 2};
  258. rb.Push(ResultSuccess);
  259. }
  260. void SET_SYS::GetPrimaryAlbumStorage(HLERequestContext& ctx) {
  261. LOG_WARNING(Service_SET, "(STUBBED) called");
  262. IPC::ResponseBuilder rb{ctx, 3};
  263. rb.Push(ResultSuccess);
  264. rb.PushEnum(PrimaryAlbumStorage::SdCard);
  265. }
  266. void SET_SYS::GetSleepSettings(HLERequestContext& ctx) {
  267. LOG_INFO(Service_SET, "called");
  268. IPC::ResponseBuilder rb{ctx, 5};
  269. rb.Push(ResultSuccess);
  270. rb.PushRaw(sleep_settings);
  271. }
  272. void SET_SYS::SetSleepSettings(HLERequestContext& ctx) {
  273. IPC::RequestParser rp{ctx};
  274. sleep_settings = rp.PopRaw<SleepSettings>();
  275. LOG_INFO(Service_SET, "called, flags={}, handheld_sleep_plan={}, console_sleep_plan={}",
  276. sleep_settings.flags.raw, sleep_settings.handheld_sleep_plan,
  277. sleep_settings.console_sleep_plan);
  278. IPC::ResponseBuilder rb{ctx, 2};
  279. rb.Push(ResultSuccess);
  280. }
  281. void SET_SYS::GetInitialLaunchSettings(HLERequestContext& ctx) {
  282. LOG_INFO(Service_SET, "called");
  283. IPC::ResponseBuilder rb{ctx, 10};
  284. rb.Push(ResultSuccess);
  285. rb.PushRaw(launch_settings);
  286. }
  287. void SET_SYS::SetInitialLaunchSettings(HLERequestContext& ctx) {
  288. IPC::RequestParser rp{ctx};
  289. launch_settings = rp.PopRaw<InitialLaunchSettings>();
  290. LOG_INFO(Service_SET, "called, flags={}, timestamp={}", launch_settings.flags.raw,
  291. launch_settings.timestamp.time_point);
  292. IPC::ResponseBuilder rb{ctx, 2};
  293. rb.Push(ResultSuccess);
  294. }
  295. void SET_SYS::GetDeviceNickName(HLERequestContext& ctx) {
  296. LOG_DEBUG(Service_SET, "called");
  297. ctx.WriteBuffer(::Settings::values.device_name.GetValue());
  298. IPC::ResponseBuilder rb{ctx, 2};
  299. rb.Push(ResultSuccess);
  300. }
  301. void SET_SYS::SetDeviceNickName(HLERequestContext& ctx) {
  302. const std::string device_name = Common::StringFromBuffer(ctx.ReadBuffer());
  303. LOG_INFO(Service_SET, "called, device_name={}", device_name);
  304. ::Settings::values.device_name = device_name;
  305. IPC::ResponseBuilder rb{ctx, 2};
  306. rb.Push(ResultSuccess);
  307. }
  308. void SET_SYS::GetProductModel(HLERequestContext& ctx) {
  309. const u32 product_model = 1;
  310. LOG_WARNING(Service_SET, "(STUBBED) called, product_model={}", product_model);
  311. IPC::ResponseBuilder rb{ctx, 3};
  312. rb.Push(ResultSuccess);
  313. rb.Push(product_model);
  314. }
  315. void SET_SYS::GetMiiAuthorId(HLERequestContext& ctx) {
  316. const auto author_id = Common::UUID::MakeDefault();
  317. LOG_WARNING(Service_SET, "(STUBBED) called, author_id={}", author_id.FormattedString());
  318. IPC::ResponseBuilder rb{ctx, 6};
  319. rb.Push(ResultSuccess);
  320. rb.PushRaw(author_id);
  321. }
  322. void SET_SYS::GetAutoUpdateEnableFlag(HLERequestContext& ctx) {
  323. u8 auto_update_flag{};
  324. LOG_WARNING(Service_SET, "(STUBBED) called, auto_update_flag={}", auto_update_flag);
  325. IPC::ResponseBuilder rb{ctx, 3};
  326. rb.Push(ResultSuccess);
  327. rb.Push(auto_update_flag);
  328. }
  329. void SET_SYS::GetBatteryPercentageFlag(HLERequestContext& ctx) {
  330. u8 battery_percentage_flag{1};
  331. LOG_DEBUG(Service_SET, "(STUBBED) called, battery_percentage_flag={}", battery_percentage_flag);
  332. IPC::ResponseBuilder rb{ctx, 3};
  333. rb.Push(ResultSuccess);
  334. rb.Push(battery_percentage_flag);
  335. }
  336. void SET_SYS::GetErrorReportSharePermission(HLERequestContext& ctx) {
  337. LOG_WARNING(Service_SET, "(STUBBED) called");
  338. IPC::ResponseBuilder rb{ctx, 3};
  339. rb.Push(ResultSuccess);
  340. rb.PushEnum(ErrorReportSharePermission::Denied);
  341. }
  342. void SET_SYS::GetAppletLaunchFlags(HLERequestContext& ctx) {
  343. LOG_INFO(Service_SET, "called, applet_launch_flag={}", applet_launch_flag);
  344. IPC::ResponseBuilder rb{ctx, 3};
  345. rb.Push(ResultSuccess);
  346. rb.Push(applet_launch_flag);
  347. }
  348. void SET_SYS::SetAppletLaunchFlags(HLERequestContext& ctx) {
  349. IPC::RequestParser rp{ctx};
  350. applet_launch_flag = rp.Pop<u32>();
  351. LOG_INFO(Service_SET, "called, applet_launch_flag={}", applet_launch_flag);
  352. IPC::ResponseBuilder rb{ctx, 2};
  353. rb.Push(ResultSuccess);
  354. }
  355. void SET_SYS::GetKeyboardLayout(HLERequestContext& ctx) {
  356. const auto language_code =
  357. available_language_codes[static_cast<s32>(::Settings::values.language_index.GetValue())];
  358. const auto key_code =
  359. std::find_if(language_to_layout.cbegin(), language_to_layout.cend(),
  360. [=](const auto& element) { return element.first == language_code; });
  361. KeyboardLayout selected_keyboard_layout = KeyboardLayout::EnglishUs;
  362. if (key_code != language_to_layout.end()) {
  363. selected_keyboard_layout = key_code->second;
  364. }
  365. LOG_INFO(Service_SET, "called, selected_keyboard_layout={}", selected_keyboard_layout);
  366. IPC::ResponseBuilder rb{ctx, 3};
  367. rb.Push(ResultSuccess);
  368. rb.Push(static_cast<u32>(selected_keyboard_layout));
  369. }
  370. void SET_SYS::GetChineseTraditionalInputMethod(HLERequestContext& ctx) {
  371. LOG_WARNING(Service_SET, "(STUBBED) called");
  372. IPC::ResponseBuilder rb{ctx, 3};
  373. rb.Push(ResultSuccess);
  374. rb.PushEnum(ChineseTraditionalInputMethod::Unknown0);
  375. }
  376. void SET_SYS::GetHomeMenuScheme(HLERequestContext& ctx) {
  377. LOG_DEBUG(Service_SET, "(STUBBED) called");
  378. const HomeMenuScheme default_color = {
  379. .main = 0xFF323232,
  380. .back = 0xFF323232,
  381. .sub = 0xFFFFFFFF,
  382. .bezel = 0xFFFFFFFF,
  383. .extra = 0xFF000000,
  384. };
  385. IPC::ResponseBuilder rb{ctx, 7};
  386. rb.Push(ResultSuccess);
  387. rb.PushRaw(default_color);
  388. }
  389. void SET_SYS::GetHomeMenuSchemeModel(HLERequestContext& ctx) {
  390. LOG_WARNING(Service_SET, "(STUBBED) called");
  391. IPC::ResponseBuilder rb{ctx, 3};
  392. rb.Push(ResultSuccess);
  393. rb.Push(0);
  394. }
  395. void SET_SYS::GetFieldTestingFlag(HLERequestContext& ctx) {
  396. LOG_WARNING(Service_SET, "(STUBBED) called");
  397. IPC::ResponseBuilder rb{ctx, 3};
  398. rb.Push(ResultSuccess);
  399. rb.Push<u8>(false);
  400. }
  401. SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} {
  402. // clang-format off
  403. static const FunctionInfo functions[] = {
  404. {0, &SET_SYS::SetLanguageCode, "SetLanguageCode"},
  405. {1, nullptr, "SetNetworkSettings"},
  406. {2, nullptr, "GetNetworkSettings"},
  407. {3, &SET_SYS::GetFirmwareVersion, "GetFirmwareVersion"},
  408. {4, &SET_SYS::GetFirmwareVersion2, "GetFirmwareVersion2"},
  409. {5, nullptr, "GetFirmwareVersionDigest"},
  410. {7, nullptr, "GetLockScreenFlag"},
  411. {8, nullptr, "SetLockScreenFlag"},
  412. {9, nullptr, "GetBacklightSettings"},
  413. {10, nullptr, "SetBacklightSettings"},
  414. {11, nullptr, "SetBluetoothDevicesSettings"},
  415. {12, nullptr, "GetBluetoothDevicesSettings"},
  416. {13, nullptr, "GetExternalSteadyClockSourceId"},
  417. {14, nullptr, "SetExternalSteadyClockSourceId"},
  418. {15, nullptr, "GetUserSystemClockContext"},
  419. {16, nullptr, "SetUserSystemClockContext"},
  420. {17, &SET_SYS::GetAccountSettings, "GetAccountSettings"},
  421. {18, &SET_SYS::SetAccountSettings, "SetAccountSettings"},
  422. {19, nullptr, "GetAudioVolume"},
  423. {20, nullptr, "SetAudioVolume"},
  424. {21, &SET_SYS::GetEulaVersions, "GetEulaVersions"},
  425. {22, &SET_SYS::SetEulaVersions, "SetEulaVersions"},
  426. {23, &SET_SYS::GetColorSetId, "GetColorSetId"},
  427. {24, &SET_SYS::SetColorSetId, "SetColorSetId"},
  428. {25, nullptr, "GetConsoleInformationUploadFlag"},
  429. {26, nullptr, "SetConsoleInformationUploadFlag"},
  430. {27, nullptr, "GetAutomaticApplicationDownloadFlag"},
  431. {28, nullptr, "SetAutomaticApplicationDownloadFlag"},
  432. {29, &SET_SYS::GetNotificationSettings, "GetNotificationSettings"},
  433. {30, &SET_SYS::SetNotificationSettings, "SetNotificationSettings"},
  434. {31, &SET_SYS::GetAccountNotificationSettings, "GetAccountNotificationSettings"},
  435. {32, &SET_SYS::SetAccountNotificationSettings, "SetAccountNotificationSettings"},
  436. {35, nullptr, "GetVibrationMasterVolume"},
  437. {36, nullptr, "SetVibrationMasterVolume"},
  438. {37, &SET_SYS::GetSettingsItemValueSize, "GetSettingsItemValueSize"},
  439. {38, &SET_SYS::GetSettingsItemValue, "GetSettingsItemValue"},
  440. {39, &SET_SYS::GetTvSettings, "GetTvSettings"},
  441. {40, &SET_SYS::SetTvSettings, "SetTvSettings"},
  442. {41, nullptr, "GetEdid"},
  443. {42, nullptr, "SetEdid"},
  444. {43, nullptr, "GetAudioOutputMode"},
  445. {44, nullptr, "SetAudioOutputMode"},
  446. {45, nullptr, "IsForceMuteOnHeadphoneRemoved"},
  447. {46, nullptr, "SetForceMuteOnHeadphoneRemoved"},
  448. {47, &SET_SYS::GetQuestFlag, "GetQuestFlag"},
  449. {48, nullptr, "SetQuestFlag"},
  450. {49, nullptr, "GetDataDeletionSettings"},
  451. {50, nullptr, "SetDataDeletionSettings"},
  452. {51, nullptr, "GetInitialSystemAppletProgramId"},
  453. {52, nullptr, "GetOverlayDispProgramId"},
  454. {53, nullptr, "GetDeviceTimeZoneLocationName"},
  455. {54, nullptr, "SetDeviceTimeZoneLocationName"},
  456. {55, nullptr, "GetWirelessCertificationFileSize"},
  457. {56, nullptr, "GetWirelessCertificationFile"},
  458. {57, &SET_SYS::SetRegionCode, "SetRegionCode"},
  459. {58, nullptr, "GetNetworkSystemClockContext"},
  460. {59, nullptr, "SetNetworkSystemClockContext"},
  461. {60, nullptr, "IsUserSystemClockAutomaticCorrectionEnabled"},
  462. {61, nullptr, "SetUserSystemClockAutomaticCorrectionEnabled"},
  463. {62, nullptr, "GetDebugModeFlag"},
  464. {63, &SET_SYS::GetPrimaryAlbumStorage, "GetPrimaryAlbumStorage"},
  465. {64, nullptr, "SetPrimaryAlbumStorage"},
  466. {65, nullptr, "GetUsb30EnableFlag"},
  467. {66, nullptr, "SetUsb30EnableFlag"},
  468. {67, nullptr, "GetBatteryLot"},
  469. {68, nullptr, "GetSerialNumber"},
  470. {69, nullptr, "GetNfcEnableFlag"},
  471. {70, nullptr, "SetNfcEnableFlag"},
  472. {71, &SET_SYS::GetSleepSettings, "GetSleepSettings"},
  473. {72, &SET_SYS::SetSleepSettings, "SetSleepSettings"},
  474. {73, nullptr, "GetWirelessLanEnableFlag"},
  475. {74, nullptr, "SetWirelessLanEnableFlag"},
  476. {75, &SET_SYS::GetInitialLaunchSettings, "GetInitialLaunchSettings"},
  477. {76, &SET_SYS::SetInitialLaunchSettings, "SetInitialLaunchSettings"},
  478. {77, &SET_SYS::GetDeviceNickName, "GetDeviceNickName"},
  479. {78, &SET_SYS::SetDeviceNickName, "SetDeviceNickName"},
  480. {79, &SET_SYS::GetProductModel, "GetProductModel"},
  481. {80, nullptr, "GetLdnChannel"},
  482. {81, nullptr, "SetLdnChannel"},
  483. {82, nullptr, "AcquireTelemetryDirtyFlagEventHandle"},
  484. {83, nullptr, "GetTelemetryDirtyFlags"},
  485. {84, nullptr, "GetPtmBatteryLot"},
  486. {85, nullptr, "SetPtmBatteryLot"},
  487. {86, nullptr, "GetPtmFuelGaugeParameter"},
  488. {87, nullptr, "SetPtmFuelGaugeParameter"},
  489. {88, nullptr, "GetBluetoothEnableFlag"},
  490. {89, nullptr, "SetBluetoothEnableFlag"},
  491. {90, &SET_SYS::GetMiiAuthorId, "GetMiiAuthorId"},
  492. {91, nullptr, "SetShutdownRtcValue"},
  493. {92, nullptr, "GetShutdownRtcValue"},
  494. {93, nullptr, "AcquireFatalDirtyFlagEventHandle"},
  495. {94, nullptr, "GetFatalDirtyFlags"},
  496. {95, &SET_SYS::GetAutoUpdateEnableFlag, "GetAutoUpdateEnableFlag"},
  497. {96, nullptr, "SetAutoUpdateEnableFlag"},
  498. {97, nullptr, "GetNxControllerSettings"},
  499. {98, nullptr, "SetNxControllerSettings"},
  500. {99, &SET_SYS::GetBatteryPercentageFlag, "GetBatteryPercentageFlag"},
  501. {100, nullptr, "SetBatteryPercentageFlag"},
  502. {101, nullptr, "GetExternalRtcResetFlag"},
  503. {102, nullptr, "SetExternalRtcResetFlag"},
  504. {103, nullptr, "GetUsbFullKeyEnableFlag"},
  505. {104, nullptr, "SetUsbFullKeyEnableFlag"},
  506. {105, nullptr, "SetExternalSteadyClockInternalOffset"},
  507. {106, nullptr, "GetExternalSteadyClockInternalOffset"},
  508. {107, nullptr, "GetBacklightSettingsEx"},
  509. {108, nullptr, "SetBacklightSettingsEx"},
  510. {109, nullptr, "GetHeadphoneVolumeWarningCount"},
  511. {110, nullptr, "SetHeadphoneVolumeWarningCount"},
  512. {111, nullptr, "GetBluetoothAfhEnableFlag"},
  513. {112, nullptr, "SetBluetoothAfhEnableFlag"},
  514. {113, nullptr, "GetBluetoothBoostEnableFlag"},
  515. {114, nullptr, "SetBluetoothBoostEnableFlag"},
  516. {115, nullptr, "GetInRepairProcessEnableFlag"},
  517. {116, nullptr, "SetInRepairProcessEnableFlag"},
  518. {117, nullptr, "GetHeadphoneVolumeUpdateFlag"},
  519. {118, nullptr, "SetHeadphoneVolumeUpdateFlag"},
  520. {119, nullptr, "NeedsToUpdateHeadphoneVolume"},
  521. {120, nullptr, "GetPushNotificationActivityModeOnSleep"},
  522. {121, nullptr, "SetPushNotificationActivityModeOnSleep"},
  523. {122, nullptr, "GetServiceDiscoveryControlSettings"},
  524. {123, nullptr, "SetServiceDiscoveryControlSettings"},
  525. {124, &SET_SYS::GetErrorReportSharePermission, "GetErrorReportSharePermission"},
  526. {125, nullptr, "SetErrorReportSharePermission"},
  527. {126, &SET_SYS::GetAppletLaunchFlags, "GetAppletLaunchFlags"},
  528. {127, &SET_SYS::SetAppletLaunchFlags, "SetAppletLaunchFlags"},
  529. {128, nullptr, "GetConsoleSixAxisSensorAccelerationBias"},
  530. {129, nullptr, "SetConsoleSixAxisSensorAccelerationBias"},
  531. {130, nullptr, "GetConsoleSixAxisSensorAngularVelocityBias"},
  532. {131, nullptr, "SetConsoleSixAxisSensorAngularVelocityBias"},
  533. {132, nullptr, "GetConsoleSixAxisSensorAccelerationGain"},
  534. {133, nullptr, "SetConsoleSixAxisSensorAccelerationGain"},
  535. {134, nullptr, "GetConsoleSixAxisSensorAngularVelocityGain"},
  536. {135, nullptr, "SetConsoleSixAxisSensorAngularVelocityGain"},
  537. {136, &SET_SYS::GetKeyboardLayout, "GetKeyboardLayout"},
  538. {137, nullptr, "SetKeyboardLayout"},
  539. {138, nullptr, "GetWebInspectorFlag"},
  540. {139, nullptr, "GetAllowedSslHosts"},
  541. {140, nullptr, "GetHostFsMountPoint"},
  542. {141, nullptr, "GetRequiresRunRepairTimeReviser"},
  543. {142, nullptr, "SetRequiresRunRepairTimeReviser"},
  544. {143, nullptr, "SetBlePairingSettings"},
  545. {144, nullptr, "GetBlePairingSettings"},
  546. {145, nullptr, "GetConsoleSixAxisSensorAngularVelocityTimeBias"},
  547. {146, nullptr, "SetConsoleSixAxisSensorAngularVelocityTimeBias"},
  548. {147, nullptr, "GetConsoleSixAxisSensorAngularAcceleration"},
  549. {148, nullptr, "SetConsoleSixAxisSensorAngularAcceleration"},
  550. {149, nullptr, "GetRebootlessSystemUpdateVersion"},
  551. {150, nullptr, "GetDeviceTimeZoneLocationUpdatedTime"},
  552. {151, nullptr, "SetDeviceTimeZoneLocationUpdatedTime"},
  553. {152, nullptr, "GetUserSystemClockAutomaticCorrectionUpdatedTime"},
  554. {153, nullptr, "SetUserSystemClockAutomaticCorrectionUpdatedTime"},
  555. {154, nullptr, "GetAccountOnlineStorageSettings"},
  556. {155, nullptr, "SetAccountOnlineStorageSettings"},
  557. {156, nullptr, "GetPctlReadyFlag"},
  558. {157, nullptr, "SetPctlReadyFlag"},
  559. {158, nullptr, "GetAnalogStickUserCalibrationL"},
  560. {159, nullptr, "SetAnalogStickUserCalibrationL"},
  561. {160, nullptr, "GetAnalogStickUserCalibrationR"},
  562. {161, nullptr, "SetAnalogStickUserCalibrationR"},
  563. {162, nullptr, "GetPtmBatteryVersion"},
  564. {163, nullptr, "SetPtmBatteryVersion"},
  565. {164, nullptr, "GetUsb30HostEnableFlag"},
  566. {165, nullptr, "SetUsb30HostEnableFlag"},
  567. {166, nullptr, "GetUsb30DeviceEnableFlag"},
  568. {167, nullptr, "SetUsb30DeviceEnableFlag"},
  569. {168, nullptr, "GetThemeId"},
  570. {169, nullptr, "SetThemeId"},
  571. {170, &SET_SYS::GetChineseTraditionalInputMethod, "GetChineseTraditionalInputMethod"},
  572. {171, nullptr, "SetChineseTraditionalInputMethod"},
  573. {172, nullptr, "GetPtmCycleCountReliability"},
  574. {173, nullptr, "SetPtmCycleCountReliability"},
  575. {174, &SET_SYS::GetHomeMenuScheme, "GetHomeMenuScheme"},
  576. {175, nullptr, "GetThemeSettings"},
  577. {176, nullptr, "SetThemeSettings"},
  578. {177, nullptr, "GetThemeKey"},
  579. {178, nullptr, "SetThemeKey"},
  580. {179, nullptr, "GetZoomFlag"},
  581. {180, nullptr, "SetZoomFlag"},
  582. {181, nullptr, "GetT"},
  583. {182, nullptr, "SetT"},
  584. {183, nullptr, "GetPlatformRegion"},
  585. {184, nullptr, "SetPlatformRegion"},
  586. {185, &SET_SYS::GetHomeMenuSchemeModel, "GetHomeMenuSchemeModel"},
  587. {186, nullptr, "GetMemoryUsageRateFlag"},
  588. {187, nullptr, "GetTouchScreenMode"},
  589. {188, nullptr, "SetTouchScreenMode"},
  590. {189, nullptr, "GetButtonConfigSettingsFull"},
  591. {190, nullptr, "SetButtonConfigSettingsFull"},
  592. {191, nullptr, "GetButtonConfigSettingsEmbedded"},
  593. {192, nullptr, "SetButtonConfigSettingsEmbedded"},
  594. {193, nullptr, "GetButtonConfigSettingsLeft"},
  595. {194, nullptr, "SetButtonConfigSettingsLeft"},
  596. {195, nullptr, "GetButtonConfigSettingsRight"},
  597. {196, nullptr, "SetButtonConfigSettingsRight"},
  598. {197, nullptr, "GetButtonConfigRegisteredSettingsEmbedded"},
  599. {198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"},
  600. {199, nullptr, "GetButtonConfigRegisteredSettings"},
  601. {200, nullptr, "SetButtonConfigRegisteredSettings"},
  602. {201, &SET_SYS::GetFieldTestingFlag, "GetFieldTestingFlag"},
  603. {202, nullptr, "SetFieldTestingFlag"},
  604. {203, nullptr, "GetPanelCrcMode"},
  605. {204, nullptr, "SetPanelCrcMode"},
  606. {205, nullptr, "GetNxControllerSettingsEx"},
  607. {206, nullptr, "SetNxControllerSettingsEx"},
  608. {207, nullptr, "GetHearingProtectionSafeguardFlag"},
  609. {208, nullptr, "SetHearingProtectionSafeguardFlag"},
  610. {209, nullptr, "GetHearingProtectionSafeguardRemainingTime"},
  611. {210, nullptr, "SetHearingProtectionSafeguardRemainingTime"},
  612. };
  613. // clang-format on
  614. RegisterHandlers(functions);
  615. }
  616. SET_SYS::~SET_SYS() = default;
  617. } // namespace Service::Set