summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2021-03-12 23:31:09 -0800
committerGravatar GitHub2021-03-12 23:31:09 -0800
commit3b85ac2ac4d72ca4acf83ef9642b9a42e912993e (patch)
tree0866144bff9afac6b0250cc8372512e57f709892
parentMerge pull request #6028 from bunnei/raster-cache (diff)
parenttime: Fix CalculateSpanBetween implementation (diff)
downloadyuzu-3b85ac2ac4d72ca4acf83ef9642b9a42e912993e.tar.gz
yuzu-3b85ac2ac4d72ca4acf83ef9642b9a42e912993e.tar.xz
yuzu-3b85ac2ac4d72ca4acf83ef9642b9a42e912993e.zip
Merge pull request #6053 from Morph1984/time-CalculateSpanBetween
time: Fix CalculateSpanBetween implementation
Diffstat (limited to '')
-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) {