|
|
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 "monitor.h"
15: #include <array>
1.1.1.3 ! root 16: #include <map>
1.1 root 17: #include <vector>
18:
1.1.1.3 ! root 19: class MainbusDevice;
! 20: class MPUDevice;
! 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.2 root 27: 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 *GetTableName(int vector) const;
34:
35: // 例外名を返す (例外履歴用)
36: const char *GetExceptionName(int vector) const;
37:
38: // ベクタテーブルの要素数を返す
39: int Size() const { return nametable.size(); }
40:
41: // モニタ更新
42: DECLARE_MONITOR_CALLBACK(MonitorUpdate);
43:
44: private:
45: // 初期化
1.1.1.2 root 46: void InitTableM68030(VMType vmtype);
1.1 root 47: void InitTableLuna88k();
48:
49: // ベクタテーブル
50: std::vector<const char *> nametable {};
51:
1.1.1.3 ! root 52: MainbusDevice *mainbus {};
! 53: MPUDevice *mpu {};
! 54:
1.1 root 55: // モニタ
56: Monitor monitor { this };
57:
58: // 初期値
59: static std::array<const char * const, 64> name_m68030;
1.1.1.3 ! root 60: static std::map<int, const char * const> name_x68030;
! 61: static std::map<int, const char * const> name_luna1;
! 62: static std::map<int, const char * const> name_news;
1.1 root 63: static std::array<const char * const, 11> name_luna88k;
64: };
65:
1.1.1.3 ! root 66: static inline VectorTable *GetVectorTable() {
! 67: return Object::GetObject<VectorTable>(OBJ_VECTOR_TABLE);
! 68: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.