|
|
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:
19: // 初期化
20: bool Init(bool is_cli_, int ac, char *av[]);
1.1 root 21:
1.1.1.2 root 22: // VM 実行開始
23: bool Start();
1.1 root 24:
1.1.1.2 root 25: std::string SearchFile(const std::string& name) const;
26:
27: // vmtype (VMTYPE_*) を返す。
28: // (Config が持っているのは文字列)
29: vmtype_t GetVMType() const { return vmtype; }
30:
1.1.1.3 ! root 31: // 現在の VM が指定の feature を持っているか?
! 32: bool HasVMFeature(vmf_t flag) const;
! 33:
1.1.1.2 root 34: public:
35: // -A: ホストファイル名 (とりあえず)
36: const char *host_file = NULL;
37:
38: // -b: ブレークポイント
1.1.1.3 ! root 39: std::vector<uint32> debug_breakaddr {};
1.1.1.2 root 40:
41: // -B: ベンチマークモード
42: int benchmark_mode = 0;
43:
44: // -c: VM ディレクトリ
45: std::string vmdir {};
46: const std::string& GetVMDir() const { return vmdir; }
47:
48: // -C: ログをコンソールに出力
49: bool log_to_console = false;
50:
51: // -d: 起動時にデバッガで停止
52: bool debug_on_start = false;
53:
54: // -D: コンソールをデバッガで使う
55: bool debug_on_console = false;
56:
57: // -f: 高速モード (XXX 設定ファイルと含めて見直すこと)
58: bool fast_mode = false;
59:
60: // --fontsize: フォントサイズ指定値 (値は fontsize_t ではない)
61: int fontsize = 0;
62:
63: // -L: ログ指定文字列
64: char logopt[256] {};
65:
66: // -M: モニタ名
67: std::string monitor_opt {};
68:
69: // -s,--scale: 画面スケール
70: double screen_scale = 0.0;
71:
1.1.1.3 ! root 72: // --show-config: 設定内容を表示 (1なら通常、2ならall)
! 73: int show_config {};
1.1.1.2 root 74:
75: // -V: パラメータ指定
76: std::vector<std::string> config_options;
77:
78: // -X: Human68k 実行ファイル名と引数
79: const char *human68k_file = NULL;
80: char human68k_arg[256] {};
81:
82: private:
83: // ヘルプメッセージを表示する
84: void ShowHelp(bool all) const;
85:
86: // バージョンを表示する
87: void ShowVersion() const;
88:
89: // 引数を処理する
90: bool ParseOpt(int ac, char *av[]);
91:
92: // -L オプションを処理する
93: bool ParseLogopt();
94:
95: // CLI/GUI 区別
96: bool IsCLI() const { return is_cli; }
97: bool IsGUI() const { return !is_cli; }
98: bool is_cli;
99:
100: // VM 種別
101: vmtype_t vmtype {};
102: };
103:
104: // グローバルインスタンス
105: extern MainApp gMainApp;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.