--- nono/vm/dmac.h 2026/04/29 17:05:14 1.1.1.11 +++ nono/vm/dmac.h 2026/04/29 17:05:18 1.1.1.12 @@ -16,6 +16,11 @@ #include "event.h" #include +class ADPCMDevice; +class FDCDevice; +class InterruptDevice; +class MainbusDevice; + struct DMAC { static const uint32 CSR = 0x00; // .B @@ -264,6 +269,7 @@ class DMACDevice : public IODevice DMACDevice(); virtual ~DMACDevice() override; + bool Init() override; void ResetHard(bool poweron) override; uint64 Read8(uint32 addr) override; @@ -322,6 +328,11 @@ class DMACDevice : public IODevice std::array channel {}; uint8 gcr; + ADPCMDevice *adpcm {}; + FDCDevice *fdc {}; + InterruptDevice *interrupt {}; + MainbusDevice *mainbus {}; + Event event { this }; Monitor monitor { this }; @@ -329,4 +340,6 @@ class DMACDevice : public IODevice static const char * const errnames[]; }; -extern DMACDevice *gDMAC; +static inline DMACDevice *GetDMACDevice() { + return Object::GetObject(OBJ_DMAC); +}