--- nono/vm/dmac.h 2026/04/29 17:05:51 1.1.1.17 +++ nono/vm/dmac.h 2026/04/29 17:05:55 1.1.1.18 @@ -105,9 +105,10 @@ struct DMAC static const uint32 SIZE_16BIT = 1; // 16bit static const uint32 SIZE_32BIT = 2; // 32bit static const uint32 SIZE_8BIT_UNPK = 3; // 8bit UnPacked - static const uint32 CHAIN_NOCHAIN = 0; // Chain operation is disabled + static const uint32 CHAIN_DISABLED = 0; // Chain operation is disabled + static const uint32 CHAIN_reserved = 1; // (Undefined, reserved) static const uint32 CHAIN_ARRAY = 2; // Array Chaining - static const uint32 CHAIN_LINK = 3; // Linked Array Chaining + static const uint32 CHAIN_LINKARRAY = 3; // Linked Array Chaining static const uint32 REQG_AUTO_LIM = 0; // Auto Request (Limited) static const uint32 REQG_AUTO_MAX = 1; // AUto Request (Max) static const uint32 REQG_EXTERNAL = 2; // External Request @@ -145,9 +146,13 @@ struct DMAC }; // 各チャンネル -class DMACChan +class DMACChan : public Device { + using inherited = Device; public: + DMACChan(int ch_, const char *desc_); + ~DMACChan() override; + // 二次変数など int ch; // チャンネル番号 const char *desc; // チャンネルの用途(モニタ表示用) @@ -310,6 +315,8 @@ class DMACDevice : public IODevice // 転送 void StartTransfer(DMACChan *chan); void AbortTransfer(DMACChan *chan); + std::string MakeStartLog(DMACChan *chan); + bool LoadLinkArray(DMACChan *chan); DMACChan *SelectChannel(); // 転送イベントコールバック @@ -328,8 +335,13 @@ class DMACDevice : public IODevice void AssertACK(DMACChan *); void NegateACK(DMACChan *); + // メインメモリアクセス + busdata ReadMem(busaddr addr); + busdata ReadMem4(busaddr addr); + busdata WriteMem(busaddr addr, uint32 data); + // レジスタ - std::array channel {}; + std::array, 4> channels {}; uint8 gcr; // ユーザ空間制御