--- nono/cli/cli_app.cpp 2026/04/29 17:04:40 1.1.1.4 +++ nono/cli/cli_app.cpp 2026/04/29 17:04:51 1.1.1.6 @@ -8,7 +8,6 @@ #include "mainapp.h" #include "mpu680x0.h" #include "pluto.h" -#include "rtc.h" #include "vm.h" void cli_halt_callback(void *); @@ -42,14 +41,20 @@ CLIApp::OnInit() { int rv; - rv = gMainApp.Init(true, ac, av); + // CLI 側では関係ないが wx 側で必要なので初期化は2ステージに分かれている + rv = gMainApp.Init1(true, ac, av); if (rv != MainApp::PASS) { return rv; } - if (!gMainApp.Start()) { + if (!gMainApp.Init2()) { return EXIT_FAILURE; } + // VM にコールバックを登録 + if (gMPU680x0) { + gMPU680x0->SetHaltCallback(cli_halt_callback, NULL); + } + // メインウィンドウに相当するところ OnCreate(); @@ -60,16 +65,7 @@ CLIApp::OnInit() void CLIApp::OnCreate() { - // VM にコールバックを登録 - if (gMPU680x0) { - gMPU680x0->SetHaltCallback(cli_halt_callback, NULL); - } - - // 時刻開始? - // なるべく VM が開始する直前にしたい。 - gRTC->InitRTC(); - - // VM 実行開始 + // 電源投入 gVM->PowerButton(); // ?