--- nono/vm/power.h 2026/04/29 17:05:14 1.1.1.2 +++ nono/vm/power.h 2026/04/29 17:05:17 1.1.1.3 @@ -14,6 +14,8 @@ #include "event.h" #include "message.h" +class Syncer; + class PowerDevice : public Device { using inherited = Device; @@ -21,6 +23,8 @@ class PowerDevice : public Device PowerDevice(); ~PowerDevice() override; + bool Init() override; + // 電源ボタンを押す void PowerButton(); @@ -74,8 +78,12 @@ class PowerDevice : public Device // システム内の電源オン信号に相当 bool system_poweron {}; + Syncer *syncer {}; + // 電源オフイベント Event event { this }; }; -extern PowerDevice *gPower; +static inline PowerDevice *GetPowerDevice() { + return Object::GetObject(OBJ_POWER); +}