summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2021-03-10 11:15:05 -0500
committerGravatar Morph2021-03-10 11:42:59 -0500
commit87cfe5b1da758c52df3c2d578937d86f4db79a8e (patch)
tree717c97114a5d8ce27c49c8f009acfa60ddf46c1b
parentMerge pull request #5891 from ameerj/bgra-ogl (diff)
downloadyuzu-87cfe5b1da758c52df3c2d578937d86f4db79a8e.tar.gz
yuzu-87cfe5b1da758c52df3c2d578937d86f4db79a8e.tar.xz
yuzu-87cfe5b1da758c52df3c2d578937d86f4db79a8e.zip
time: Fix CalculateSpanBetween implementation
CalculateSpanBetween passes in the ClockSnapshots through 2 input buffers and not as raw arguments. Fix this by reading the 2 input buffers instead of popping raw arguments. Partially fixes Super Smash Bros. Ultimate's Spirit Board
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) {