--- nono/vm/opm.h 2026/04/29 17:05:10 1.1.1.4 +++ nono/vm/opm.h 2026/04/29 17:05:14 1.1.1.5 @@ -11,17 +11,21 @@ #pragma once #include "device.h" +#include "event.h" class OPMDevice : public IODevice { using inherited = IODevice; static const int baseaddr = 0xe90000; + static const uint64 clk = 250_nsec; // 4MHz public: OPMDevice(); virtual ~OPMDevice() override; + void ResetHard(bool poweron) override; + protected: // BusIO インタフェース static const uint32 NPORT = 2; @@ -30,7 +34,13 @@ class OPMDevice : public IODevice uint64 Peek(uint32 offset); private: + bool IsBusy() const; + int reg {}; // アクセスレジスタ番号 + + uint64 busy_origin; // BUSY の起点時刻 + uint64 busy_start; // BUSY のアサート開始時刻 + uint64 busy_end; // BUSY のアサート終了時刻 }; extern OPMDevice *gOPM;