|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2022 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: //
8: // ベクタテーブル (モニタ)
9: //
10:
11: #pragma once
12:
1.1.1.3 root 13: #include "device.h"
1.1 root 14: #include <array>
1.1.1.3 root 15: #include <map>
1.1 root 16: #include <vector>
17:
1.1.1.3 root 18: class MainbusDevice;
1.1.1.4 root 19: class MainMPUDevice;
1.1.1.5 root 20: enum class VMType;
1.1.1.3 root 21:
22: class VectorTable : public Device
1.1 root 23: {
1.1.1.3 root 24: using inherited = Device;
1.1 root 25:
26: public:
1.1.1.4 root 27: explicit VectorTable(VMType vmtype);
1.1 root 28: ~VectorTable() override;
29:
1.1.1.3 root 30: bool Init() override;
31:
1.1 root 32: // 例外名を返す (例外履歴用)
33: const char *GetExceptionName(int vector) const;
34:
35: // ベクタテーブルの要素数を返す
36: int Size() const { return nametable.size(); }
37:
38: // モニタ更新
39: DECLARE_MONITOR_CALLBACK(MonitorUpdate);
40:
41: private:
42: // 初期化
1.1.1.5 root 43: void InitTableM680x0(VMType vmtype);
1.1 root 44: void InitTableLuna88k();
45:
46: // ベクタテーブル
47: std::vector<const char *> nametable {};
48:
1.1.1.3 root 49: MainbusDevice *mainbus {};
1.1.1.4 root 50: MainMPUDevice *mpu {};
1.1.1.3 root 51:
1.1 root 52: // モニタ
1.1.1.5 root 53: Monitor *monitor {};
1.1 root 54:
55: // 初期値
1.1.1.5 root 56: static std::array<const char * const, 64> name_m680x0;
1.1.1.3 root 57: static std::map<int, const char * const> name_x68030;
58: static std::map<int, const char * const> name_luna1;
59: static std::map<int, const char * const> name_news;
1.1.1.5 root 60: static std::map<int, const char * const> name_virt68k;
1.1 root 61: static std::array<const char * const, 11> name_luna88k;
62: };
63:
1.1.1.3 root 64: static inline VectorTable *GetVectorTable() {
65: return Object::GetObject<VectorTable>(OBJ_VECTOR_TABLE);
66: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.