--- nono/cli/cli_app.cpp 2026/04/29 17:04:53 1.1.1.7 +++ nono/cli/cli_app.cpp 2026/04/29 17:04:56 1.1.1.8 @@ -5,14 +5,13 @@ // #include "header.h" +#include "cuimessage.h" #include "mainapp.h" #include "mpu680x0.h" #include "pluto.h" #include "scheduler.h" #include "vm.h" -void cli_halt_callback(void *); - // wxApp と相似にするためのクラス class CLIApp { @@ -20,6 +19,7 @@ class CLIApp int OnInit(); bool Parse(); int OnCreate(); + void OnHalt(); int ac; char **av; @@ -51,11 +51,6 @@ CLIApp::OnInit() return EXIT_FAILURE; } - // VM にコールバックを登録 - if (gMPU680x0) { - gMPU680x0->SetHaltCallback(cli_halt_callback, NULL); - } - // メインウィンドウに相当するところ OnCreate(); @@ -66,6 +61,13 @@ CLIApp::OnInit() int CLIApp::OnCreate() { + if (gMPU680x0) { + CUIMessage::Connect(UIMessage::HALT, + [&](const UIMessage&) { OnHalt(); }); + } + // UIMessage の処理を開始する。 + UIMessage::Attach(&CUIMessage::Process); + // 電源投入 gVM->PowerButton(); @@ -78,7 +80,7 @@ CLIApp::OnCreate() // m680x0 ダブルバスフォールト時に呼ばれるコールバック。 void -cli_halt_callback(void *dummy) +CLIApp::OnHalt() { // どうする? warnx("Double bus fault has occurred in VM");