--- nono/vm/power.cpp 2026/04/29 17:05:24 1.1.1.4 +++ nono/vm/power.cpp 2026/04/29 17:05:28 1.1.1.5 @@ -201,7 +201,7 @@ PowerDevice::GetPowerButtonState() const void PowerDevice::SetSystemPowerOn(bool poweron) { - assert("PowerDevice::SetSystemPowerOn should not be called."); + assertmsg(false, "PowerDevice::SetSystemPowerOn should not be called."); } @@ -223,9 +223,6 @@ PowerDevice::SetSystemPowerOn(bool power LunaPowerDevice::LunaPowerDevice() : inherited() { - event.func = ToEventCallback(&LunaPowerDevice::PowerCallback); - event.time = 1_msec; - event.Regist("Power Off"); } // デストラクタ @@ -233,6 +230,22 @@ LunaPowerDevice::~LunaPowerDevice() { } +// 初期化 +bool +LunaPowerDevice::Init() +{ + if (inherited::Init() == false) { + return false; + } + + event.func = ToEventCallback(&LunaPowerDevice::PowerCallback); + event.time = 1_msec; + event.SetName("Power Off"); + scheduler->RegistEvent(event); + + return true; +} + // PIO1 の PC4 が繋がっているということにする。 void LunaPowerDevice::SetSystemPowerOn(bool poweron) @@ -325,7 +338,7 @@ X68030PowerDevice::Change() { bool old_power = ispower; bool new_power = power_button | alarm_out | system_poweron; - putlog(1, "Change: old=%d new=%d (button=%d alarm=%d system=%d)", + putlog(1, "Change: old=%u new=%u (button=%u alarm=%u system=%u)", old_power, new_power, power_button, alarm_out, system_poweron); if (old_power == false && new_power) {