2018-01-14 21:42:23 -05:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
|
2018-04-19 21:41:44 -04:00
|
|
|
namespace Service::Time {
|
2018-01-14 21:42:23 -05:00
|
|
|
|
2018-01-17 14:33:38 -05:00
|
|
|
// TODO(Rozelette) RE this structure
|
|
|
|
struct LocationName {
|
|
|
|
INSERT_PADDING_BYTES(0x24);
|
|
|
|
};
|
2018-01-18 00:57:11 -05:00
|
|
|
static_assert(sizeof(LocationName) == 0x24, "LocationName is incorrect size");
|
2018-01-17 14:33:38 -05:00
|
|
|
|
|
|
|
struct CalendarTime {
|
|
|
|
u16_le year;
|
|
|
|
u8 month; // Starts at 1
|
|
|
|
u8 day; // Starts at 1
|
|
|
|
u8 hour;
|
|
|
|
u8 minute;
|
|
|
|
u8 second;
|
|
|
|
INSERT_PADDING_BYTES(1);
|
|
|
|
};
|
|
|
|
static_assert(sizeof(CalendarTime) == 0x8, "CalendarTime structure has incorrect size");
|
|
|
|
|
|
|
|
// TODO(Rozelette) RE this structure
|
|
|
|
struct CalendarAdditionalInfo {
|
|
|
|
INSERT_PADDING_BYTES(0x18);
|
|
|
|
};
|
|
|
|
static_assert(sizeof(CalendarAdditionalInfo) == 0x18,
|
|
|
|
"CalendarAdditionalInfo structure has incorrect size");
|
|
|
|
|
2018-01-23 22:02:14 -05:00
|
|
|
// TODO(bunnei) RE this structure
|
|
|
|
struct SystemClockContext {
|
|
|
|
INSERT_PADDING_BYTES(0x20);
|
|
|
|
};
|
|
|
|
static_assert(sizeof(SystemClockContext) == 0x20,
|
|
|
|
"SystemClockContext structure has incorrect size");
|
|
|
|
|
2018-01-24 23:52:21 -05:00
|
|
|
struct SteadyClockTimePoint {
|
|
|
|
u64 value;
|
|
|
|
INSERT_PADDING_WORDS(4);
|
|
|
|
};
|
|
|
|
static_assert(sizeof(SteadyClockTimePoint) == 0x18, "SteadyClockTimePoint is incorrect size");
|
|
|
|
|
2018-01-18 11:58:29 -05:00
|
|
|
class Module final {
|
2018-01-17 14:33:38 -05:00
|
|
|
public:
|
2018-01-18 11:58:29 -05:00
|
|
|
class Interface : public ServiceFramework<Interface> {
|
|
|
|
public:
|
|
|
|
Interface(std::shared_ptr<Module> time, const char* name);
|
|
|
|
|
|
|
|
void GetStandardUserSystemClock(Kernel::HLERequestContext& ctx);
|
|
|
|
void GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx);
|
|
|
|
void GetStandardSteadyClock(Kernel::HLERequestContext& ctx);
|
|
|
|
void GetTimeZoneService(Kernel::HLERequestContext& ctx);
|
2018-02-21 20:43:05 -05:00
|
|
|
void GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx);
|
2018-01-18 11:58:29 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
std::shared_ptr<Module> time;
|
|
|
|
};
|
2018-01-17 14:33:38 -05:00
|
|
|
};
|
|
|
|
|
2018-01-14 21:42:23 -05:00
|
|
|
/// Registers all Time services with the specified service manager.
|
|
|
|
void InstallInterfaces(SM::ServiceManager& service_manager);
|
|
|
|
|
2018-04-19 21:41:44 -04:00
|
|
|
} // namespace Service::Time
|