--- nono/lib/mainapp.h 2026/04/29 17:04:34 1.1.1.3 +++ nono/lib/mainapp.h 2026/04/29 17:04:51 1.1.1.7 @@ -16,11 +16,15 @@ class MainApp { public: - // 初期化 - bool Init(bool is_cli_, int ac, char *av[]); + // Init() の戻り値 + static const int PASS = -1; // 実行を継続 - // VM 実行開始 - bool Start(); + public: + // 初期化 (ステージ1) + int Init1(bool is_cli_, int ac, char *av[]); + + // 初期化 (ステージ2) + bool Init2(); std::string SearchFile(const std::string& name) const; @@ -33,32 +37,33 @@ class MainApp public: // -A: ホストファイル名 (とりあえず) - const char *host_file = NULL; + const char *host_file {}; - // -b: ブレークポイント - std::vector debug_breakaddr {}; + // -b: ブレークポイント "[,]" + std::vector debug_breakaddr {}; // -B: ベンチマークモード - int benchmark_mode = 0; + int benchmark_mode {}; - // -c: VM ディレクトリ + // -c: VM ディレクトリ or 設定ファイル std::string vmdir {}; + std::string vmfile {}; const std::string& GetVMDir() const { return vmdir; } // -C: ログをコンソールに出力 - bool log_to_console = false; + bool log_to_console {}; // -d: 起動時にデバッガで停止 - bool debug_on_start = false; + bool debug_on_start {}; // -D: コンソールをデバッガで使う - bool debug_on_console = false; + bool debug_on_console {}; // -f: 高速モード (XXX 設定ファイルと含めて見直すこと) - bool fast_mode = false; + bool fast_mode {}; // --fontsize: フォントサイズ指定値 (値は fontsize_t ではない) - int fontsize = 0; + int fontsize {}; // -L: ログ指定文字列 char logopt[256] {}; @@ -67,16 +72,16 @@ class MainApp std::string monitor_opt {}; // -s,--scale: 画面スケール - double screen_scale = 0.0; + double screen_scale {}; // --show-config: 設定内容を表示 (1なら通常、2ならall) int show_config {}; // -V: パラメータ指定 - std::vector config_options; + std::vector config_options {}; // -X: Human68k 実行ファイル名と引数 - const char *human68k_file = NULL; + const char *human68k_file {}; char human68k_arg[256] {}; private: @@ -95,7 +100,7 @@ class MainApp // CLI/GUI 区別 bool IsCLI() const { return is_cli; } bool IsGUI() const { return !is_cli; } - bool is_cli; + bool is_cli {}; // VM 種別 vmtype_t vmtype {};