Exemple #1
0
        /// <summary>
        /// Creates the RexBoard and all components within it.
        /// </summary>
        public RexBoard()
        {
            //Initialise busses
            mDataBus    = new Bus();
            mAddressBus = new Bus();
            mIrqs       = new Bus();

            //Initialise other components
            CPU = new SimpleWrampCpu(mAddressBus, mDataBus, mIrqs, mCs);

            //Memory and Memory-mapped IO
            RAM             = new MemoryDevice(0x00000, 0x20000, mAddressBus, mDataBus, "Memory (RAM)");
            Serial1         = new SerialIO(0x70000, 5, mAddressBus, mDataBus, "Serial Port 1");
            Serial2         = new SerialIO(0x71000, 5, mAddressBus, mDataBus, "Serial Port 2");
            Timer           = new Timer(0x72000, 4, mAddressBus, mDataBus, "Timer");
            Parallel        = new ParallelIO(0x73000, 6, mAddressBus, mDataBus, "Parallel Port");
            ROM             = new MemoryDevice(0x80000, 0x40000, mAddressBus, mDataBus, "Memory (ROM)");
            InterruptButton = new ButtonInterrupt(0x7f000, 1, mAddressBus, mDataBus, "Interrupt Button");

            //IRQs
            InterruptButton.AttachIRQ(mIrqs, 1, 0);
            Timer.AttachIRQ(mIrqs, 2, 3);
            Parallel.AttachIRQ(mIrqs, 3, 5);
            Serial1.AttachIRQ(mIrqs, 4, 4);
            Serial2.AttachIRQ(mIrqs, 5, 4);

            Reset();
        }
Exemple #2
0
        private void ExecuteForIOAsync(string dirPath = @"C:\Program Files", bool isAsync = true)
        {
            ParallelIO.TraverseTreeParallelForEach(dirPath, (f) =>
            {
                // Exceptions are no-ops.
                try
                {
                    // var reader = new StreamReader(fileSelected);

                    // Do nothing with the data except read it.
                    byte[] data = File.ReadAllBytes(f);
                }
                catch (FileNotFoundException) { }
                catch (IOException) { }
                catch (UnauthorizedAccessException) { }
                catch (SecurityException) { }
                // Display the filename.
                textBox1.AppendText(f);
            }, true);

            textBoxPerformanceIO.Text = ParallelIO.textTimeGeneral.Text;
            textBox1.AppendText(Environment.NewLine);
            textBox1.AppendText(ParallelIO.textboxGeneral.Text);
        }