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

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.2   root       23:        // 初期化
1.1.1.5   root       24:        int Init(bool is_cli_, int ac, char *av[]);
1.1       root       25: 
1.1.1.2   root       26:        // VM 実行開始
                     27:        bool Start();
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.2   root       38:  public:
                     39:        // -A: ホストファイル名 (とりあえず)
1.1.1.5   root       40:        const char *host_file {};
1.1.1.2   root       41: 
1.1.1.4   root       42:        // -b: ブレークポイント "<addr>[,<skip>]"
                     43:        std::vector<std::string> debug_breakaddr {};
1.1.1.2   root       44: 
                     45:        // -B: ベンチマークモード
1.1.1.5   root       46:        int benchmark_mode {};
1.1.1.2   root       47: 
1.1.1.6 ! root       48:        // -c: VM ディレクトリ or 設定ファイル
1.1.1.2   root       49:        std::string vmdir {};
1.1.1.6 ! root       50:        std::string vmfile {};
1.1.1.2   root       51:        const std::string& GetVMDir() const { return vmdir; }
                     52: 
                     53:        // -C: ログをコンソールに出力
1.1.1.5   root       54:        bool log_to_console {};
1.1.1.2   root       55: 
                     56:        // -d: 起動時にデバッガで停止
1.1.1.5   root       57:        bool debug_on_start {};
1.1.1.2   root       58: 
                     59:        // -D: コンソールをデバッガで使う
1.1.1.5   root       60:        bool debug_on_console {};
1.1.1.2   root       61: 
                     62:        // -f: 高速モード (XXX 設定ファイルと含めて見直すこと)
1.1.1.5   root       63:        bool fast_mode {};
1.1.1.2   root       64: 
                     65:        // --fontsize: フォントサイズ指定値 (値は fontsize_t ではない)
1.1.1.5   root       66:        int  fontsize {};
1.1.1.2   root       67: 
                     68:        // -L: ログ指定文字列
                     69:        char logopt[256] {};
                     70: 
                     71:        // -M: モニタ名
                     72:        std::string monitor_opt {};
                     73: 
                     74:        // -s,--scale: 画面スケール
1.1.1.5   root       75:        double screen_scale {};
1.1.1.2   root       76: 
1.1.1.3   root       77:        // --show-config: 設定内容を表示 (1なら通常、2ならall)
                     78:        int show_config {};
1.1.1.2   root       79: 
                     80:        // -V: パラメータ指定
1.1.1.5   root       81:        std::vector<std::string> config_options {};
1.1.1.2   root       82: 
                     83:        // -X: Human68k 実行ファイル名と引数
1.1.1.5   root       84:        const char *human68k_file {};
1.1.1.2   root       85:        char human68k_arg[256] {};
                     86: 
                     87:  private:
                     88:        // ヘルプメッセージを表示する
                     89:        void ShowHelp(bool all) const;
                     90: 
                     91:        // バージョンを表示する
                     92:        void ShowVersion() const;
                     93: 
                     94:        // 引数を処理する
                     95:        bool ParseOpt(int ac, char *av[]);
                     96: 
                     97:        // -L オプションを処理する
                     98:        bool ParseLogopt();
                     99: 
                    100:        // CLI/GUI 区別
                    101:        bool IsCLI() const { return  is_cli; }
                    102:        bool IsGUI() const { return !is_cli; }
1.1.1.5   root      103:        bool is_cli {};
1.1.1.2   root      104: 
                    105:        // VM 種別
                    106:        vmtype_t vmtype {};
                    107: };
                    108: 
                    109: // グローバルインスタンス
                    110: 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.