Exemplo n.º 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();
        }