summaryrefslogtreecommitdiff
path: root/src/core/hle/service/set
diff options
context:
space:
mode:
authorGravatar liamwhite2024-01-25 14:19:01 -0500
committerGravatar GitHub2024-01-25 14:19:01 -0500
commitd45561ace069024f47ed710d1165b607644d1ec3 (patch)
treea316f59c5a722dc15fe5c49b3641d9801c264970 /src/core/hle/service/set
parentMerge pull request #12781 from goldenx86/dozen (diff)
parentRework time service to fix time passing offline. (diff)
downloadyuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar.gz
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar.xz
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.zip
Merge pull request #12499 from Kelebek1/time
Rework time services
Diffstat (limited to 'src/core/hle/service/set')
-rw-r--r--src/core/hle/service/set/private_settings.h72
-rw-r--r--src/core/hle/service/set/setting_formats/private_settings.h1
-rw-r--r--src/core/hle/service/set/setting_formats/system_settings.cpp2
-rw-r--r--src/core/hle/service/set/setting_formats/system_settings.h16
-rw-r--r--src/core/hle/service/set/settings_types.h8
-rw-r--r--src/core/hle/service/set/system_settings_server.cpp62
-rw-r--r--src/core/hle/service/set/system_settings_server.h25
7 files changed, 129 insertions, 57 deletions
diff --git a/src/core/hle/service/set/private_settings.h b/src/core/hle/service/set/private_settings.h
new file mode 100644
index 000000000..b02291ce7
--- /dev/null
+++ b/src/core/hle/service/set/private_settings.h
@@ -0,0 +1,72 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <array>
7
8#include "common/bit_field.h"
9#include "common/common_funcs.h"
10#include "common/common_types.h"
11#include "common/uuid.h"
12#include "core/hle/service/psc/time/common.h"
13
14namespace Service::Set {
15
16/// This is nn::settings::system::InitialLaunchFlag
17struct InitialLaunchFlag {
18 union {
19 u32 raw{};
20
21 BitField<0, 1, u32> InitialLaunchCompletionFlag;
22 BitField<8, 1, u32> InitialLaunchUserAdditionFlag;
23 BitField<16, 1, u32> InitialLaunchTimestampFlag;
24 };
25};
26static_assert(sizeof(InitialLaunchFlag) == 4, "InitialLaunchFlag is an invalid size");
27
28/// This is nn::settings::system::InitialLaunchSettings
29struct InitialLaunchSettings {
30 InitialLaunchFlag flags;
31 INSERT_PADDING_BYTES(0x4);
32 Service::PSC::Time::SteadyClockTimePoint timestamp;
33};
34static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size");
35
36#pragma pack(push, 4)
37struct InitialLaunchSettingsPacked {
38 InitialLaunchFlag flags;
39 Service::PSC::Time::SteadyClockTimePoint timestamp;
40};
41#pragma pack(pop)
42static_assert(sizeof(InitialLaunchSettingsPacked) == 0x1C,
43 "InitialLaunchSettingsPacked is incorrect size");
44
45struct PrivateSettings {
46 std::array<u8, 0x10> reserved_00;
47
48 // nn::settings::system::InitialLaunchSettings
49 InitialLaunchSettings initial_launch_settings;
50
51 std::array<u8, 0x20> reserved_30;
52
53 Common::UUID external_clock_source_id;
54 s64 shutdown_rtc_value;
55 s64 external_steady_clock_internal_offset;
56
57 std::array<u8, 0x60> reserved_70;
58
59 // nn::settings::system::PlatformRegion
60 std::array<u8, 0x4> platform_region;
61
62 std::array<u8, 0x4> reserved_D4;
63};
64static_assert(offsetof(PrivateSettings, initial_launch_settings) == 0x10);
65static_assert(offsetof(PrivateSettings, external_clock_source_id) == 0x50);
66static_assert(offsetof(PrivateSettings, reserved_70) == 0x70);
67static_assert(offsetof(PrivateSettings, platform_region) == 0xD0);
68static_assert(sizeof(PrivateSettings) == 0xD8, "PrivateSettings has the wrong size!");
69
70PrivateSettings DefaultPrivateSettings();
71
72} // namespace Service::Set
diff --git a/src/core/hle/service/set/setting_formats/private_settings.h b/src/core/hle/service/set/setting_formats/private_settings.h
index 6c40f62e1..6579e95e0 100644
--- a/src/core/hle/service/set/setting_formats/private_settings.h
+++ b/src/core/hle/service/set/setting_formats/private_settings.h
@@ -8,7 +8,6 @@
8#include "common/common_types.h" 8#include "common/common_types.h"
9#include "common/uuid.h" 9#include "common/uuid.h"
10#include "core/hle/service/set/settings_types.h" 10#include "core/hle/service/set/settings_types.h"
11#include "core/hle/service/time/clock_types.h"
12 11
13namespace Service::Set { 12namespace Service::Set {
14 13
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 66e57651e..ec00b90a6 100644
--- a/src/core/hle/service/set/setting_formats/system_settings.cpp
+++ b/src/core/hle/service/set/setting_formats/system_settings.cpp
@@ -45,7 +45,7 @@ SystemSettings DefaultSystemSettings() {
45 }; 45 };
46 46
47 settings.device_time_zone_location_name = {"UTC"}; 47 settings.device_time_zone_location_name = {"UTC"};
48 settings.user_system_clock_automatic_correction_enabled = false; 48 settings.user_system_clock_automatic_correction_enabled = true;
49 49
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;
diff --git a/src/core/hle/service/set/setting_formats/system_settings.h b/src/core/hle/service/set/setting_formats/system_settings.h
index 14654f8b1..af5929fa9 100644
--- a/src/core/hle/service/set/setting_formats/system_settings.h
+++ b/src/core/hle/service/set/setting_formats/system_settings.h
@@ -12,7 +12,6 @@
12#include "common/vector_math.h" 12#include "common/vector_math.h"
13#include "core/hle/service/set/setting_formats/private_settings.h" 13#include "core/hle/service/set/setting_formats/private_settings.h"
14#include "core/hle/service/set/settings_types.h" 14#include "core/hle/service/set/settings_types.h"
15#include "core/hle/service/time/clock_types.h"
16 15
17namespace Service::Set { 16namespace Service::Set {
18 17
@@ -197,12 +196,14 @@ struct SystemSettings {
197 std::array<u8, 0x2C> backlight_settings_mixed_up; 196 std::array<u8, 0x2C> backlight_settings_mixed_up;
198 INSERT_PADDING_BYTES(0x64); // Reserved 197 INSERT_PADDING_BYTES(0x64); // Reserved
199 198
200 Service::Time::Clock::SystemClockContext user_system_clock_context; 199 // nn::time::SystemClockContext
201 Service::Time::Clock::SystemClockContext network_system_clock_context; 200 Service::PSC::Time::SystemClockContext user_system_clock_context;
201 Service::PSC::Time::SystemClockContext network_system_clock_context;
202 bool user_system_clock_automatic_correction_enabled; 202 bool user_system_clock_automatic_correction_enabled;
203 INSERT_PADDING_BYTES(0x3); 203 INSERT_PADDING_BYTES(0x3);
204 INSERT_PADDING_BYTES(0x4); // Reserved 204 INSERT_PADDING_BYTES(0x4); // Reserved
205 Service::Time::Clock::SteadyClockTimePoint 205 // nn::time::SteadyClockTimePoint
206 Service::PSC::Time::SteadyClockTimePoint
206 user_system_clock_automatic_correction_updated_time_point; 207 user_system_clock_automatic_correction_updated_time_point;
207 INSERT_PADDING_BYTES(0x10); // Reserved 208 INSERT_PADDING_BYTES(0x10); // Reserved
208 209
@@ -280,9 +281,12 @@ struct SystemSettings {
280 bool requires_run_repair_time_reviser; 281 bool requires_run_repair_time_reviser;
281 INSERT_PADDING_BYTES(0x6B); // Reserved 282 INSERT_PADDING_BYTES(0x6B); // Reserved
282 283
283 Service::Time::TimeZone::LocationName device_time_zone_location_name; 284 // nn::time::LocationName
285 Service::PSC::Time::LocationName device_time_zone_location_name;
284 INSERT_PADDING_BYTES(0x4); // Reserved 286 INSERT_PADDING_BYTES(0x4); // Reserved
285 Service::Time::Clock::SteadyClockTimePoint device_time_zone_location_updated_time; 287 // nn::time::SteadyClockTimePoint
288 Service::PSC::Time::SteadyClockTimePoint device_time_zone_location_updated_time;
289
286 INSERT_PADDING_BYTES(0xC0); // Reserved 290 INSERT_PADDING_BYTES(0xC0); // Reserved
287 291
288 // nn::settings::system::PrimaryAlbumStorage 292 // nn::settings::system::PrimaryAlbumStorage
diff --git a/src/core/hle/service/set/settings_types.h b/src/core/hle/service/set/settings_types.h
index 4dee202d7..f6f227fde 100644
--- a/src/core/hle/service/set/settings_types.h
+++ b/src/core/hle/service/set/settings_types.h
@@ -9,7 +9,7 @@
9#include "common/common_funcs.h" 9#include "common/common_funcs.h"
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "common/uuid.h" 11#include "common/uuid.h"
12#include "core/hle/service/time/clock_types.h" 12#include "core/hle/service/psc/time/common.h"
13 13
14namespace Service::Set { 14namespace Service::Set {
15 15
@@ -365,7 +365,7 @@ struct EulaVersion {
365 EulaVersionClockType clock_type; 365 EulaVersionClockType clock_type;
366 INSERT_PADDING_BYTES(0x4); 366 INSERT_PADDING_BYTES(0x4);
367 s64 posix_time; 367 s64 posix_time;
368 Time::Clock::SteadyClockTimePoint timestamp; 368 Service::PSC::Time::SteadyClockTimePoint timestamp;
369}; 369};
370static_assert(sizeof(EulaVersion) == 0x30, "EulaVersion is incorrect size"); 370static_assert(sizeof(EulaVersion) == 0x30, "EulaVersion is incorrect size");
371 371
@@ -398,14 +398,14 @@ static_assert(sizeof(HomeMenuScheme) == 0x14, "HomeMenuScheme is incorrect size"
398struct InitialLaunchSettings { 398struct InitialLaunchSettings {
399 InitialLaunchFlag flags; 399 InitialLaunchFlag flags;
400 INSERT_PADDING_BYTES(0x4); 400 INSERT_PADDING_BYTES(0x4);
401 Service::Time::Clock::SteadyClockTimePoint timestamp; 401 Service::PSC::Time::SteadyClockTimePoint timestamp;
402}; 402};
403static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size"); 403static_assert(sizeof(InitialLaunchSettings) == 0x20, "InitialLaunchSettings is incorrect size");
404 404
405#pragma pack(push, 4) 405#pragma pack(push, 4)
406struct InitialLaunchSettingsPacked { 406struct InitialLaunchSettingsPacked {
407 InitialLaunchFlag flags; 407 InitialLaunchFlag flags;
408 Service::Time::Clock::SteadyClockTimePoint timestamp; 408 Service::PSC::Time::SteadyClockTimePoint timestamp;
409}; 409};
410#pragma pack(pop) 410#pragma pack(pop)
411static_assert(sizeof(InitialLaunchSettingsPacked) == 0x1C, 411static_assert(sizeof(InitialLaunchSettingsPacked) == 0x1C,
diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp
index 429e96d11..f40a1c8f3 100644
--- a/src/core/hle/service/set/system_settings_server.cpp
+++ b/src/core/hle/service/set/system_settings_server.cpp
@@ -489,11 +489,10 @@ void ISystemSettingsServer::SetExternalSteadyClockSourceId(HLERequestContext& ct
489void ISystemSettingsServer::GetUserSystemClockContext(HLERequestContext& ctx) { 489void ISystemSettingsServer::GetUserSystemClockContext(HLERequestContext& ctx) {
490 LOG_INFO(Service_SET, "called"); 490 LOG_INFO(Service_SET, "called");
491 491
492 Service::Time::Clock::SystemClockContext context{}; 492 Service::PSC::Time::SystemClockContext context{};
493 auto res = GetUserSystemClockContext(context); 493 auto res = GetUserSystemClockContext(context);
494 494
495 IPC::ResponseBuilder rb{ctx, 495 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::SystemClockContext) / sizeof(u32)};
496 2 + sizeof(Service::Time::Clock::SystemClockContext) / sizeof(u32)};
497 rb.Push(res); 496 rb.Push(res);
498 rb.PushRaw(context); 497 rb.PushRaw(context);
499} 498}
@@ -502,7 +501,7 @@ void ISystemSettingsServer::SetUserSystemClockContext(HLERequestContext& ctx) {
502 LOG_INFO(Service_SET, "called"); 501 LOG_INFO(Service_SET, "called");
503 502
504 IPC::RequestParser rp{ctx}; 503 IPC::RequestParser rp{ctx};
505 auto context{rp.PopRaw<Service::Time::Clock::SystemClockContext>()}; 504 auto context{rp.PopRaw<Service::PSC::Time::SystemClockContext>()};
506 505
507 auto res = SetUserSystemClockContext(context); 506 auto res = SetUserSystemClockContext(context);
508 507
@@ -809,19 +808,19 @@ void ISystemSettingsServer::GetQuestFlag(HLERequestContext& ctx) {
809void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx) { 808void ISystemSettingsServer::GetDeviceTimeZoneLocationName(HLERequestContext& ctx) {
810 LOG_INFO(Service_SET, "called"); 809 LOG_INFO(Service_SET, "called");
811 810
812 Service::Time::TimeZone::LocationName name{}; 811 Service::PSC::Time::LocationName name{};
813 auto res = GetDeviceTimeZoneLocationName(name); 812 auto res = GetDeviceTimeZoneLocationName(name);
814 813
815 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::Time::TimeZone::LocationName) / sizeof(u32)}; 814 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::LocationName) / sizeof(u32)};
816 rb.Push(res); 815 rb.Push(res);
817 rb.PushRaw<Service::Time::TimeZone::LocationName>(name); 816 rb.PushRaw<Service::PSC::Time::LocationName>(name);
818} 817}
819 818
820void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx) { 819void ISystemSettingsServer::SetDeviceTimeZoneLocationName(HLERequestContext& ctx) {
821 LOG_INFO(Service_SET, "called"); 820 LOG_INFO(Service_SET, "called");
822 821
823 IPC::RequestParser rp{ctx}; 822 IPC::RequestParser rp{ctx};
824 auto name{rp.PopRaw<Service::Time::TimeZone::LocationName>()}; 823 auto name{rp.PopRaw<Service::PSC::Time::LocationName>()};
825 824
826 auto res = SetDeviceTimeZoneLocationName(name); 825 auto res = SetDeviceTimeZoneLocationName(name);
827 826
@@ -843,11 +842,10 @@ void ISystemSettingsServer::SetRegionCode(HLERequestContext& ctx) {
843void ISystemSettingsServer::GetNetworkSystemClockContext(HLERequestContext& ctx) { 842void ISystemSettingsServer::GetNetworkSystemClockContext(HLERequestContext& ctx) {
844 LOG_INFO(Service_SET, "called"); 843 LOG_INFO(Service_SET, "called");
845 844
846 Service::Time::Clock::SystemClockContext context{}; 845 Service::PSC::Time::SystemClockContext context{};
847 auto res = GetNetworkSystemClockContext(context); 846 auto res = GetNetworkSystemClockContext(context);
848 847
849 IPC::ResponseBuilder rb{ctx, 848 IPC::ResponseBuilder rb{ctx, 2 + sizeof(Service::PSC::Time::SystemClockContext) / sizeof(u32)};
850 2 + sizeof(Service::Time::Clock::SystemClockContext) / sizeof(u32)};
851 rb.Push(res); 849 rb.Push(res);
852 rb.PushRaw(context); 850 rb.PushRaw(context);
853} 851}
@@ -856,7 +854,7 @@ void ISystemSettingsServer::SetNetworkSystemClockContext(HLERequestContext& ctx)
856 LOG_INFO(Service_SET, "called"); 854 LOG_INFO(Service_SET, "called");
857 855
858 IPC::RequestParser rp{ctx}; 856 IPC::RequestParser rp{ctx};
859 auto context{rp.PopRaw<Service::Time::Clock::SystemClockContext>()}; 857 auto context{rp.PopRaw<Service::PSC::Time::SystemClockContext>()};
860 858
861 auto res = SetNetworkSystemClockContext(context); 859 auto res = SetNetworkSystemClockContext(context);
862 860
@@ -1141,19 +1139,19 @@ void ISystemSettingsServer::GetKeyboardLayout(HLERequestContext& ctx) {
1141void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) { 1139void ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) {
1142 LOG_INFO(Service_SET, "called"); 1140 LOG_INFO(Service_SET, "called");
1143 1141
1144 Service::Time::Clock::SteadyClockTimePoint time_point{}; 1142 Service::PSC::Time::SteadyClockTimePoint time_point{};
1145 auto res = GetDeviceTimeZoneLocationUpdatedTime(time_point); 1143 auto res = GetDeviceTimeZoneLocationUpdatedTime(time_point);
1146 1144
1147 IPC::ResponseBuilder rb{ctx, 4}; 1145 IPC::ResponseBuilder rb{ctx, 4};
1148 rb.Push(res); 1146 rb.Push(res);
1149 rb.PushRaw<Service::Time::Clock::SteadyClockTimePoint>(time_point); 1147 rb.PushRaw<Service::PSC::Time::SteadyClockTimePoint>(time_point);
1150} 1148}
1151 1149
1152void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) { 1150void ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(HLERequestContext& ctx) {
1153 LOG_INFO(Service_SET, "called"); 1151 LOG_INFO(Service_SET, "called");
1154 1152
1155 IPC::RequestParser rp{ctx}; 1153 IPC::RequestParser rp{ctx};
1156 auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()}; 1154 auto time_point{rp.PopRaw<Service::PSC::Time::SteadyClockTimePoint>()};
1157 1155
1158 auto res = SetDeviceTimeZoneLocationUpdatedTime(time_point); 1156 auto res = SetDeviceTimeZoneLocationUpdatedTime(time_point);
1159 1157
@@ -1165,12 +1163,12 @@ void ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime(
1165 HLERequestContext& ctx) { 1163 HLERequestContext& ctx) {
1166 LOG_INFO(Service_SET, "called"); 1164 LOG_INFO(Service_SET, "called");
1167 1165
1168 Service::Time::Clock::SteadyClockTimePoint time_point{}; 1166 Service::PSC::Time::SteadyClockTimePoint time_point{};
1169 auto res = GetUserSystemClockAutomaticCorrectionUpdatedTime(time_point); 1167 auto res = GetUserSystemClockAutomaticCorrectionUpdatedTime(time_point);
1170 1168
1171 IPC::ResponseBuilder rb{ctx, 4}; 1169 IPC::ResponseBuilder rb{ctx, 4};
1172 rb.Push(res); 1170 rb.Push(res);
1173 rb.PushRaw<Service::Time::Clock::SteadyClockTimePoint>(time_point); 1171 rb.PushRaw<Service::PSC::Time::SteadyClockTimePoint>(time_point);
1174} 1172}
1175 1173
1176void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime( 1174void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
@@ -1178,7 +1176,7 @@ void ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
1178 LOG_INFO(Service_SET, "called"); 1176 LOG_INFO(Service_SET, "called");
1179 1177
1180 IPC::RequestParser rp{ctx}; 1178 IPC::RequestParser rp{ctx};
1181 auto time_point{rp.PopRaw<Service::Time::Clock::SteadyClockTimePoint>()}; 1179 auto time_point{rp.PopRaw<Service::PSC::Time::SteadyClockTimePoint>()};
1182 1180
1183 auto res = SetUserSystemClockAutomaticCorrectionUpdatedTime(time_point); 1181 auto res = SetUserSystemClockAutomaticCorrectionUpdatedTime(time_point);
1184 1182
@@ -1257,25 +1255,25 @@ void ISystemSettingsServer::StoreSettings() {
1257 auto system_dir = 1255 auto system_dir =
1258 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000050"; 1256 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000050";
1259 if (!StoreSettingsFile(system_dir, m_system_settings)) { 1257 if (!StoreSettingsFile(system_dir, m_system_settings)) {
1260 LOG_ERROR(HW_GPU, "Failed to store System settings"); 1258 LOG_ERROR(Service_SET, "Failed to store System settings");
1261 } 1259 }
1262 1260
1263 auto private_dir = 1261 auto private_dir =
1264 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000052"; 1262 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000052";
1265 if (!StoreSettingsFile(private_dir, m_private_settings)) { 1263 if (!StoreSettingsFile(private_dir, m_private_settings)) {
1266 LOG_ERROR(HW_GPU, "Failed to store Private settings"); 1264 LOG_ERROR(Service_SET, "Failed to store Private settings");
1267 } 1265 }
1268 1266
1269 auto device_dir = 1267 auto device_dir =
1270 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000053"; 1268 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000053";
1271 if (!StoreSettingsFile(device_dir, m_device_settings)) { 1269 if (!StoreSettingsFile(device_dir, m_device_settings)) {
1272 LOG_ERROR(HW_GPU, "Failed to store Device settings"); 1270 LOG_ERROR(Service_SET, "Failed to store Device settings");
1273 } 1271 }
1274 1272
1275 auto appln_dir = 1273 auto appln_dir =
1276 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000054"; 1274 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/8000000000000054";
1277 if (!StoreSettingsFile(appln_dir, m_appln_settings)) { 1275 if (!StoreSettingsFile(appln_dir, m_appln_settings)) {
1278 LOG_ERROR(HW_GPU, "Failed to store ApplLn settings"); 1276 LOG_ERROR(Service_SET, "Failed to store ApplLn settings");
1279 } 1277 }
1280} 1278}
1281 1279
@@ -1318,39 +1316,39 @@ Result ISystemSettingsServer::SetExternalSteadyClockSourceId(Common::UUID id) {
1318} 1316}
1319 1317
1320Result ISystemSettingsServer::GetUserSystemClockContext( 1318Result ISystemSettingsServer::GetUserSystemClockContext(
1321 Service::Time::Clock::SystemClockContext& out_context) { 1319 Service::PSC::Time::SystemClockContext& out_context) {
1322 out_context = m_system_settings.user_system_clock_context; 1320 out_context = m_system_settings.user_system_clock_context;
1323 R_SUCCEED(); 1321 R_SUCCEED();
1324} 1322}
1325 1323
1326Result ISystemSettingsServer::SetUserSystemClockContext( 1324Result ISystemSettingsServer::SetUserSystemClockContext(
1327 Service::Time::Clock::SystemClockContext& context) { 1325 Service::PSC::Time::SystemClockContext& context) {
1328 m_system_settings.user_system_clock_context = context; 1326 m_system_settings.user_system_clock_context = context;
1329 SetSaveNeeded(); 1327 SetSaveNeeded();
1330 R_SUCCEED(); 1328 R_SUCCEED();
1331} 1329}
1332 1330
1333Result ISystemSettingsServer::GetDeviceTimeZoneLocationName( 1331Result ISystemSettingsServer::GetDeviceTimeZoneLocationName(
1334 Service::Time::TimeZone::LocationName& out_name) { 1332 Service::PSC::Time::LocationName& out_name) {
1335 out_name = m_system_settings.device_time_zone_location_name; 1333 out_name = m_system_settings.device_time_zone_location_name;
1336 R_SUCCEED(); 1334 R_SUCCEED();
1337} 1335}
1338 1336
1339Result ISystemSettingsServer::SetDeviceTimeZoneLocationName( 1337Result ISystemSettingsServer::SetDeviceTimeZoneLocationName(
1340 Service::Time::TimeZone::LocationName& name) { 1338 Service::PSC::Time::LocationName& name) {
1341 m_system_settings.device_time_zone_location_name = name; 1339 m_system_settings.device_time_zone_location_name = name;
1342 SetSaveNeeded(); 1340 SetSaveNeeded();
1343 R_SUCCEED(); 1341 R_SUCCEED();
1344} 1342}
1345 1343
1346Result ISystemSettingsServer::GetNetworkSystemClockContext( 1344Result ISystemSettingsServer::GetNetworkSystemClockContext(
1347 Service::Time::Clock::SystemClockContext& out_context) { 1345 Service::PSC::Time::SystemClockContext& out_context) {
1348 out_context = m_system_settings.network_system_clock_context; 1346 out_context = m_system_settings.network_system_clock_context;
1349 R_SUCCEED(); 1347 R_SUCCEED();
1350} 1348}
1351 1349
1352Result ISystemSettingsServer::SetNetworkSystemClockContext( 1350Result ISystemSettingsServer::SetNetworkSystemClockContext(
1353 Service::Time::Clock::SystemClockContext& context) { 1351 Service::PSC::Time::SystemClockContext& context) {
1354 m_system_settings.network_system_clock_context = context; 1352 m_system_settings.network_system_clock_context = context;
1355 SetSaveNeeded(); 1353 SetSaveNeeded();
1356 R_SUCCEED(); 1354 R_SUCCEED();
@@ -1379,26 +1377,26 @@ Result ISystemSettingsServer::GetExternalSteadyClockInternalOffset(s64& out_offs
1379} 1377}
1380 1378
1381Result ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime( 1379Result ISystemSettingsServer::GetDeviceTimeZoneLocationUpdatedTime(
1382 Service::Time::Clock::SteadyClockTimePoint& out_time_point) { 1380 Service::PSC::Time::SteadyClockTimePoint& out_time_point) {
1383 out_time_point = m_system_settings.device_time_zone_location_updated_time; 1381 out_time_point = m_system_settings.device_time_zone_location_updated_time;
1384 R_SUCCEED(); 1382 R_SUCCEED();
1385} 1383}
1386 1384
1387Result ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime( 1385Result ISystemSettingsServer::SetDeviceTimeZoneLocationUpdatedTime(
1388 Service::Time::Clock::SteadyClockTimePoint& time_point) { 1386 Service::PSC::Time::SteadyClockTimePoint& time_point) {
1389 m_system_settings.device_time_zone_location_updated_time = time_point; 1387 m_system_settings.device_time_zone_location_updated_time = time_point;
1390 SetSaveNeeded(); 1388 SetSaveNeeded();
1391 R_SUCCEED(); 1389 R_SUCCEED();
1392} 1390}
1393 1391
1394Result ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime( 1392Result ISystemSettingsServer::GetUserSystemClockAutomaticCorrectionUpdatedTime(
1395 Service::Time::Clock::SteadyClockTimePoint& out_time_point) { 1393 Service::PSC::Time::SteadyClockTimePoint& out_time_point) {
1396 out_time_point = m_system_settings.user_system_clock_automatic_correction_updated_time_point; 1394 out_time_point = m_system_settings.user_system_clock_automatic_correction_updated_time_point;
1397 R_SUCCEED(); 1395 R_SUCCEED();
1398} 1396}
1399 1397
1400Result ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime( 1398Result ISystemSettingsServer::SetUserSystemClockAutomaticCorrectionUpdatedTime(
1401 Service::Time::Clock::SteadyClockTimePoint out_time_point) { 1399 Service::PSC::Time::SteadyClockTimePoint out_time_point) {
1402 m_system_settings.user_system_clock_automatic_correction_updated_time_point = out_time_point; 1400 m_system_settings.user_system_clock_automatic_correction_updated_time_point = out_time_point;
1403 SetSaveNeeded(); 1401 SetSaveNeeded();
1404 R_SUCCEED(); 1402 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 32716f567..a2258d16d 100644
--- a/src/core/hle/service/set/system_settings_server.h
+++ b/src/core/hle/service/set/system_settings_server.h
@@ -11,14 +11,13 @@
11#include "common/polyfill_thread.h" 11#include "common/polyfill_thread.h"
12#include "common/uuid.h" 12#include "common/uuid.h"
13#include "core/hle/result.h" 13#include "core/hle/result.h"
14#include "core/hle/service/psc/time/common.h"
14#include "core/hle/service/service.h" 15#include "core/hle/service/service.h"
15#include "core/hle/service/set/setting_formats/appln_settings.h" 16#include "core/hle/service/set/setting_formats/appln_settings.h"
16#include "core/hle/service/set/setting_formats/device_settings.h" 17#include "core/hle/service/set/setting_formats/device_settings.h"
17#include "core/hle/service/set/setting_formats/private_settings.h" 18#include "core/hle/service/set/setting_formats/private_settings.h"
18#include "core/hle/service/set/setting_formats/system_settings.h" 19#include "core/hle/service/set/setting_formats/system_settings.h"
19#include "core/hle/service/set/settings_types.h" 20#include "core/hle/service/set/settings_types.h"
20#include "core/hle/service/time/clock_types.h"
21#include "core/hle/service/time/time_zone_types.h"
22 21
23namespace Core { 22namespace Core {
24class System; 23class System;
@@ -51,24 +50,24 @@ public:
51 50
52 Result GetExternalSteadyClockSourceId(Common::UUID& out_id); 51 Result GetExternalSteadyClockSourceId(Common::UUID& out_id);
53 Result SetExternalSteadyClockSourceId(Common::UUID id); 52 Result SetExternalSteadyClockSourceId(Common::UUID id);
54 Result GetUserSystemClockContext(Service::Time::Clock::SystemClockContext& out_context); 53 Result GetUserSystemClockContext(Service::PSC::Time::SystemClockContext& out_context);
55 Result SetUserSystemClockContext(Service::Time::Clock::SystemClockContext& context); 54 Result SetUserSystemClockContext(Service::PSC::Time::SystemClockContext& context);
56 Result GetDeviceTimeZoneLocationName(Service::Time::TimeZone::LocationName& out_name); 55 Result GetDeviceTimeZoneLocationName(Service::PSC::Time::LocationName& out_name);
57 Result SetDeviceTimeZoneLocationName(Service::Time::TimeZone::LocationName& name); 56 Result SetDeviceTimeZoneLocationName(Service::PSC::Time::LocationName& name);
58 Result GetNetworkSystemClockContext(Service::Time::Clock::SystemClockContext& out_context); 57 Result GetNetworkSystemClockContext(Service::PSC::Time::SystemClockContext& out_context);
59 Result SetNetworkSystemClockContext(Service::Time::Clock::SystemClockContext& context); 58 Result SetNetworkSystemClockContext(Service::PSC::Time::SystemClockContext& context);
60 Result IsUserSystemClockAutomaticCorrectionEnabled(bool& out_enabled); 59 Result IsUserSystemClockAutomaticCorrectionEnabled(bool& out_enabled);
61 Result SetUserSystemClockAutomaticCorrectionEnabled(bool enabled); 60 Result SetUserSystemClockAutomaticCorrectionEnabled(bool enabled);
62 Result SetExternalSteadyClockInternalOffset(s64 offset); 61 Result SetExternalSteadyClockInternalOffset(s64 offset);
63 Result GetExternalSteadyClockInternalOffset(s64& out_offset); 62 Result GetExternalSteadyClockInternalOffset(s64& out_offset);
64 Result GetDeviceTimeZoneLocationUpdatedTime( 63 Result GetDeviceTimeZoneLocationUpdatedTime(
65 Service::Time::Clock::SteadyClockTimePoint& out_time_point); 64 Service::PSC::Time::SteadyClockTimePoint& out_time_point);
66 Result SetDeviceTimeZoneLocationUpdatedTime( 65 Result SetDeviceTimeZoneLocationUpdatedTime(
67 Service::Time::Clock::SteadyClockTimePoint& time_point); 66 Service::PSC::Time::SteadyClockTimePoint& time_point);
68 Result GetUserSystemClockAutomaticCorrectionUpdatedTime( 67 Result GetUserSystemClockAutomaticCorrectionUpdatedTime(
69 Service::Time::Clock::SteadyClockTimePoint& out_time_point); 68 Service::PSC::Time::SteadyClockTimePoint& out_time_point);
70 Result SetUserSystemClockAutomaticCorrectionUpdatedTime( 69 Result SetUserSystemClockAutomaticCorrectionUpdatedTime(
71 Service::Time::Clock::SteadyClockTimePoint time_point); 70 Service::PSC::Time::SteadyClockTimePoint time_point);
72 71
73private: 72private:
74 void SetLanguageCode(HLERequestContext& ctx); 73 void SetLanguageCode(HLERequestContext& ctx);
@@ -147,8 +146,8 @@ private:
147 PrivateSettings m_private_settings{}; 146 PrivateSettings m_private_settings{};
148 DeviceSettings m_device_settings{}; 147 DeviceSettings m_device_settings{};
149 ApplnSettings m_appln_settings{}; 148 ApplnSettings m_appln_settings{};
150 std::jthread m_save_thread;
151 std::mutex m_save_needed_mutex; 149 std::mutex m_save_needed_mutex;
150 std::jthread m_save_thread;
152 bool m_save_needed{false}; 151 bool m_save_needed{false};
153}; 152};
154 153