diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2019-06-05 21:52:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-05 21:52:37 +0200 |
commit | 81e09bb1213720c31b7881c9396385375dac5749 (patch) | |
tree | 06ea501a4f516ac82f1ac91f953d4325475940bc /src/core/hle/service | |
parent | Merge pull request #2541 from lioncash/input (diff) | |
parent | core/core_timing_util: Amend casing of cyclesTo* functions (diff) | |
download | yuzu-81e09bb1213720c31b7881c9396385375dac5749.tar yuzu-81e09bb1213720c31b7881c9396385375dac5749.tar.gz yuzu-81e09bb1213720c31b7881c9396385375dac5749.tar.bz2 yuzu-81e09bb1213720c31b7881c9396385375dac5749.tar.lz yuzu-81e09bb1213720c31b7881c9396385375dac5749.tar.xz yuzu-81e09bb1213720c31b7881c9396385375dac5749.tar.zst yuzu-81e09bb1213720c31b7881c9396385375dac5749.zip |
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 3 | ||||
-rw-r--r-- | src/core/hle/service/time/time.cpp | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 45812d238..0e28755bd 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -185,7 +185,8 @@ u32 nvhost_ctrl_gpu::GetGpuTime(const std::vector<u8>& input, std::vector<u8>& o IoctlGetGpuTime params{}; std::memcpy(¶ms, input.data(), input.size()); - params.gpu_time = Core::Timing::cyclesToNs(Core::System::GetInstance().CoreTiming().GetTicks()); + const auto ns = Core::Timing::CyclesToNs(Core::System::GetInstance().CoreTiming().GetTicks()); + params.gpu_time = static_cast<u64_le>(ns.count()); std::memcpy(output.data(), ¶ms, output.size()); return 0; } diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index aa115935d..346bad80d 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -108,8 +108,9 @@ private: LOG_DEBUG(Service_Time, "called"); const auto& core_timing = Core::System::GetInstance().CoreTiming(); - const SteadyClockTimePoint steady_clock_time_point{ - Core::Timing::cyclesToMs(core_timing.GetTicks()) / 1000}; + const auto ms = Core::Timing::CyclesToMs(core_timing.GetTicks()); + const SteadyClockTimePoint steady_clock_time_point{static_cast<u64_le>(ms.count() / 1000), + {}}; IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2}; rb.Push(RESULT_SUCCESS); rb.PushRaw(steady_clock_time_point); @@ -284,8 +285,8 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { } const auto& core_timing = Core::System::GetInstance().CoreTiming(); - const SteadyClockTimePoint steady_clock_time_point{ - Core::Timing::cyclesToMs(core_timing.GetTicks()) / 1000, {}}; + const auto ms = Core::Timing::CyclesToMs(core_timing.GetTicks()); + const SteadyClockTimePoint steady_clock_time_point{static_cast<u64_le>(ms.count() / 1000), {}}; CalendarTime calendar_time{}; calendar_time.year = tm->tm_year + 1900; |