--- nono/vm/mpu88xx0.h 2026/04/29 17:04:42 1.1.1.4 +++ nono/vm/mpu88xx0.h 2026/04/29 17:04:50 1.1.1.7 @@ -15,16 +15,18 @@ class MPU88xx0Device : public MPUDevice { using inherited = MPUDevice; public: - MPU88xx0Device(uint32 reset_addr); - ~MPU88xx0Device() override; + MPU88xx0Device(uint32 reset_vector); + virtual ~MPU88xx0Device() override; + + bool Init() override; void MonitorUpdate(TextScreen&) override; - // MPU を request サイクル分実行する - uint32 Run(uint64 request) override { return cpu->Run(request); } + // MPU を vtime [nsec] 分実行する + uint32 Run(uint32 vtime) override { return cpu->Run(vtime); } - // 基準サイクル数を取得 - uint64 total_cycle() const override { return cpu->GetTotalCycle(); } + // 現在の仮想時刻 [nsec] を取得する + uint64 GetVirtTime() const override { return cpu->GetVTime(); } // MPU の処理をこの命令で中断させる。 void Release() override { cpu->Release(); } @@ -33,24 +35,21 @@ 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(uint64 cycle) override; + void AddCycle(int32 cycle) override; // 割り込み発生を MPU に通知 - void Interrupt(Object *src, int level) override; + void Interrupt(int level) override; // CPU コアを取得 (主にデバッグ用途) m88kcpu *GetCPU() const { return cpu.get(); } private: - // リセット例外イベントコールバック - void ResetCallback(Event& ev); - - // リセットベクタ - uint32 reset_vector {}; + // イベントコールバック + void Callback(Event& ev); std::unique_ptr cpu {}; };