--- nono/vm/adpcm.h 2026/04/29 17:05:14 1.1 +++ nono/vm/adpcm.h 2026/04/29 17:05:25 1.1.1.3 @@ -13,6 +13,9 @@ #include "device.h" #include "event.h" +class DMACDevice; +class PPIDevice; + class ADPCMDevice : public IODevice { using inherited = IODevice; @@ -27,8 +30,9 @@ class ADPCMDevice : public IODevice public: ADPCMDevice(); - virtual ~ADPCMDevice() override; + ~ADPCMDevice() override; + bool Init() override; void ResetHard(bool poweron) override; // CT1 によるクロック切り替え。OPM から呼ばれる。 @@ -41,9 +45,9 @@ class ADPCMDevice : public IODevice protected: // BusIO インタフェース static const uint32 NPORT = 2; - uint64 Read(uint32 offset); - uint64 Write(uint32 offset, uint32 data); - uint64 Peek(uint32 offset); + busdata Read(uint32 offset); + busdata Write(uint32 offset, uint32 data); + busdata Peek(uint32 offset); private: void StartPlay(); @@ -55,7 +59,12 @@ class ADPCMDevice : public IODevice int clk {}; int div {}; + DMACDevice *dmac {}; + PPIDevice *ppi {}; + Event event { this }; }; -extern ADPCMDevice *gADPCM; +static inline ADPCMDevice *GetADPCMDevice() { + return Object::GetObject(OBJ_ADPCM); +}