示例#1
0
 public DMAChannel(ARM7TDMI cpu, int index)
 {
     this.DMACNT_H = new cDMACNT_H(this, index == 3);
     this.DMACNT_L = new cDMACNT_L(cpu.bus, (ushort)(index == 3 ? 0xffff : 0x3fff));
     this.DMASAD   = new cDMAAddress(cpu.bus, index == 0);
     this.DMADAD   = new cDMAAddress(cpu.bus, index != 3);
     this.cpu      = cpu;
     this.IF       = cpu.IO.IF;
     this.index    = index;
     this.Sound    = index == 1 || index == 2;
 }
示例#2
0
            private void UpdateDMAAddress(cDMAAddress dmaxad, AddrControl control)
            {
                uint amount = (uint)(this.DMACNT_H.DMATransferType ? 4 : 2);

                switch (control)
                {
                case AddrControl.IncrementReload:       // 11 (prohibited for DMASAD)
                case AddrControl.Increment:             // 00
                    dmaxad.Address += amount;
                    break;

                case AddrControl.Decrement:             // 01
                    dmaxad.Address -= amount;
                    break;

                case AddrControl.Fixed:                 // 10
                    break;
                }
            }