예제 #1
0
        public void RegisterBar(Range range, IPCIePeripheral peripheral, uint bar)
        {
            //This has to be improved greatly.
            //1. have fast search
            //2. invalidate overlaps
            var previousRegistration = memoryMap.Where(x => x.Value.BarNumber == bar && x.Value.TargetPeripheral == peripheral).Select(x => x.Key);

            if (previousRegistration.Any())
            {
                memoryMap.Remove(previousRegistration.SingleOrDefault());
            }
            memoryMap[range] = new TargetBar {
                BarNumber = bar, TargetPeripheral = peripheral
            };
        }
예제 #2
0
 void Awake()
 {
     ins = this;
 }