--- nono/debugger/vectortable.h 2026/04/29 17:05:09 1.1 +++ nono/debugger/vectortable.h 2026/04/29 17:05:49 1.1.1.7 @@ -10,21 +10,24 @@ #pragma once -#include "object.h" -#include "monitor.h" +#include "device.h" #include +#include #include -class VectorTable : public Object +class MainbusDevice; +class MainMPUDevice; +enum class VMType; + +class VectorTable : public Device { - using inherited = Object; + using inherited = Device; public: - VectorTable(int vmtype); + explicit VectorTable(VMType vmtype); ~VectorTable() override; - // 例外名を返す (ベクタテーブル用) - const char *GetTableName(int vector) const; + bool Init() override; // 例外名を返す (例外履歴用) const char *GetExceptionName(int vector) const; @@ -32,25 +35,36 @@ class VectorTable : public Object // ベクタテーブルの要素数を返す int Size() const { return nametable.size(); } - // モニタ更新 - DECLARE_MONITOR_CALLBACK(MonitorUpdate); - private: // 初期化 - void InitTableM68030(int vmtype); + void InitTableM680x0(VMType vmtype); void InitTableLuna88k(); + // モニタ更新 + DECLARE_MONITOR_CALLBACK(MonitorUpdateM680x0); + DECLARE_MONITOR_CALLBACK(MonitorUpdateM88xx0); + + // m88100 のベクタテーブルから再分岐先を取得する。 + busaddr VectorToAddr(uint32 vecaddr); + // ベクタテーブル std::vector nametable {}; + MainbusDevice *mainbus {}; + MainMPUDevice *mpu {}; + // モニタ - Monitor monitor { this }; + Monitor *monitor {}; // 初期値 - static std::array name_m68030; - static std::array name_x68030; - static std::array name_luna1; - static std::array name_luna88k; + static std::array name_m680x0; + static std::map name_x68030; + static std::map name_luna1; + static std::map name_news; + static std::map name_virt68k; + static std::map name_luna88k; }; -extern VectorTable *gVectorTable; +static inline VectorTable *GetVectorTable() { + return Object::GetObject(OBJ_VECTOR_TABLE); +}