time.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "core/hle/service/service.h"
  6. namespace Service {
  7. namespace Time {
  8. // TODO(Rozelette) RE this structure
  9. struct LocationName {
  10. INSERT_PADDING_BYTES(0x24);
  11. };
  12. static_assert(sizeof(LocationName) == 0x24, "LocationName is incorrect size");
  13. struct CalendarTime {
  14. u16_le year;
  15. u8 month; // Starts at 1
  16. u8 day; // Starts at 1
  17. u8 hour;
  18. u8 minute;
  19. u8 second;
  20. INSERT_PADDING_BYTES(1);
  21. };
  22. static_assert(sizeof(CalendarTime) == 0x8, "CalendarTime structure has incorrect size");
  23. // TODO(Rozelette) RE this structure
  24. struct CalendarAdditionalInfo {
  25. INSERT_PADDING_BYTES(0x18);
  26. };
  27. static_assert(sizeof(CalendarAdditionalInfo) == 0x18,
  28. "CalendarAdditionalInfo structure has incorrect size");
  29. class Module final {
  30. public:
  31. class Interface : public ServiceFramework<Interface> {
  32. public:
  33. Interface(std::shared_ptr<Module> time, const char* name);
  34. void GetStandardUserSystemClock(Kernel::HLERequestContext& ctx);
  35. void GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx);
  36. void GetStandardSteadyClock(Kernel::HLERequestContext& ctx);
  37. void GetTimeZoneService(Kernel::HLERequestContext& ctx);
  38. protected:
  39. std::shared_ptr<Module> time;
  40. };
  41. };
  42. /// Registers all Time services with the specified service manager.
  43. void InstallInterfaces(SM::ServiceManager& service_manager);
  44. } // namespace Time
  45. } // namespace Service