diff options
author | bunnei <bunneidev@gmail.com> | 2022-06-15 18:53:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 18:53:50 +0200 |
commit | 5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e (patch) | |
tree | e8a79e5581b24cc27c6ee1ecc0cc80464342a786 /src/core/hle/service/glue/notif.h | |
parent | Merge pull request #8464 from liamwhite/break-debug (diff) | |
parent | service: notifa: Implement most part of this service (diff) | |
download | yuzu-5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e.tar yuzu-5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e.tar.gz yuzu-5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e.tar.bz2 yuzu-5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e.tar.lz yuzu-5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e.tar.xz yuzu-5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e.tar.zst yuzu-5ace5c1b7a6ce80f3c1186ca72c7ea6d8b18900e.zip |
Diffstat (limited to 'src/core/hle/service/glue/notif.h')
-rw-r--r-- | src/core/hle/service/glue/notif.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/core/hle/service/glue/notif.h b/src/core/hle/service/glue/notif.h index 7310d7f72..4467e1f35 100644 --- a/src/core/hle/service/glue/notif.h +++ b/src/core/hle/service/glue/notif.h @@ -3,6 +3,10 @@ #pragma once +#include <array> +#include <vector> + +#include "common/uuid.h" #include "core/hle/service/service.h" namespace Core { @@ -17,8 +21,52 @@ public: ~NOTIF_A() override; private: + static constexpr std::size_t max_alarms = 8; + + // This is nn::notification::AlarmSettingId + using AlarmSettingId = u16; + static_assert(sizeof(AlarmSettingId) == 0x2, "AlarmSettingId is an invalid size"); + + using ApplicationParameter = std::array<u8, 0x400>; + static_assert(sizeof(ApplicationParameter) == 0x400, "ApplicationParameter is an invalid size"); + + struct DailyAlarmSetting { + s8 hour; + s8 minute; + }; + static_assert(sizeof(DailyAlarmSetting) == 0x2, "DailyAlarmSetting is an invalid size"); + + struct WeeklyScheduleAlarmSetting { + INSERT_PADDING_BYTES(0xA); + std::array<DailyAlarmSetting, 0x7> day_of_week; + }; + static_assert(sizeof(WeeklyScheduleAlarmSetting) == 0x18, + "WeeklyScheduleAlarmSetting is an invalid size"); + + // This is nn::notification::AlarmSetting + struct AlarmSetting { + AlarmSettingId alarm_setting_id; + u8 kind; + u8 muted; + INSERT_PADDING_BYTES(0x4); + Common::UUID account_id; + u64 application_id; + INSERT_PADDING_BYTES(0x8); + WeeklyScheduleAlarmSetting schedule; + }; + static_assert(sizeof(AlarmSetting) == 0x40, "AlarmSetting is an invalid size"); + + void RegisterAlarmSetting(Kernel::HLERequestContext& ctx); + void UpdateAlarmSetting(Kernel::HLERequestContext& ctx); void ListAlarmSettings(Kernel::HLERequestContext& ctx); + void LoadApplicationParameter(Kernel::HLERequestContext& ctx); + void DeleteAlarmSetting(Kernel::HLERequestContext& ctx); void Initialize(Kernel::HLERequestContext& ctx); + + std::vector<AlarmSetting>::iterator GetAlarmFromId(AlarmSettingId alarm_setting_id); + + std::vector<AlarmSetting> alarms{}; + AlarmSettingId last_alarm_setting_id{}; }; } // namespace Service::Glue |