|
|
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:
48: // -c: VM ディレクトリ
49: std::string vmdir {};
50: const std::string& GetVMDir() const { return vmdir; }
51:
52: // -C: ログをコンソールに出力
1.1.1.5 ! root 53: bool log_to_console {};
1.1.1.2 root 54:
55: // -d: 起動時にデバッガで停止
1.1.1.5 ! root 56: bool debug_on_start {};
1.1.1.2 root 57:
58: // -D: コンソールをデバッガで使う
1.1.1.5 ! root 59: bool debug_on_console {};
1.1.1.2 root 60:
61: // -f: 高速モード (XXX 設定ファイルと含めて見直すこと)
1.1.1.5 ! root 62: bool fast_mode {};
1.1.1.2 root 63:
64: // --fontsize: フォントサイズ指定値 (値は fontsize_t ではない)
1.1.1.5 ! root 65: int fontsize {};
1.1.1.2 root 66:
67: // -L: ログ指定文字列
68: char logopt[256] {};
69:
70: // -M: モニタ名
71: std::string monitor_opt {};
72:
73: // -s,--scale: 画面スケール
1.1.1.5 ! root 74: double screen_scale {};
1.1.1.2 root 75:
1.1.1.3 root 76: // --show-config: 設定内容を表示 (1なら通常、2ならall)
77: int show_config {};
1.1.1.2 root 78:
79: // -V: パラメータ指定
1.1.1.5 ! root 80: std::vector<std::string> config_options {};
1.1.1.2 root 81:
82: // -X: Human68k 実行ファイル名と引数
1.1.1.5 ! root 83: const char *human68k_file {};
1.1.1.2 root 84: char human68k_arg[256] {};
85:
86: private:
87: // ヘルプメッセージを表示する
88: void ShowHelp(bool all) const;
89:
90: // バージョンを表示する
91: void ShowVersion() const;
92:
93: // 引数を処理する
94: bool ParseOpt(int ac, char *av[]);
95:
96: // -L オプションを処理する
97: bool ParseLogopt();
98:
99: // CLI/GUI 区別
100: bool IsCLI() const { return is_cli; }
101: bool IsGUI() const { return !is_cli; }
1.1.1.5 ! root 102: bool is_cli {};
1.1.1.2 root 103:
104: // VM 種別
105: vmtype_t vmtype {};
106: };
107:
108: // グローバルインスタンス
109: extern MainApp gMainApp;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.