mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 15:45:46 +00:00
Implemented CalculateStandardUserSystemClockDifferenceByUser
Seems pokemon calls this sometimes and it caused "random crashes"
This commit is contained in:
parent
3d7dacdd9a
commit
f60294d740
3 changed files with 18 additions and 1 deletions
|
@ -299,6 +299,21 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
|
|||
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)
|
||||
: ServiceFramework(name), time(std::move(time)) {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue