diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-10-29 14:50:55 +0100 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2024-01-24 05:26:55 +0100 |
commit | e4915fb7d2077584a11a15141bc81d28ed2b0125 (patch) | |
tree | 1783055dc2e98eaf9099e8e7b194b55f8f607747 /src/core/hle/service/caps | |
parent | Merge pull request #12678 from german77/settings_impl (diff) | |
download | yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.gz yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.bz2 yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.lz yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.xz yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.zst yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.zip |
Diffstat (limited to 'src/core/hle/service/caps')
-rw-r--r-- | src/core/hle/service/caps/caps_manager.cpp | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/core/hle/service/caps/caps_manager.cpp b/src/core/hle/service/caps/caps_manager.cpp index 261fc204c..e3b8ecf3e 100644 --- a/src/core/hle/service/caps/caps_manager.cpp +++ b/src/core/hle/service/caps/caps_manager.cpp @@ -10,8 +10,10 @@ #include "core/core.h" #include "core/hle/service/caps/caps_manager.h" #include "core/hle/service/caps/caps_result.h" -#include "core/hle/service/time/time_manager.h" -#include "core/hle/service/time/time_zone_content_manager.h" +#include "core/hle/service/glue/time/static.h" +#include "core/hle/service/psc/time/system_clock.h" +#include "core/hle/service/service.h" +#include "core/hle/service/sm/sm.h" namespace Service::Capture { @@ -239,10 +241,15 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry, const ApplicationData& app_data, std::span<const u8> image_data, u64 aruid) { const u64 title_id = system.GetApplicationProcessProgramID(); - const auto& user_clock = system.GetTimeManager().GetStandardUserSystemClockCore(); + + auto static_service = + system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true); + + std::shared_ptr<Service::PSC::Time::SystemClock> user_clock{}; + static_service->GetStandardUserSystemClock(user_clock); s64 posix_time{}; - Result result = user_clock.GetCurrentTime(system, posix_time); + auto result = user_clock->GetCurrentTime(posix_time); if (result.IsError()) { return result; @@ -257,10 +264,14 @@ Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry, const ScreenShotAttribute& attribute, const AlbumFileId& file_id, std::span<const u8> image_data) { - const auto& user_clock = system.GetTimeManager().GetStandardUserSystemClockCore(); + auto static_service = + system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true); + + std::shared_ptr<Service::PSC::Time::SystemClock> user_clock{}; + static_service->GetStandardUserSystemClock(user_clock); s64 posix_time{}; - Result result = user_clock.GetCurrentTime(system, posix_time); + auto result = user_clock->GetCurrentTime(posix_time); if (result.IsError()) { return result; @@ -455,19 +466,23 @@ Result AlbumManager::SaveImage(ApplicationAlbumEntry& out_entry, std::span<const } AlbumFileDateTime AlbumManager::ConvertToAlbumDateTime(u64 posix_time) const { - Time::TimeZone::CalendarInfo calendar_date{}; - const auto& time_zone_manager = - system.GetTimeManager().GetTimeZoneContentManager().GetTimeZoneManager(); + auto static_service = + system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true); + + std::shared_ptr<Service::Glue::Time::TimeZoneService> timezone_service{}; + static_service->GetTimeZoneService(timezone_service); - time_zone_manager.ToCalendarTimeWithMyRules(posix_time, calendar_date); + Service::PSC::Time::CalendarTime calendar_time{}; + Service::PSC::Time::CalendarAdditionalInfo additional_info{}; + timezone_service->ToCalendarTimeWithMyRule(calendar_time, additional_info, posix_time); return { - .year = calendar_date.time.year, - .month = calendar_date.time.month, - .day = calendar_date.time.day, - .hour = calendar_date.time.hour, - .minute = calendar_date.time.minute, - .second = calendar_date.time.second, + .year = calendar_time.year, + .month = calendar_time.month, + .day = calendar_time.day, + .hour = calendar_time.hour, + .minute = calendar_time.minute, + .second = calendar_time.second, .unique_id = 0, }; } |