--- nono/vm/mpu88xx0.h 2026/04/29 17:04:45 1.1.1.5 +++ nono/vm/mpu88xx0.h 2026/04/29 17:04:55 1.1.1.9 @@ -15,18 +15,18 @@ class MPU88xx0Device : public MPUDevice { using inherited = MPUDevice; public: - MPU88xx0Device(uint32 reset_vector); + MPU88xx0Device(); virtual ~MPU88xx0Device() override; bool Init() override; - - void MonitorUpdate(TextScreen&) override; + bool PowerOn() override; + void ResetHard() override; // MPU を vtime [nsec] 分実行する uint32 Run(uint32 vtime) override { return cpu->Run(vtime); } // 現在の仮想時刻 [nsec] を取得する - uint64 GetVirtTime() override { return cpu->GetVTime(); } + uint64 GetVirtTime() const override { return cpu->GetVTime(); } // MPU の処理をこの命令で中断させる。 void Release() override { cpu->Release(); } @@ -35,8 +35,8 @@ class MPU88xx0Device : public MPUDevice uint32 GetPPC() const override { return cpu->GetXIP(); } // 現在アクセス中の論理アドレス、物理アドレスを取得。 - uint32 GetLaddr() const override { return 0; } // XXX NotImplemented - uint32 GetPaddr() const override { return 0; } // XXX NotImplemented + uint32 GetLaddr() const override; + uint32 GetPaddr() const override; // アクセスウェイトを加算 void AddCycle(int32 cycle) override; @@ -48,25 +48,11 @@ class MPU88xx0Device : public MPUDevice m88kcpu *GetCPU() const { return cpu.get(); } private: - // イベントコールバック - void Callback(Event& ev); + // レジスタモニター + DECLARE_MONITOR_CALLBACK(MonitorUpdate); + Monitor monitor { this }; std::unique_ptr cpu {}; }; -// ATC モニタ -class MPU88200ATC : public Object -{ - public: - MPU88200ATC(m88200 *cmmu); - ~MPU88200ATC() override { } - - void MonitorUpdate(TextScreen&) override; - - private: - m88200 *cmmu {}; -}; - -extern std::unique_ptr gMPU88200ATC[2]; - #define gMPU88xx0 (dynamic_cast(gMPU.get()))