--- nono/vm/dmac.h 2026/04/29 17:04:44 1.1.1.6 +++ nono/vm/dmac.h 2026/04/29 17:04:58 1.1.1.9 @@ -7,7 +7,9 @@ #pragma once #include "device.h" +#include "monitor.h" #include "scheduler.h" +#include struct DMAC { @@ -167,8 +169,7 @@ struct DMAC uint8 gcr; }; -class DMACDevice - : public IODevice +class DMACDevice : public IODevice { using inherited = IODevice; @@ -179,7 +180,6 @@ class DMACDevice virtual ~DMACDevice() override; void ResetHard() override; - void MonitorUpdate(TextScreen&) override; // 転送 void StartTransfer(DMAC::Channel *chan); @@ -194,11 +194,12 @@ class DMACDevice protected: // BusIO インタフェース static const uint NPORT = 256; - uint64 Read(uint32 addr); - uint64 Write(uint32 addr, uint32 data); - uint64 Peek(uint32 addr); + uint64 Read(uint32 offset); + uint64 Write(uint32 offset, uint32 data); + uint64 Peek(uint32 offset); private: + DECLARE_MONITOR_CALLBACK(MonitorUpdate); void MonitorReg4(TextScreen&, int x, int y, uint32 reg, const char * const *names); @@ -206,7 +207,9 @@ class DMACDevice void ChangeInterrupt(); struct DMAC dmac {}; - Event event[4] {}; + std::array event {}; + + Monitor monitor { this }; static const char * const errnames[]; };