--- nono/cli/cli_app.cpp 2026/04/29 17:04:33 1.1.1.3 +++ nono/cli/cli_app.cpp 2026/04/29 17:04:48 1.1.1.5 @@ -8,7 +8,6 @@ #include "mainapp.h" #include "mpu680x0.h" #include "pluto.h" -#include "rtc.h" #include "vm.h" void cli_halt_callback(void *); @@ -17,7 +16,7 @@ void cli_halt_callback(void *); class CLIApp { public: - bool OnInit(); + int OnInit(); bool Parse(); [[noreturn]] void OnCreate(); @@ -33,27 +32,27 @@ main(int ac, char *av[]) // wxApp とよく似せるため app->ac = ac; app->av = av; - if (!app->OnInit()) { - return 1; - } - return 0; + return app->OnInit(); } // ここがエントリポイント(のつもり) -bool +int CLIApp::OnInit() { - if (!gMainApp.Init(true, ac, av)) { - return false; + int rv; + + rv = gMainApp.Init(true, ac, av); + if (rv != MainApp::PASS) { + return rv; } if (!gMainApp.Start()) { - return false; + return EXIT_FAILURE; } // メインウィンドウに相当するところ OnCreate(); - return true; + return EXIT_SUCCESS; } // メインウィンドウ作成後のイベントに相当するところ @@ -65,10 +64,6 @@ CLIApp::OnCreate() gMPU680x0->SetHaltCallback(cli_halt_callback, NULL); } - // 時刻開始? - // なるべく VM が開始する直前にしたい。 - gRTC->InitRTC(); - // VM 実行開始 gVM->PowerButton();