summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/time/time.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 18629dd7e..16c942e21 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -341,12 +341,18 @@ void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser(
341void Module::Interface::CalculateSpanBetween(Kernel::HLERequestContext& ctx) { 341void Module::Interface::CalculateSpanBetween(Kernel::HLERequestContext& ctx) {
342 LOG_DEBUG(Service_Time, "called"); 342 LOG_DEBUG(Service_Time, "called");
343 343
344 IPC::RequestParser rp{ctx}; 344 Clock::ClockSnapshot snapshot_a;
345 const auto snapshot_a = rp.PopRaw<Clock::ClockSnapshot>(); 345 Clock::ClockSnapshot snapshot_b;
346 const auto snapshot_b = rp.PopRaw<Clock::ClockSnapshot>(); 346
347 const auto snapshot_a_data = ctx.ReadBuffer(0);
348 const auto snapshot_b_data = ctx.ReadBuffer(1);
349
350 std::memcpy(&snapshot_a, snapshot_a_data.data(), sizeof(Clock::ClockSnapshot));
351 std::memcpy(&snapshot_b, snapshot_b_data.data(), sizeof(Clock::ClockSnapshot));
347 352
348 Clock::TimeSpanType time_span_type{}; 353 Clock::TimeSpanType time_span_type{};
349 s64 span{}; 354 s64 span{};
355
350 if (const ResultCode result{snapshot_a.steady_clock_time_point.GetSpanBetween( 356 if (const ResultCode result{snapshot_a.steady_clock_time_point.GetSpanBetween(
351 snapshot_b.steady_clock_time_point, span)}; 357 snapshot_b.steady_clock_time_point, span)};
352 result != RESULT_SUCCESS) { 358 result != RESULT_SUCCESS) {