Пример #1
0
        protected IDMAChannel CreateDMAChannel(byte channel)
        {
            IDMAChannel dmaChannel = new DMAChannel(channel);

            hardware.Add(dmaChannel);
            return(dmaChannel);
        }
Пример #2
0
        private void DoDMA(DMAChannel DMA)
        {
            this.Log($"DMA: {DMA.SAD:x8} -> {DMA.DAD:x8}");

            uint UnitLength = DMA.UnitLength;  // bytes: 32 / 16 bits

            if (UnitLength == 4)
            {
                // force alignment happens in memory handler
                this.mem.SetWordAt(DMA.DAD, this.mem.GetWordAt(DMA.SAD));
            }
            else  // 16 bit
            {
                // force alignment happens in memory handler
                this.mem.SetHalfWordAt(DMA.DAD, this.mem.GetHalfWordAt(DMA.SAD));
            }

            DMA.UpdateDMASAD();
            DMA.UpdateDMADAD();
            DMA.UnitCount--;

            if (DMA.Empty)
            {
                InstructionCycles += DMA.End();
            }
        }