Annotation of nono/lib/mainapp.h, revision 1.1.1.10

1.1       root        1: //
                      2: // nono
1.1.1.3   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
                      7: #pragma once
                      8: 
1.1.1.2   root        9: #include "config.h"
1.1       root       10: #include "debugger.h"
                     11: #include "logger.h"
1.1.1.2   root       12: #include "vm_luna.h"
                     13: #include "vm_x68k.h"
1.1       root       14: 
1.1.1.2   root       15: // 起動時の引数処理などを行う。
                     16: class MainApp
1.1       root       17: {
1.1.1.2   root       18:  public:
1.1.1.5   root       19:        // Init() の戻り値
                     20:        static const int PASS = -1;             // 実行を継続
                     21: 
                     22:  public:
1.1.1.7   root       23:        // 初期化 (ステージ1)
                     24:        int Init1(bool is_cli_, int ac, char *av[]);
1.1       root       25: 
1.1.1.7   root       26:        // 初期化 (ステージ2)
                     27:        bool Init2();
1.1       root       28: 
1.1.1.2   root       29:        std::string SearchFile(const std::string& name) const;
                     30: 
                     31:        // vmtype (VMTYPE_*) を返す。
                     32:        // (Config が持っているのは文字列)
                     33:        vmtype_t GetVMType() const { return vmtype; }
                     34: 
1.1.1.3   root       35:        // 現在の VM が指定の feature を持っているか?
                     36:        bool HasVMFeature(vmf_t flag) const;
                     37: 
1.1.1.8   root       38:        // ログレベルを設定する。
                     39:        static bool SetLogopt(const std::vector<std::string>&, std::string *errmsg);
                     40: 
                     41:        // ログ名の一覧を表示する
                     42:        static std::vector<std::string> GetLogNames();
                     43: 
1.1.1.2   root       44:  public:
1.1.1.4   root       45:        // -b: ブレークポイント "<addr>[,<skip>]"
                     46:        std::vector<std::string> debug_breakaddr {};
1.1.1.2   root       47: 
                     48:        // -B: ベンチマークモード
1.1.1.5   root       49:        int benchmark_mode {};
1.1.1.2   root       50: 
1.1.1.6   root       51:        // -c: VM ディレクトリ or 設定ファイル
1.1.1.2   root       52:        std::string vmdir {};
1.1.1.6   root       53:        std::string vmfile {};
1.1.1.2   root       54:        const std::string& GetVMDir() const { return vmdir; }
                     55: 
                     56:        // -C: ログをコンソールに出力
1.1.1.5   root       57:        bool log_to_console {};
1.1.1.2   root       58: 
                     59:        // -d: 起動時にデバッガで停止
1.1.1.5   root       60:        bool debug_on_start {};
1.1.1.2   root       61: 
                     62:        // -D: コンソールをデバッガで使う
1.1.1.5   root       63:        bool debug_on_console {};
1.1.1.2   root       64: 
                     65:        // -f: 高速モード (XXX 設定ファイルと含めて見直すこと)
1.1.1.5   root       66:        bool fast_mode {};
1.1.1.2   root       67: 
                     68:        // --fontsize: フォントサイズ指定値 (値は fontsize_t ではない)
1.1.1.5   root       69:        int  fontsize {};
1.1.1.2   root       70: 
1.1.1.9   root       71:        // -H: 内蔵 Human68k 風を組み込む。-X による実行ファイル名が必要。
                     72:        bool human_mode {};
                     73: 
1.1.1.2   root       74:        // -L: ログ指定文字列
                     75:        char logopt[256] {};
                     76: 
                     77:        // -M: モニタ名
                     78:        std::string monitor_opt {};
                     79: 
                     80:        // -s,--scale: 画面スケール
1.1.1.5   root       81:        double screen_scale {};
1.1.1.2   root       82: 
1.1.1.3   root       83:        // --show-config: 設定内容を表示 (1なら通常、2ならall)
                     84:        int show_config {};
1.1.1.2   root       85: 
                     86:        // -V: パラメータ指定
1.1.1.5   root       87:        std::vector<std::string> config_options {};
1.1.1.2   root       88: 
1.1.1.9   root       89:        // -X: ホスト実行ファイル名とその引数
                     90:        const char *exec_file {};
                     91:        std::string exec_arg {};
1.1.1.10! root       92:        bool load_and_exec {};
1.1.1.2   root       93: 
                     94:  private:
                     95:        // ヘルプメッセージを表示する
                     96:        void ShowHelp(bool all) const;
                     97: 
                     98:        // バージョンを表示する
                     99:        void ShowVersion() const;
                    100: 
                    101:        // 引数を処理する
                    102:        bool ParseOpt(int ac, char *av[]);
                    103: 
                    104:        // -L オプションを処理する
                    105:        bool ParseLogopt();
                    106: 
1.1.1.8   root      107:        // ログレベル1つを設定する。
                    108:        static bool SetLogopt1(const std::string&, std::string *errmsg);
                    109: 
                    110:        // コンパイルされている host netdriver の一覧を表示
                    111:        void ShowHostnet() const;
                    112: 
1.1.1.2   root      113:        // CLI/GUI 区別
                    114:        bool IsCLI() const { return  is_cli; }
                    115:        bool IsGUI() const { return !is_cli; }
1.1.1.5   root      116:        bool is_cli {};
1.1.1.2   root      117: 
                    118:        // VM 種別
                    119:        vmtype_t vmtype {};
                    120: };
                    121: 
                    122: // グローバルインスタンス
                    123: extern MainApp gMainApp;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.