--- nono/vm/mpu88xx0.h 2026/04/29 17:04:39 1.1.1.3 +++ nono/vm/mpu88xx0.h 2026/04/29 17:04:50 1.1.1.7 @@ -15,40 +15,43 @@ class MPU88xx0Device : public MPUDevice { using inherited = MPUDevice; public: - MPU88xx0Device(uint32 reset_addr); - ~MPU88xx0Device() override; + MPU88xx0Device(uint32 reset_vector); + virtual ~MPU88xx0Device() override; - void ResetHard() 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->total_cycle; } + // 現在の仮想時刻 [nsec] を取得する + uint64 GetVirtTime() const override { return cpu->GetVTime(); } // MPU の処理をこの命令で中断させる。 void Release() override { cpu->Release(); } // 現在実行中の命令の PC を取得 - uint32 GetPPC() const override { return cpu->Getxip(); } + 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; // 割り込み発生を MPU に通知 - void Interrupt(Object *src, int level) override; + void Interrupt(int level) override; // CPU コアを取得 (主にデバッグ用途) m88kcpu *GetCPU() const { return cpu.get(); } private: - // リセットベクタ - uint32 reset_vector; + // イベントコールバック + void Callback(Event& ev); - std::unique_ptr cpu; + std::unique_ptr cpu {}; }; // ATC モニタ @@ -61,7 +64,7 @@ class MPU88200ATC : public Object void MonitorUpdate(TextScreen&) override; private: - m88200 *cmmu = NULL; + m88200 *cmmu {}; }; extern std::unique_ptr gMPU88200ATC[2];