summaryrefslogtreecommitdiff
path: root/src/core/hle/service/set
diff options
context:
space:
mode:
authorGravatar liamwhite2024-01-26 09:55:47 -0500
committerGravatar GitHub2024-01-26 09:55:47 -0500
commit4d206d849ec0ac2e90226eb67d90b310afd0a269 (patch)
treebb292c61287e988e13dfd5feaecaa6503d932baf /src/core/hle/service/set
parentMerge pull request #12801 from german77/vibration-fix (diff)
parentservice: set: Implement more settings functions for Qlaunch (diff)
downloadyuzu-4d206d849ec0ac2e90226eb67d90b310afd0a269.tar.gz
yuzu-4d206d849ec0ac2e90226eb67d90b310afd0a269.tar.xz
yuzu-4d206d849ec0ac2e90226eb67d90b310afd0a269.zip
Merge pull request #12765 from german77/sys-hid
service: set: Implement more settings functions for Qlaunch
Diffstat (limited to 'src/core/hle/service/set')
-rw-r--r--src/core/hle/service/set/setting_formats/system_settings.cpp1
-rw-r--r--src/core/hle/service/set/settings_types.h9
-rw-r--r--src/core/hle/service/set/system_settings_server.cpp175
-rw-r--r--src/core/hle/service/set/system_settings_server.h36
4 files changed, 161 insertions, 60 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 ec00b90a6..88a305f03 100644
--- a/src/core/hle/service/set/setting_formats/system_settings.cpp
+++ b/src/core/hle/service/set/setting_formats/system_settings.cpp
@@ -50,6 +50,7 @@ SystemSettings DefaultSystemSettings() {
50 settings.primary_album_storage = PrimaryAlbumStorage::SdCard; 50 settings.primary_album_storage = PrimaryAlbumStorage::SdCard;
51 settings.battery_percentage_flag = true; 51 settings.battery_percentage_flag = true;
52 settings.chinese_traditional_input_method = ChineseTraditionalInputMethod::Unknown0; 52 settings.chinese_traditional_input_method = ChineseTraditionalInputMethod::Unknown0;
53 settings.vibration_master_volume = 1.0f;
53 54
54 return settings; 55 return settings;
55} 56}
diff --git a/src/core/hle/service/set/settings_types.h b/src/core/hle/service/set/settings_types.h
index f6f227fde..968425319 100644
--- a/src/core/hle/service/set/settings_types.h
+++ b/src/core/hle/service/set/settings_types.h
@@ -323,6 +323,15 @@ struct NotificationFlag {
323}; 323};
324static_assert(sizeof(NotificationFlag) == 4, "NotificationFlag is an invalid size"); 324static_assert(sizeof(NotificationFlag) == 4, "NotificationFlag is an invalid size");
325 325
326struct PlatformConfig {
327 union {
328 u32 raw{};
329 BitField<0, 1, u32> has_rail_interface;
330 BitField<1, 1, u32> has_sio_mcu;
331 };
332};
333static_assert(sizeof(PlatformConfig) == 0x4, "PlatformConfig is an invalid size");
334
326/// This is nn::settings::system::TvFlag 335/// This is nn::settings::system::TvFlag
327struct TvFlag { 336struct TvFlag {
328 union { 337 union {
diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp
index b527c39a9..e907b57b6 100644
--- a/src/core/hle/service/set/system_settings_server.cpp
+++ b/src/core/hle/service/set/system_settings_server.cpp
@@ -123,8 +123,8 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
123 {30, &ISystemSettingsServer::SetNotificationSettings, "SetNotificationSettings"}, 123 {30, &ISystemSettingsServer::SetNotificationSettings, "SetNotificationSettings"},
124 {31, &ISystemSettingsServer::GetAccountNotificationSettings, "GetAccountNotificationSettings"}, 124 {31, &ISystemSettingsServer::GetAccountNotificationSettings, "GetAccountNotificationSettings"},
125 {32, &ISystemSettingsServer::SetAccountNotificationSettings, "SetAccountNotificationSettings"}, 125 {32, &ISystemSettingsServer::SetAccountNotificationSettings, "SetAccountNotificationSettings"},
126 {35, nullptr, "GetVibrationMasterVolume"}, 126 {35, &ISystemSettingsServer::GetVibrationMasterVolume, "GetVibrationMasterVolume"},
127 {36, nullptr, "SetVibrationMasterVolume"}, 127 {36, &ISystemSettingsServer::SetVibrationMasterVolume, "SetVibrationMasterVolume"},
128 {37, &ISystemSettingsServer::GetSettingsItemValueSize, "GetSettingsItemValueSize"}, 128 {37, &ISystemSettingsServer::GetSettingsItemValueSize, "GetSettingsItemValueSize"},
129 {38, &ISystemSettingsServer::GetSettingsItemValue, "GetSettingsItemValue"}, 129 {38, &ISystemSettingsServer::GetSettingsItemValue, "GetSettingsItemValue"},
130 {39, &ISystemSettingsServer::GetTvSettings, "GetTvSettings"}, 130 {39, &ISystemSettingsServer::GetTvSettings, "GetTvSettings"},
@@ -133,10 +133,10 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
133 {42, nullptr, "SetEdid"}, 133 {42, nullptr, "SetEdid"},
134 {43, nullptr, "GetAudioOutputMode"}, 134 {43, nullptr, "GetAudioOutputMode"},
135 {44, nullptr, "SetAudioOutputMode"}, 135 {44, nullptr, "SetAudioOutputMode"},
136 {45, nullptr, "IsForceMuteOnHeadphoneRemoved"}, 136 {45, &ISystemSettingsServer::IsForceMuteOnHeadphoneRemoved, "IsForceMuteOnHeadphoneRemoved"},
137 {46, nullptr, "SetForceMuteOnHeadphoneRemoved"}, 137 {46, &ISystemSettingsServer::SetForceMuteOnHeadphoneRemoved, "SetForceMuteOnHeadphoneRemoved"},
138 {47, &ISystemSettingsServer::GetQuestFlag, "GetQuestFlag"}, 138 {47, &ISystemSettingsServer::GetQuestFlag, "GetQuestFlag"},
139 {48, nullptr, "SetQuestFlag"}, 139 {48, &ISystemSettingsServer::SetQuestFlag, "SetQuestFlag"},
140 {49, nullptr, "GetDataDeletionSettings"}, 140 {49, nullptr, "GetDataDeletionSettings"},
141 {50, nullptr, "SetDataDeletionSettings"}, 141 {50, nullptr, "SetDataDeletionSettings"},
142 {51, nullptr, "GetInitialSystemAppletProgramId"}, 142 {51, nullptr, "GetInitialSystemAppletProgramId"},
@@ -152,7 +152,7 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
152 {61, &ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled, "SetUserSystemClockAutomaticCorrectionEnabled"}, 152 {61, &ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled, "SetUserSystemClockAutomaticCorrectionEnabled"},
153 {62, &ISystemSettingsServer::GetDebugModeFlag, "GetDebugModeFlag"}, 153 {62, &ISystemSettingsServer::GetDebugModeFlag, "GetDebugModeFlag"},
154 {63, &ISystemSettingsServer::GetPrimaryAlbumStorage, "GetPrimaryAlbumStorage"}, 154 {63, &ISystemSettingsServer::GetPrimaryAlbumStorage, "GetPrimaryAlbumStorage"},
155 {64, nullptr, "SetPrimaryAlbumStorage"}, 155 {64, &ISystemSettingsServer::SetPrimaryAlbumStorage, "SetPrimaryAlbumStorage"},
156 {65, nullptr, "GetUsb30EnableFlag"}, 156 {65, nullptr, "GetUsb30EnableFlag"},
157 {66, nullptr, "SetUsb30EnableFlag"}, 157 {66, nullptr, "SetUsb30EnableFlag"},
158 {67, nullptr, "GetBatteryLot"}, 158 {67, nullptr, "GetBatteryLot"},
@@ -467,7 +467,7 @@ void ISystemSettingsServer::GetExternalSteadyClockSourceId(HLERequestContext& ct
467 LOG_INFO(Service_SET, "called"); 467 LOG_INFO(Service_SET, "called");
468 468
469 Common::UUID id{}; 469 Common::UUID id{};
470 auto res = GetExternalSteadyClockSourceId(id); 470 const auto res = GetExternalSteadyClockSourceId(id);
471 471
472 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Common::UUID) / sizeof(u32)}; 472 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Common::UUID) / sizeof(u32)};
473 rb.Push(res); 473 rb.Push(res);
@@ -478,9 +478,9 @@ void ISystemSettingsServer::SetExternalSteadyClockSourceId(HLERequestContext& ct
478 LOG_INFO(Service_SET, "called"); 478 LOG_INFO(Service_SET, "called");
479 479
480 IPC::RequestParser rp{ctx}; 480 IPC::RequestParser rp{ctx};
481 auto id{rp.PopRaw<Common::UUID>()}; 481 const auto id{rp.PopRaw<Common::UUID>()};
482 482
483 auto res = SetExternalSteadyClockSourceId(id); 483 const auto res = SetExternalSteadyClockSourceId(id);
484 484
485 IPC::ResponseBuilder rb{ctx, 2}; 485 IPC::ResponseBuilder rb{ctx, 2};
486 rb.Push(res); 486 rb.Push(res);
@@ -490,7 +490,7 @@ void ISystemSettingsServer::GetUserSystemClockContext(HLERequestContext& ctx) {
490 LOG_INFO(Service_SET, "called"); 490 LOG_INFO(Service_SET, "called");
491 491
492 Service::PSC::Time::SystemClockContext context{}; 492 Service::PSC::Time::SystemClockContext context{};
493 auto res = GetUserSystemClockContext(context); 493 const auto res = GetUserSystemClockContext(context);
494 494
495 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::SystemClockContext) / sizeof(u32)}; 495 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::SystemClockContext) / sizeof(u32)};
496 rb.Push(res); 496 rb.Push(res);
@@ -501,9 +501,9 @@ void ISystemSettingsServer::SetUserSystemClockContext(HLERequestContext& ctx) {
501 LOG_INFO(Service_SET, "called"); 501 LOG_INFO(Service_SET, "called");
502 502
503 IPC::RequestParser rp{ctx}; 503 IPC::RequestParser rp{ctx};
504 auto context{rp.PopRaw<Service::PSC::Time::SystemClockContext>()}; 504 const auto context{rp.PopRaw<Service::PSC::Time::SystemClockContext>()};
505 505
506 auto res = SetUserSystemClockContext(context); 506 const auto res = SetUserSystemClockContext(context);
507 507
508 IPC::ResponseBuilder rb{ctx, 2}; 508 IPC::ResponseBuilder rb{ctx, 2};
509 rb.Push(res); 509 rb.Push(res);
@@ -652,6 +652,29 @@ void ISystemSettingsServer::SetAccountNotificationSettings(HLERequestContext& ct
652 rb.Push(ResultSuccess); 652 rb.Push(ResultSuccess);
653} 653}
654 654
655void ISystemSettingsServer::GetVibrationMasterVolume(HLERequestContext& ctx) {
656 f32 vibration_master_volume = {};
657 const auto result = GetVibrationMasterVolume(vibration_master_volume);
658
659 LOG_INFO(Service_SET, "called, master_volume={}", vibration_master_volume);
660
661 IPC::ResponseBuilder rb{ctx, 3};
662 rb.Push(result);
663 rb.Push(vibration_master_volume);
664}
665
666void ISystemSettingsServer::SetVibrationMasterVolume(HLERequestContext& ctx) {
667 IPC::RequestParser rp{ctx};
668 const auto vibration_master_volume = rp.PopRaw<f32>();
669
670 LOG_INFO(Service_SET, "called, elements={}", m_system_settings.vibration_master_volume);
671
672 const auto result = SetVibrationMasterVolume(vibration_master_volume);
673
674 IPC::ResponseBuilder rb{ctx, 2};
675 rb.Push(result);
676}
677
655// FIXME: implement support for the real system_settings.ini 678// FIXME: implement support for the real system_settings.ini
656 679
657template <typename T> 680template <typename T>
@@ -683,6 +706,8 @@ static Settings GetSettings() {
683 ret["time"]["standard_user_clock_initial_year"] = ToBytes(s32{2023}); 706 ret["time"]["standard_user_clock_initial_year"] = ToBytes(s32{2023});
684 707
685 // HID 708 // HID
709 ret["hid"]["has_rail_interface"] = ToBytes(bool{true});
710 ret["hid"]["has_sio_mcu"] = ToBytes(bool{true});
686 ret["hid_debug"]["enables_debugpad"] = ToBytes(bool{true}); 711 ret["hid_debug"]["enables_debugpad"] = ToBytes(bool{true});
687 ret["hid_debug"]["manages_devices"] = ToBytes(bool{true}); 712 ret["hid_debug"]["manages_devices"] = ToBytes(bool{true});
688 ret["hid_debug"]["manages_touch_ic_i2c"] = ToBytes(bool{true}); 713 ret["hid_debug"]["manages_touch_ic_i2c"] = ToBytes(bool{true});
@@ -700,6 +725,9 @@ static Settings GetSettings() {
700 // Settings 725 // Settings
701 ret["settings_debug"]["is_debug_mode_enabled"] = ToBytes(bool{false}); 726 ret["settings_debug"]["is_debug_mode_enabled"] = ToBytes(bool{false});
702 727
728 // Error
729 ret["err"]["applet_auto_close"] = ToBytes(bool{false});
730
703 return ret; 731 return ret;
704} 732}
705 733
@@ -786,15 +814,25 @@ void ISystemSettingsServer::SetTvSettings(HLERequestContext& ctx) {
786 rb.Push(ResultSuccess); 814 rb.Push(ResultSuccess);
787} 815}
788 816
789void ISystemSettingsServer::GetDebugModeFlag(HLERequestContext& ctx) { 817void ISystemSettingsServer::IsForceMuteOnHeadphoneRemoved(HLERequestContext& ctx) {
790 bool is_debug_mode_enabled = false; 818 LOG_INFO(Service_SET, "called, force_mute_on_headphone_removed={}",
791 GetSettingsItemValue<bool>(is_debug_mode_enabled, "settings_debug", "is_debug_mode_enabled"); 819 m_system_settings.force_mute_on_headphone_removed);
792
793 LOG_DEBUG(Service_SET, "called, is_debug_mode_enabled={}", is_debug_mode_enabled);
794 820
795 IPC::ResponseBuilder rb{ctx, 3}; 821 IPC::ResponseBuilder rb{ctx, 3};
796 rb.Push(ResultSuccess); 822 rb.Push(ResultSuccess);
797 rb.Push(is_debug_mode_enabled); 823 rb.PushRaw(m_system_settings.force_mute_on_headphone_removed);
824}
825
826void ISystemSettingsServer::SetForceMuteOnHeadphoneRemoved(HLERequestContext& ctx) {
827 IPC::RequestParser rp{ctx};
828 m_system_settings.force_mute_on_headphone_removed = rp.PopRaw<bool>();
829 SetSaveNeeded();
830
831 LOG_INFO(Service_SET, "called, force_mute_on_headphone_removed={}",
832 m_system_settings.force_mute_on_headphone_removed);
833
834 IPC::ResponseBuilder rb{ctx, 2};
835 rb.Push(ResultSuccess);
798} 836}
799 837
800void ISystemSettingsServer::GetQuestFlag(HLERequestContext& ctx) { 838void ISystemSettingsServer::GetQuestFlag(HLERequestContext& ctx) {
@@ -805,11 +843,22 @@ void ISystemSettingsServer::GetQuestFlag(HLERequestContext& ctx) {
805 rb.PushEnum(m_system_settings.quest_flag); 843 rb.PushEnum(m_system_settings.quest_flag);
806} 844}
807 845
846void ISystemSettingsServer::SetQuestFlag(HLERequestContext& ctx) {
847 IPC::RequestParser rp{ctx};
848 m_system_settings.quest_flag = rp.PopEnum<QuestFlag>();
849 SetSaveNeeded();
850
851 LOG_INFO(Service_SET, "called, quest_flag={}", m_system_settings.quest_flag);
852
853 IPC::ResponseBuilder rb{ctx, 2};
854 rb.Push(ResultSuccess);
855}
856
808void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx) { 857void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx) {
809 LOG_INFO(Service_SET, "called"); 858 LOG_INFO(Service_SET, "called");
810 859
811 Service::PSC::Time::LocationName name{}; 860 Service::PSC::Time::LocationName name{};
812 auto res = GetDeviceTimeZoneLocationName(name); 861 const auto res = GetDeviceTimeZoneLocationName(name);
813 862
814 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::LocationName) / sizeof(u32)}; 863 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::LocationName) / sizeof(u32)};
815 rb.Push(res); 864 rb.Push(res);
@@ -822,7 +871,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx
822 IPC::RequestParser rp{ctx}; 871 IPC::RequestParser rp{ctx};
823 auto name{rp.PopRaw<Service::PSC::Time::LocationName>()}; 872 auto name{rp.PopRaw<Service::PSC::Time::LocationName>()};
824 873
825 auto res = SetDeviceTimeZoneLocationName(name); 874 const auto res = SetDeviceTimeZoneLocationName(name);
826 875
827 IPC::ResponseBuilder rb{ctx, 2}; 876 IPC::ResponseBuilder rb{ctx, 2};
828 rb.Push(res); 877 rb.Push(res);
@@ -843,7 +892,7 @@ void ISystemSettingsServer::GetNetworkSystemClockContext(HLERequestContext& ctx)
843 LOG_INFO(Service_SET, "called"); 892 LOG_INFO(Service_SET, "called");
844 893
845 Service::PSC::Time::SystemClockContext context{}; 894 Service::PSC::Time::SystemClockContext context{};
846 auto res = GetNetworkSystemClockContext(context); 895 const auto res = GetNetworkSystemClockContext(context);
847 896
848 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::SystemClockContext) / sizeof(u32)}; 897 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::SystemClockContext) / sizeof(u32)};
849 rb.Push(res); 898 rb.Push(res);
@@ -854,9 +903,9 @@ void ISystemSettingsServer::SetNetworkSystemClockContext(HLERequestContext& ctx)
854 LOG_INFO(Service_SET, "called"); 903 LOG_INFO(Service_SET, "called");
855 904
856 IPC::RequestParser rp{ctx}; 905 IPC::RequestParser rp{ctx};
857 auto context{rp.PopRaw<Service::PSC::Time::SystemClockContext>()}; 906 const auto context{rp.PopRaw<Service::PSC::Time::SystemClockContext>()};
858 907
859 auto res = SetNetworkSystemClockContext(context); 908 const auto res = SetNetworkSystemClockContext(context);
860 909
861 IPC::ResponseBuilder rb{ctx, 2}; 910 IPC::ResponseBuilder rb{ctx, 2};
862 rb.Push(res); 911 rb.Push(res);
@@ -866,7 +915,7 @@ void ISystemSettingsServer::IsUserSystemClockAutomaticCorrectionEnabled(HLEReque
866 LOG_INFO(Service_SET, "called"); 915 LOG_INFO(Service_SET, "called");
867 916
868 bool enabled{}; 917 bool enabled{};
869 auto res = IsUserSystemClockAutomaticCorrectionEnabled(enabled); 918 const auto res = IsUserSystemClockAutomaticCorrectionEnabled(enabled);
870 919
871 IPC::ResponseBuilder rb{ctx, 3}; 920 IPC::ResponseBuilder rb{ctx, 3};
872 rb.Push(res); 921 rb.Push(res);
@@ -879,12 +928,23 @@ void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionEnabled(HLERequ
879 IPC::RequestParser rp{ctx}; 928 IPC::RequestParser rp{ctx};
880 auto enabled{rp.Pop<bool>()}; 929 auto enabled{rp.Pop<bool>()};
881 930
882 auto res = SetUserSystemClockAutomaticCorrectionEnabled(enabled); 931 const auto res = SetUserSystemClockAutomaticCorrectionEnabled(enabled);
883 932
884 IPC::ResponseBuilder rb{ctx, 2}; 933 IPC::ResponseBuilder rb{ctx, 2};
885 rb.Push(res); 934 rb.Push(res);
886} 935}
887 936
937void ISystemSettingsServer::GetDebugModeFlag(HLERequestContext& ctx) {
938 bool is_debug_mode_enabled = false;
939 GetSettingsItemValue<bool>(is_debug_mode_enabled, "settings_debug", "is_debug_mode_enabled");
940
941 LOG_DEBUG(Service_SET, "called, is_debug_mode_enabled={}", is_debug_mode_enabled);
942
943 IPC::ResponseBuilder rb{ctx, 3};
944 rb.Push(ResultSuccess);
945 rb.Push(is_debug_mode_enabled);
946}
947
888void ISystemSettingsServer::GetPrimaryAlbumStorage(HLERequestContext& ctx) { 948void ISystemSettingsServer::GetPrimaryAlbumStorage(HLERequestContext& ctx) {
889 LOG_INFO(Service_SET, "called, primary_album_storage={}", 949 LOG_INFO(Service_SET, "called, primary_album_storage={}",
890 m_system_settings.primary_album_storage); 950 m_system_settings.primary_album_storage);
@@ -894,6 +954,18 @@ void ISystemSettingsServer::GetPrimaryAlbumStorage(HLERequestContext& ctx) {
894 rb.PushEnum(m_system_settings.primary_album_storage); 954 rb.PushEnum(m_system_settings.primary_album_storage);
895} 955}
896 956
957void ISystemSettingsServer::SetPrimaryAlbumStorage(HLERequestContext& ctx) {
958 IPC::RequestParser rp{ctx};
959 m_system_settings.primary_album_storage = rp.PopEnum<PrimaryAlbumStorage>();
960 SetSaveNeeded();
961
962 LOG_INFO(Service_SET, "called, primary_album_storage={}",
963 m_system_settings.primary_album_storage);
964
965 IPC::ResponseBuilder rb{ctx, 2};
966 rb.Push(ResultSuccess);
967}
968
897void ISystemSettingsServer::GetNfcEnableFlag(HLERequestContext& ctx) { 969void ISystemSettingsServer::GetNfcEnableFlag(HLERequestContext& ctx) {
898 LOG_INFO(Service_SET, "called, nfc_enable_flag={}", m_system_settings.nfc_enable_flag); 970 LOG_INFO(Service_SET, "called, nfc_enable_flag={}", m_system_settings.nfc_enable_flag);
899 971
@@ -1072,7 +1144,7 @@ void ISystemSettingsServer::SetExternalSteadyClockInternalOffset(HLERequestConte
1072 IPC::RequestParser rp{ctx}; 1144 IPC::RequestParser rp{ctx};
1073 auto offset{rp.Pop<s64>()}; 1145 auto offset{rp.Pop<s64>()};
1074 1146
1075 auto res = SetExternalSteadyClockInternalOffset(offset); 1147 const auto res = SetExternalSteadyClockInternalOffset(offset);
1076 1148
1077 IPC::ResponseBuilder rb{ctx, 2}; 1149 IPC::ResponseBuilder rb{ctx, 2};
1078 rb.Push(res); 1150 rb.Push(res);
@@ -1082,7 +1154,7 @@ void ISystemSettingsServer::GetExternalSteadyClockInternalOffset(HLERequestConte
1082 LOG_DEBUG(Service_SET, "called."); 1154 LOG_DEBUG(Service_SET, "called.");
1083 1155
1084 s64 offset{}; 1156 s64 offset{};
1085 auto res = GetExternalSteadyClockInternalOffset(offset); 1157 const auto res = GetExternalSteadyClockInternalOffset(offset);
1086 1158
1087 IPC::ResponseBuilder rb{ctx, 4}; 1159 IPC::ResponseBuilder rb{ctx, 4};
1088 rb.Push(res); 1160 rb.Push(res);
@@ -1140,7 +1212,7 @@ void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestConte
1140 LOG_INFO(Service_SET, "called"); 1212 LOG_INFO(Service_SET, "called");
1141 1213
1142 Service::PSC::Time::SteadyClockTimePoint time_point{}; 1214 Service::PSC::Time::SteadyClockTimePoint time_point{};
1143 auto res = GetDeviceTimeZoneLocationUpdatedTime(time_point); 1215 const auto res = GetDeviceTimeZoneLocationUpdatedTime(time_point);
1144 1216
1145 IPC::ResponseBuilder rb{ctx, 4}; 1217 IPC::ResponseBuilder rb{ctx, 4};
1146 rb.Push(res); 1218 rb.Push(res);
@@ -1153,7 +1225,7 @@ void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestConte
1153 IPC::RequestParser rp{ctx}; 1225 IPC::RequestParser rp{ctx};
1154 auto time_point{rp.PopRaw<Service::PSC::Time::SteadyClockTimePoint>()}; 1226 auto time_point{rp.PopRaw<Service::PSC::Time::SteadyClockTimePoint>()};
1155 1227
1156 auto res = SetDeviceTimeZoneLocationUpdatedTime(time_point); 1228 const auto res = SetDeviceTimeZoneLocationUpdatedTime(time_point);
1157 1229
1158 IPC::ResponseBuilder rb{ctx, 2}; 1230 IPC::ResponseBuilder rb{ctx, 2};
1159 rb.Push(res); 1231 rb.Push(res);
@@ -1164,7 +1236,7 @@ void ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime(
1164 LOG_INFO(Service_SET, "called"); 1236 LOG_INFO(Service_SET, "called");
1165 1237
1166 Service::PSC::Time::SteadyClockTimePoint time_point{}; 1238 Service::PSC::Time::SteadyClockTimePoint time_point{};
1167 auto res = GetUserSystemClockAutomaticCorrectionUpdatedTime(time_point); 1239 const auto res = GetUserSystemClockAutomaticCorrectionUpdatedTime(time_point);
1168 1240
1169 IPC::ResponseBuilder rb{ctx, 4}; 1241 IPC::ResponseBuilder rb{ctx, 4};
1170 rb.Push(res); 1242 rb.Push(res);
@@ -1176,9 +1248,9 @@ void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
1176 LOG_INFO(Service_SET, "called"); 1248 LOG_INFO(Service_SET, "called");
1177 1249
1178 IPC::RequestParser rp{ctx}; 1250 IPC::RequestParser rp{ctx};
1179 auto time_point{rp.PopRaw<Service::PSC::Time::SteadyClockTimePoint>()}; 1251 const auto time_point{rp.PopRaw<Service::PSC::Time::SteadyClockTimePoint>()};
1180 1252
1181 auto res = SetUserSystemClockAutomaticCorrectionUpdatedTime(time_point); 1253 const auto res = SetUserSystemClockAutomaticCorrectionUpdatedTime(time_point);
1182 1254
1183 IPC::ResponseBuilder rb{ctx, 2}; 1255 IPC::ResponseBuilder rb{ctx, 2};
1184 rb.Push(res); 1256 rb.Push(res);
@@ -1304,57 +1376,68 @@ Result ISystemSettingsServer::GetSettingsItemValue(std::vector<u8>& out_value,
1304 R_SUCCEED(); 1376 R_SUCCEED();
1305} 1377}
1306 1378
1307Result ISystemSettingsServer::GetExternalSteadyClockSourceId(Common::UUID& out_id) { 1379Result ISystemSettingsServer::GetVibrationMasterVolume(f32& out_volume) const {
1380 out_volume = m_system_settings.vibration_master_volume;
1381 R_SUCCEED();
1382}
1383
1384Result ISystemSettingsServer::SetVibrationMasterVolume(f32 volume) {
1385 m_system_settings.vibration_master_volume = volume;
1386 SetSaveNeeded();
1387 R_SUCCEED();
1388}
1389
1390Result ISystemSettingsServer::GetExternalSteadyClockSourceId(Common::UUID& out_id) const {
1308 out_id = m_private_settings.external_clock_source_id; 1391 out_id = m_private_settings.external_clock_source_id;
1309 R_SUCCEED(); 1392 R_SUCCEED();
1310} 1393}
1311 1394
1312Result ISystemSettingsServer::SetExternalSteadyClockSourceId(Common::UUID id) { 1395Result ISystemSettingsServer::SetExternalSteadyClockSourceId(const Common::UUID& id) {
1313 m_private_settings.external_clock_source_id = id; 1396 m_private_settings.external_clock_source_id = id;
1314 SetSaveNeeded(); 1397 SetSaveNeeded();
1315 R_SUCCEED(); 1398 R_SUCCEED();
1316} 1399}
1317 1400
1318Result ISystemSettingsServer::GetUserSystemClockContext( 1401Result ISystemSettingsServer::GetUserSystemClockContext(
1319 Service::PSC::Time::SystemClockContext& out_context) { 1402 Service::PSC::Time::SystemClockContext& out_context) const {
1320 out_context = m_system_settings.user_system_clock_context; 1403 out_context = m_system_settings.user_system_clock_context;
1321 R_SUCCEED(); 1404 R_SUCCEED();
1322} 1405}
1323 1406
1324Result ISystemSettingsServer::SetUserSystemClockContext( 1407Result ISystemSettingsServer::SetUserSystemClockContext(
1325 Service::PSC::Time::SystemClockContext& context) { 1408 const Service::PSC::Time::SystemClockContext& context) {
1326 m_system_settings.user_system_clock_context = context; 1409 m_system_settings.user_system_clock_context = context;
1327 SetSaveNeeded(); 1410 SetSaveNeeded();
1328 R_SUCCEED(); 1411 R_SUCCEED();
1329} 1412}
1330 1413
1331Result ISystemSettingsServer::GetDeviceTimeZoneLocationName( 1414Result ISystemSettingsServer::GetDeviceTimeZoneLocationName(
1332 Service::PSC::Time::LocationName& out_name) { 1415 Service::PSC::Time::LocationName& out_name) const {
1333 out_name = m_system_settings.device_time_zone_location_name; 1416 out_name = m_system_settings.device_time_zone_location_name;
1334 R_SUCCEED(); 1417 R_SUCCEED();
1335} 1418}
1336 1419
1337Result ISystemSettingsServer::SetDeviceTimeZoneLocationName( 1420Result ISystemSettingsServer::SetDeviceTimeZoneLocationName(
1338 Service::PSC::Time::LocationName& name) { 1421 const Service::PSC::Time::LocationName& name) {
1339 m_system_settings.device_time_zone_location_name = name; 1422 m_system_settings.device_time_zone_location_name = name;
1340 SetSaveNeeded(); 1423 SetSaveNeeded();
1341 R_SUCCEED(); 1424 R_SUCCEED();
1342} 1425}
1343 1426
1344Result ISystemSettingsServer::GetNetworkSystemClockContext( 1427Result ISystemSettingsServer::GetNetworkSystemClockContext(
1345 Service::PSC::Time::SystemClockContext& out_context) { 1428 Service::PSC::Time::SystemClockContext& out_context) const {
1346 out_context = m_system_settings.network_system_clock_context; 1429 out_context = m_system_settings.network_system_clock_context;
1347 R_SUCCEED(); 1430 R_SUCCEED();
1348} 1431}
1349 1432
1350Result ISystemSettingsServer::SetNetworkSystemClockContext( 1433Result ISystemSettingsServer::SetNetworkSystemClockContext(
1351 Service::PSC::Time::SystemClockContext& context) { 1434 const Service::PSC::Time::SystemClockContext& context) {
1352 m_system_settings.network_system_clock_context = context; 1435 m_system_settings.network_system_clock_context = context;
1353 SetSaveNeeded(); 1436 SetSaveNeeded();
1354 R_SUCCEED(); 1437 R_SUCCEED();
1355} 1438}
1356 1439
1357Result ISystemSettingsServer::IsUserSystemClockAutomaticCorrectionEnabled(bool& out_enabled) { 1440Result ISystemSettingsServer::IsUserSystemClockAutomaticCorrectionEnabled(bool& out_enabled) const {
1358 out_enabled = m_system_settings.user_system_clock_automatic_correction_enabled; 1441 out_enabled = m_system_settings.user_system_clock_automatic_correction_enabled;
1359 R_SUCCEED(); 1442 R_SUCCEED();
1360} 1443}
@@ -1371,32 +1454,32 @@ Result ISystemSettingsServer::SetExternalSteadyClockInternalOffset(s64 offset) {
1371 R_SUCCEED(); 1454 R_SUCCEED();
1372} 1455}
1373 1456
1374Result ISystemSettingsServer::GetExternalSteadyClockInternalOffset(s64& out_offset) { 1457Result ISystemSettingsServer::GetExternalSteadyClockInternalOffset(s64& out_offset) const {
1375 out_offset = m_private_settings.external_steady_clock_internal_offset; 1458 out_offset = m_private_settings.external_steady_clock_internal_offset;
1376 R_SUCCEED(); 1459 R_SUCCEED();
1377} 1460}
1378 1461
1379Result ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime( 1462Result ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(
1380 Service::PSC::Time::SteadyClockTimePoint& out_time_point) { 1463 Service::PSC::Time::SteadyClockTimePoint& out_time_point) const {
1381 out_time_point = m_system_settings.device_time_zone_location_updated_time; 1464 out_time_point = m_system_settings.device_time_zone_location_updated_time;
1382 R_SUCCEED(); 1465 R_SUCCEED();
1383} 1466}
1384 1467
1385Result ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime( 1468Result ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(
1386 Service::PSC::Time::SteadyClockTimePoint& time_point) { 1469 const Service::PSC::Time::SteadyClockTimePoint& time_point) {
1387 m_system_settings.device_time_zone_location_updated_time = time_point; 1470 m_system_settings.device_time_zone_location_updated_time = time_point;
1388 SetSaveNeeded(); 1471 SetSaveNeeded();
1389 R_SUCCEED(); 1472 R_SUCCEED();
1390} 1473}
1391 1474
1392Result ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime( 1475Result ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime(
1393 Service::PSC::Time::SteadyClockTimePoint& out_time_point) { 1476 Service::PSC::Time::SteadyClockTimePoint& out_time_point) const {
1394 out_time_point = m_system_settings.user_system_clock_automatic_correction_updated_time_point; 1477 out_time_point = m_system_settings.user_system_clock_automatic_correction_updated_time_point;
1395 R_SUCCEED(); 1478 R_SUCCEED();
1396} 1479}
1397 1480
1398Result ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime( 1481Result ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
1399 Service::PSC::Time::SteadyClockTimePoint out_time_point) { 1482 const Service::PSC::Time::SteadyClockTimePoint& out_time_point) {
1400 m_system_settings.user_system_clock_automatic_correction_updated_time_point = out_time_point; 1483 m_system_settings.user_system_clock_automatic_correction_updated_time_point = out_time_point;
1401 SetSaveNeeded(); 1484 SetSaveNeeded();
1402 R_SUCCEED(); 1485 R_SUCCEED();
diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h
index a2258d16d..acbda8b8c 100644
--- a/src/core/hle/service/set/system_settings_server.h
+++ b/src/core/hle/service/set/system_settings_server.h
@@ -48,26 +48,28 @@ public:
48 return result; 48 return result;
49 } 49 }
50 50
51 Result GetExternalSteadyClockSourceId(Common::UUID& out_id); 51 Result GetVibrationMasterVolume(f32& out_volume) const;
52 Result SetExternalSteadyClockSourceId(Common::UUID id); 52 Result SetVibrationMasterVolume(f32 volume);
53 Result GetUserSystemClockContext(Service::PSC::Time::SystemClockContext& out_context); 53 Result GetExternalSteadyClockSourceId(Common::UUID& out_id) const;
54 Result SetUserSystemClockContext(Service::PSC::Time::SystemClockContext& context); 54 Result SetExternalSteadyClockSourceId(const Common::UUID& id);
55 Result GetDeviceTimeZoneLocationName(Service::PSC::Time::LocationName& out_name); 55 Result GetUserSystemClockContext(Service::PSC::Time::SystemClockContext& out_context) const;
56 Result SetDeviceTimeZoneLocationName(Service::PSC::Time::LocationName& name); 56 Result SetUserSystemClockContext(const Service::PSC::Time::SystemClockContext& context);
57 Result GetNetworkSystemClockContext(Service::PSC::Time::SystemClockContext& out_context); 57 Result GetDeviceTimeZoneLocationName(Service::PSC::Time::LocationName& out_name) const;
58 Result SetNetworkSystemClockContext(Service::PSC::Time::SystemClockContext& context); 58 Result SetDeviceTimeZoneLocationName(const Service::PSC::Time::LocationName& name);
59 Result IsUserSystemClockAutomaticCorrectionEnabled(bool& out_enabled); 59 Result GetNetworkSystemClockContext(Service::PSC::Time::SystemClockContext& out_context) const;
60 Result SetNetworkSystemClockContext(const Service::PSC::Time::SystemClockContext& context);
61 Result IsUserSystemClockAutomaticCorrectionEnabled(bool& out_enabled) const;
60 Result SetUserSystemClockAutomaticCorrectionEnabled(bool enabled); 62 Result SetUserSystemClockAutomaticCorrectionEnabled(bool enabled);
61 Result SetExternalSteadyClockInternalOffset(s64 offset); 63 Result SetExternalSteadyClockInternalOffset(s64 offset);
62 Result GetExternalSteadyClockInternalOffset(s64& out_offset); 64 Result GetExternalSteadyClockInternalOffset(s64& out_offset) const;
63 Result GetDeviceTimeZoneLocationUpdatedTime( 65 Result GetDeviceTimeZoneLocationUpdatedTime(
64 Service::PSC::Time::SteadyClockTimePoint& out_time_point); 66 Service::PSC::Time::SteadyClockTimePoint& out_time_point) const;
65 Result SetDeviceTimeZoneLocationUpdatedTime( 67 Result SetDeviceTimeZoneLocationUpdatedTime(
66 Service::PSC::Time::SteadyClockTimePoint& time_point); 68 const Service::PSC::Time::SteadyClockTimePoint& time_point);
67 Result GetUserSystemClockAutomaticCorrectionUpdatedTime( 69 Result GetUserSystemClockAutomaticCorrectionUpdatedTime(
68 Service::PSC::Time::SteadyClockTimePoint& out_time_point); 70 Service::PSC::Time::SteadyClockTimePoint& out_time_point) const;
69 Result SetUserSystemClockAutomaticCorrectionUpdatedTime( 71 Result SetUserSystemClockAutomaticCorrectionUpdatedTime(
70 Service::PSC::Time::SteadyClockTimePoint time_point); 72 const Service::PSC::Time::SteadyClockTimePoint& time_point);
71 73
72private: 74private:
73 void SetLanguageCode(HLERequestContext& ctx); 75 void SetLanguageCode(HLERequestContext& ctx);
@@ -89,12 +91,17 @@ private:
89 void SetNotificationSettings(HLERequestContext& ctx); 91 void SetNotificationSettings(HLERequestContext& ctx);
90 void GetAccountNotificationSettings(HLERequestContext& ctx); 92 void GetAccountNotificationSettings(HLERequestContext& ctx);
91 void SetAccountNotificationSettings(HLERequestContext& ctx); 93 void SetAccountNotificationSettings(HLERequestContext& ctx);
94 void GetVibrationMasterVolume(HLERequestContext& ctx);
95 void SetVibrationMasterVolume(HLERequestContext& ctx);
92 void GetSettingsItemValueSize(HLERequestContext& ctx); 96 void GetSettingsItemValueSize(HLERequestContext& ctx);
93 void GetSettingsItemValue(HLERequestContext& ctx); 97 void GetSettingsItemValue(HLERequestContext& ctx);
94 void GetTvSettings(HLERequestContext& ctx); 98 void GetTvSettings(HLERequestContext& ctx);
95 void SetTvSettings(HLERequestContext& ctx); 99 void SetTvSettings(HLERequestContext& ctx);
100 void IsForceMuteOnHeadphoneRemoved(HLERequestContext& ctx);
101 void SetForceMuteOnHeadphoneRemoved(HLERequestContext& ctx);
96 void GetDebugModeFlag(HLERequestContext& ctx); 102 void GetDebugModeFlag(HLERequestContext& ctx);
97 void GetQuestFlag(HLERequestContext& ctx); 103 void GetQuestFlag(HLERequestContext& ctx);
104 void SetQuestFlag(HLERequestContext& ctx);
98 void GetDeviceTimeZoneLocationName(HLERequestContext& ctx); 105 void GetDeviceTimeZoneLocationName(HLERequestContext& ctx);
99 void SetDeviceTimeZoneLocationName(HLERequestContext& ctx); 106 void SetDeviceTimeZoneLocationName(HLERequestContext& ctx);
100 void SetRegionCode(HLERequestContext& ctx); 107 void SetRegionCode(HLERequestContext& ctx);
@@ -103,6 +110,7 @@ private:
103 void IsUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx); 110 void IsUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx);
104 void SetUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx); 111 void SetUserSystemClockAutomaticCorrectionEnabled(HLERequestContext& ctx);
105 void GetPrimaryAlbumStorage(HLERequestContext& ctx); 112 void GetPrimaryAlbumStorage(HLERequestContext& ctx);
113 void SetPrimaryAlbumStorage(HLERequestContext& ctx);
106 void GetNfcEnableFlag(HLERequestContext& ctx); 114 void GetNfcEnableFlag(HLERequestContext& ctx);
107 void SetNfcEnableFlag(HLERequestContext& ctx); 115 void SetNfcEnableFlag(HLERequestContext& ctx);
108 void GetSleepSettings(HLERequestContext& ctx); 116 void GetSleepSettings(HLERequestContext& ctx);