--- nono/vm/opm.h 2026/04/29 17:05:14 1.1.1.5 +++ nono/vm/opm.h 2026/04/29 17:05:29 1.1.1.8 @@ -13,25 +13,30 @@ #include "device.h" #include "event.h" +class ADPCMDevice; +class FDCDevice; + class OPMDevice : public IODevice { using inherited = IODevice; - static const int baseaddr = 0xe90000; + static const uint32 baseaddr = 0xe90000; static const uint64 clk = 250_nsec; // 4MHz public: OPMDevice(); - virtual ~OPMDevice() override; + ~OPMDevice() override; + bool Init() override; void ResetHard(bool poweron) override; protected: // BusIO インタフェース static const uint32 NPORT = 2; - uint64 Read(uint32 offset); - uint64 Write(uint32 offset, uint32 data); - uint64 Peek(uint32 offset); + busdata ReadPort(uint32 offset); + busdata WritePort(uint32 offset, uint32 data); + busdata PeekPort(uint32 offset); + bool PokePort(uint32 offset, uint32 data); private: bool IsBusy() const; @@ -41,6 +46,7 @@ class OPMDevice : public IODevice uint64 busy_origin; // BUSY の起点時刻 uint64 busy_start; // BUSY のアサート開始時刻 uint64 busy_end; // BUSY のアサート終了時刻 -}; -extern OPMDevice *gOPM; + ADPCMDevice *adpcm {}; + FDCDevice *fdc {}; +};