--- nono/lib/mainapp.h 2026/04/29 17:04:40 1.1.1.5 +++ nono/lib/mainapp.h 2026/04/29 17:04:57 1.1.1.9 @@ -20,11 +20,11 @@ class MainApp static const int PASS = -1; // 実行を継続 public: - // 初期化 - int Init(bool is_cli_, int ac, char *av[]); + // 初期化 (ステージ1) + int Init1(bool is_cli_, int ac, char *av[]); - // VM 実行開始 - bool Start(); + // 初期化 (ステージ2) + bool Init2(); std::string SearchFile(const std::string& name) const; @@ -35,18 +35,22 @@ class MainApp // 現在の VM が指定の feature を持っているか? bool HasVMFeature(vmf_t flag) const; - public: - // -A: ホストファイル名 (とりあえず) - const char *host_file {}; + // ログレベルを設定する。 + static bool SetLogopt(const std::vector&, std::string *errmsg); + + // ログ名の一覧を表示する + static std::vector GetLogNames(); + public: // -b: ブレークポイント "[,]" std::vector debug_breakaddr {}; // -B: ベンチマークモード int benchmark_mode {}; - // -c: VM ディレクトリ + // -c: VM ディレクトリ or 設定ファイル std::string vmdir {}; + std::string vmfile {}; const std::string& GetVMDir() const { return vmdir; } // -C: ログをコンソールに出力 @@ -64,6 +68,9 @@ class MainApp // --fontsize: フォントサイズ指定値 (値は fontsize_t ではない) int fontsize {}; + // -H: 内蔵 Human68k 風を組み込む。-X による実行ファイル名が必要。 + bool human_mode {}; + // -L: ログ指定文字列 char logopt[256] {}; @@ -79,9 +86,9 @@ class MainApp // -V: パラメータ指定 std::vector config_options {}; - // -X: Human68k 実行ファイル名と引数 - const char *human68k_file {}; - char human68k_arg[256] {}; + // -X: ホスト実行ファイル名とその引数 + const char *exec_file {}; + std::string exec_arg {}; private: // ヘルプメッセージを表示する @@ -96,6 +103,12 @@ class MainApp // -L オプションを処理する bool ParseLogopt(); + // ログレベル1つを設定する。 + static bool SetLogopt1(const std::string&, std::string *errmsg); + + // コンパイルされている host netdriver の一覧を表示 + void ShowHostnet() const; + // CLI/GUI 区別 bool IsCLI() const { return is_cli; } bool IsGUI() const { return !is_cli; }