|
|
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:
45: // -A: ホストファイル名 (とりあえず)
1.1.1.5 root 46: const char *host_file {};
1.1.1.2 root 47:
1.1.1.4 root 48: // -b: ブレークポイント "<addr>[,<skip>]"
49: std::vector<std::string> debug_breakaddr {};
1.1.1.2 root 50:
51: // -B: ベンチマークモード
1.1.1.5 root 52: int benchmark_mode {};
1.1.1.2 root 53:
1.1.1.6 root 54: // -c: VM ディレクトリ or 設定ファイル
1.1.1.2 root 55: std::string vmdir {};
1.1.1.6 root 56: std::string vmfile {};
1.1.1.2 root 57: const std::string& GetVMDir() const { return vmdir; }
58:
59: // -C: ログをコンソールに出力
1.1.1.5 root 60: bool log_to_console {};
1.1.1.2 root 61:
62: // -d: 起動時にデバッガで停止
1.1.1.5 root 63: bool debug_on_start {};
1.1.1.2 root 64:
65: // -D: コンソールをデバッガで使う
1.1.1.5 root 66: bool debug_on_console {};
1.1.1.2 root 67:
68: // -f: 高速モード (XXX 設定ファイルと含めて見直すこと)
1.1.1.5 root 69: bool fast_mode {};
1.1.1.2 root 70:
71: // --fontsize: フォントサイズ指定値 (値は fontsize_t ではない)
1.1.1.5 root 72: int fontsize {};
1.1.1.2 root 73:
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:
89: // -X: Human68k 実行ファイル名と引数
1.1.1.5 root 90: const char *human68k_file {};
1.1.1.2 root 91: char human68k_arg[256] {};
92:
93: private:
94: // ヘルプメッセージを表示する
95: void ShowHelp(bool all) const;
96:
97: // バージョンを表示する
98: void ShowVersion() const;
99:
100: // 引数を処理する
101: bool ParseOpt(int ac, char *av[]);
102:
103: // -L オプションを処理する
104: bool ParseLogopt();
105:
1.1.1.8 ! root 106: // ログレベル1つを設定する。
! 107: static bool SetLogopt1(const std::string&, std::string *errmsg);
! 108:
! 109: // コンパイルされている host netdriver の一覧を表示
! 110: void ShowHostnet() const;
! 111:
1.1.1.2 root 112: // CLI/GUI 区別
113: bool IsCLI() const { return is_cli; }
114: bool IsGUI() const { return !is_cli; }
1.1.1.5 root 115: bool is_cli {};
1.1.1.2 root 116:
117: // VM 種別
118: vmtype_t vmtype {};
119: };
120:
121: // グローバルインスタンス
122: extern MainApp gMainApp;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.