summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/time/time_zone_service.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-01-23 05:19:25 +0100
committerbunnei <bunneidev@gmail.com>2020-01-23 05:20:19 +0100
commited76c7131903f180ebc2f49c148a8a0339bf05fa (patch)
tree819714caa787b018fac29cca2b925dc0828bc552 /src/core/hle/service/time/time_zone_service.cpp
parentMerge pull request #3324 from FearlessTobi/port-5037 (diff)
downloadyuzu-ed76c7131903f180ebc2f49c148a8a0339bf05fa.tar
yuzu-ed76c7131903f180ebc2f49c148a8a0339bf05fa.tar.gz
yuzu-ed76c7131903f180ebc2f49c148a8a0339bf05fa.tar.bz2
yuzu-ed76c7131903f180ebc2f49c148a8a0339bf05fa.tar.lz
yuzu-ed76c7131903f180ebc2f49c148a8a0339bf05fa.tar.xz
yuzu-ed76c7131903f180ebc2f49c148a8a0339bf05fa.tar.zst
yuzu-ed76c7131903f180ebc2f49c148a8a0339bf05fa.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/time/time_zone_service.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp
index 1566e778e..db57ae069 100644
--- a/src/core/hle/service/time/time_zone_service.cpp
+++ b/src/core/hle/service/time/time_zone_service.cpp
@@ -22,7 +22,7 @@ ITimeZoneService ::ITimeZoneService(TimeZone::TimeZoneContentManager& time_zone_
{100, &ITimeZoneService::ToCalendarTime, "ToCalendarTime"},
{101, &ITimeZoneService::ToCalendarTimeWithMyRule, "ToCalendarTimeWithMyRule"},
{201, &ITimeZoneService::ToPosixTime, "ToPosixTime"},
- {202, nullptr, "ToPosixTimeWithMyRule"},
+ {202, &ITimeZoneService::ToPosixTimeWithMyRule, "ToPosixTimeWithMyRule"},
};
RegisterHandlers(functions);
}
@@ -145,4 +145,26 @@ void ITimeZoneService::ToPosixTime(Kernel::HLERequestContext& ctx) {
ctx.WriteBuffer(&posix_time, sizeof(s64));
}
+void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_Time, "called");
+
+ IPC::RequestParser rp{ctx};
+ const auto calendar_time{rp.PopRaw<TimeZone::CalendarTime>()};
+
+ s64 posix_time{};
+ if (const ResultCode result{
+ time_zone_content_manager.GetTimeZoneManager().ToPosixTimeWithMyRule(calendar_time,
+ posix_time)};
+ result != RESULT_SUCCESS) {
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(result);
+ return;
+ }
+
+ IPC::ResponseBuilder rb{ctx, 3};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushRaw<u32>(1); // Number of times we're returning
+ ctx.WriteBuffer(&posix_time, sizeof(s64));
+}
+
} // namespace Service::Time