mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-25 19:40:07 +00:00
Merge pull request #142 from bunnei/improve-time
time: Implement ISteadyClock::GetCurrentTimePoint
This commit is contained in:
commit
767ce8abc8
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
#include "core/core_timing.h"
|
||||||
#include "core/hle/ipc_helpers.h"
|
#include "core/hle/ipc_helpers.h"
|
||||||
#include "core/hle/kernel/client_port.h"
|
#include "core/hle/kernel/client_port.h"
|
||||||
#include "core/hle/kernel/client_session.h"
|
#include "core/hle/kernel/client_session.h"
|
||||||
@ -45,7 +46,21 @@ private:
|
|||||||
|
|
||||||
class ISteadyClock final : public ServiceFramework<ISteadyClock> {
|
class ISteadyClock final : public ServiceFramework<ISteadyClock> {
|
||||||
public:
|
public:
|
||||||
ISteadyClock() : ServiceFramework("ISteadyClock") {}
|
ISteadyClock() : ServiceFramework("ISteadyClock") {
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, &ISteadyClock::GetCurrentTimePoint, "GetCurrentTimePoint"},
|
||||||
|
};
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void GetCurrentTimePoint(Kernel::HLERequestContext& ctx) {
|
||||||
|
LOG_DEBUG(Service, "called");
|
||||||
|
SteadyClockTimePoint steady_clock_time_point{cyclesToMs(CoreTiming::GetTicks()) / 1000};
|
||||||
|
IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2};
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
rb.PushRaw(steady_clock_time_point);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ITimeZoneService final : public ServiceFramework<ITimeZoneService> {
|
class ITimeZoneService final : public ServiceFramework<ITimeZoneService> {
|
||||||
|
@ -40,6 +40,12 @@ struct SystemClockContext {
|
|||||||
static_assert(sizeof(SystemClockContext) == 0x20,
|
static_assert(sizeof(SystemClockContext) == 0x20,
|
||||||
"SystemClockContext structure has incorrect size");
|
"SystemClockContext structure has incorrect size");
|
||||||
|
|
||||||
|
struct SteadyClockTimePoint {
|
||||||
|
u64 value;
|
||||||
|
INSERT_PADDING_WORDS(4);
|
||||||
|
};
|
||||||
|
static_assert(sizeof(SteadyClockTimePoint) == 0x18, "SteadyClockTimePoint is incorrect size");
|
||||||
|
|
||||||
class Module final {
|
class Module final {
|
||||||
public:
|
public:
|
||||||
class Interface : public ServiceFramework<Interface> {
|
class Interface : public ServiceFramework<Interface> {
|
||||||
|
Loading…
Reference in New Issue
Block a user