mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 04:27:41 +01:00
Merge pull request #1718 from ogniK5377/lets-go-softlock
Implemented CalculateStandardUserSystemClockDifferenceByUser
This commit is contained in:
commit
f08b4cbbc8
@ -23,7 +23,8 @@ Time::Time(std::shared_ptr<Module> time, const char* name)
|
|||||||
{300, nullptr, "CalculateMonotonicSystemClockBaseTimePoint"},
|
{300, nullptr, "CalculateMonotonicSystemClockBaseTimePoint"},
|
||||||
{400, &Time::GetClockSnapshot, "GetClockSnapshot"},
|
{400, &Time::GetClockSnapshot, "GetClockSnapshot"},
|
||||||
{401, nullptr, "GetClockSnapshotFromSystemClockContext"},
|
{401, nullptr, "GetClockSnapshotFromSystemClockContext"},
|
||||||
{500, nullptr, "CalculateStandardUserSystemClockDifferenceByUser"},
|
{500, &Time::CalculateStandardUserSystemClockDifferenceByUser,
|
||||||
|
"CalculateStandardUserSystemClockDifferenceByUser"},
|
||||||
{501, nullptr, "CalculateSpanBetween"},
|
{501, nullptr, "CalculateSpanBetween"},
|
||||||
};
|
};
|
||||||
RegisterHandlers(functions);
|
RegisterHandlers(functions);
|
||||||
|
@ -299,6 +299,21 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
|
|||||||
ctx.WriteBuffer(&clock_snapshot, sizeof(ClockSnapshot));
|
ctx.WriteBuffer(&clock_snapshot, sizeof(ClockSnapshot));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser(
|
||||||
|
Kernel::HLERequestContext& ctx) {
|
||||||
|
LOG_DEBUG(Service_Time, "called");
|
||||||
|
|
||||||
|
IPC::RequestParser rp{ctx};
|
||||||
|
const auto snapshot_a = rp.PopRaw<ClockSnapshot>();
|
||||||
|
const auto snapshot_b = rp.PopRaw<ClockSnapshot>();
|
||||||
|
const u64 difference =
|
||||||
|
snapshot_b.user_clock_context.offset - snapshot_a.user_clock_context.offset;
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 4};
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
rb.PushRaw<u64>(difference);
|
||||||
|
}
|
||||||
|
|
||||||
Module::Interface::Interface(std::shared_ptr<Module> time, const char* name)
|
Module::Interface::Interface(std::shared_ptr<Module> time, const char* name)
|
||||||
: ServiceFramework(name), time(std::move(time)) {}
|
: ServiceFramework(name), time(std::move(time)) {}
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ public:
|
|||||||
void GetTimeZoneService(Kernel::HLERequestContext& ctx);
|
void GetTimeZoneService(Kernel::HLERequestContext& ctx);
|
||||||
void GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx);
|
void GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx);
|
||||||
void GetClockSnapshot(Kernel::HLERequestContext& ctx);
|
void GetClockSnapshot(Kernel::HLERequestContext& ctx);
|
||||||
|
void CalculateStandardUserSystemClockDifferenceByUser(Kernel::HLERequestContext& ctx);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::shared_ptr<Module> time;
|
std::shared_ptr<Module> time;
|
||||||
|
Loading…
Reference in New Issue
Block a user