--- nono/cli/cli_app.cpp 2026/04/29 17:05:13 1.1.1.10 +++ nono/cli/cli_app.cpp 2026/04/29 17:05:23 1.1.1.12 @@ -12,10 +12,8 @@ #include "cuimessage.h" #include "kevent.h" #include "mainapp.h" -#include "mpu680x0.h" -#include "pluto.h" +#include "monitor.h" #include "power.h" -#include "vm.h" // wxApp と相似にするためのクラス class CLIApp @@ -61,6 +59,11 @@ CLIApp::OnInit() if (kq < 0) { return EXIT_FAILURE; } + + // モニタ登録締切。CLI ではあまり関係ないけど揃えておく。 + gMonitorManager->Fix(); + + // スレッド作成を伴う初期化。 if (!gMainApp.Init2()) { return EXIT_FAILURE; } @@ -68,6 +71,9 @@ CLIApp::OnInit() // メインウィンドウに相当するところ OnCreate(); + // 戻ってきたので、VM を解放。 + gMainApp.Dispose(); + return EXIT_SUCCESS; } @@ -77,7 +83,7 @@ CLIApp::OnCreate() { CUIMessage::Connect(UIMessage::APPEXIT, [&](const UIMessage&) { OnAppExit(); }); - if (gMPU680x0) { + if (gMainApp.Has(VMCap::M68K)) { CUIMessage::Connect(UIMessage::HALT, [&](const UIMessage&) { OnHalt(); }); } @@ -85,7 +91,8 @@ CLIApp::OnCreate() UIMessage::Attach(&CUIMessage::Process); // 電源投入 - gPower->PowerButton(); + auto power = GetPowerDevice(); + power->PushPowerButton(); // メッセージを待つ while (exit_request == false) { @@ -112,9 +119,6 @@ CLIApp::OnCreate() CUIMessage::Dispatch(m); } - // VM を解放 - gVM->Dispose(); - return 0; }