public RexBoardForm(string[] args) { InitializeComponent(); //setup arguments mArgs = args; //Set up form contents ResetToolStripStatusLabel(); //Set up all REX and WRAMP hardware mRexBoard = rexWidget1.mBoard; //Load WRAMPmon into ROM Stream wmon = new MemoryStream(ASCIIEncoding.ASCII.GetBytes(Resources.monitor_srec)); rexWidget1.LoadSrec(wmon); wmon.Close(); //Set up the worker thread mWorkerEnabler = new ManualResetEvent(true); // CPU begins in a running state, since the reset is finished mWorker = new Thread(new ThreadStart(Worker)); mRexBoard.SetTickEnabler(mWorkerEnabler); //Set up all forms mSubforms = new List <Form>(); mSerialForm1 = new BasicSerialPortForm(mRexBoard.Serial1, this); mSerialForm2 = new BasicSerialPortForm(mRexBoard.Serial2, this); mGpRegisterForm = new RegisterForm(mRexBoard.CPU.mGpRegisters, false); mSpRegisterForm = new RegisterForm(mRexBoard.CPU.mSpRegisters, true); mRamForm = new MemoryForm(mRexBoard.RAM); mRamForm.SetCpu(mRexBoard.CPU); mInterruptButtonForm = new PeripheralMemoryForm(mRexBoard.InterruptButton); mSerialConfigForm1 = new PeripheralMemoryForm(mRexBoard.Serial1); mSerialConfigForm2 = new PeripheralMemoryForm(mRexBoard.Serial2); mParallelConfigForm = new PeripheralMemoryForm(mRexBoard.Parallel); mTimerConfigForm = new PeripheralMemoryForm(mRexBoard.Timer); //Add all forms to the list of subforms mSubforms.Add(mSerialForm1); mSubforms.Add(mSerialForm2); mSubforms.Add(mGpRegisterForm); mSubforms.Add(mSpRegisterForm); mSubforms.Add(mRamForm); mSubforms.Add(mInterruptButtonForm); mSubforms.Add(mSerialConfigForm1); mSubforms.Add(mSerialConfigForm2); mSubforms.Add(mParallelConfigForm); mSubforms.Add(mTimerConfigForm); //Wire up event handlers foreach (Form f in mSubforms) { f.VisibleChanged += new EventHandler(SubForm_VisibleChanged); } //Set the GUI update timer going! updateTimer.Start(); }
public RexBoardForm() { InitializeComponent(); //allow drop event this.AllowDrop = true; //Set up all REX and WRAMP hardware mRexBoard = rexWidget1.mBoard; //Load WRAMPmon into ROM Stream wmon = new MemoryStream(ASCIIEncoding.ASCII.GetBytes(Resources.monitor_srec)); rexWidget1.LoadSrec(wmon); wmon.Close(); //Set up the worker thread mWorker = new Thread(new ThreadStart(Worker)); //Set up all forms mSubforms = new List <Form>(); mSerialForm1 = new BasicSerialPortForm(mRexBoard.Serial1); mSerialForm2 = new BasicSerialPortForm(mRexBoard.Serial2); mGpRegisterForm = new RegisterForm(mRexBoard.CPU.mGpRegisters, false); mSpRegisterForm = new RegisterForm(mRexBoard.CPU.mSpRegisters, true); mRamForm = new MemoryForm(mRexBoard.RAM); mRamForm.SetCpu(mRexBoard.CPU); mInterruptButtonForm = new PeripheralMemoryForm(mRexBoard.InterruptButton); mSerialConfigForm1 = new PeripheralMemoryForm(mRexBoard.Serial1); mSerialConfigForm2 = new PeripheralMemoryForm(mRexBoard.Serial2); mParallelConfigForm = new PeripheralMemoryForm(mRexBoard.Parallel); mTimerConfigForm = new PeripheralMemoryForm(mRexBoard.Timer); //Add all forms to the list of subforms mSubforms.Add(mSerialForm1); mSubforms.Add(mSerialForm2); mSubforms.Add(mGpRegisterForm); mSubforms.Add(mSpRegisterForm); mSubforms.Add(mRamForm); mSubforms.Add(mInterruptButtonForm); mSubforms.Add(mSerialConfigForm1); mSubforms.Add(mSerialConfigForm2); mSubforms.Add(mParallelConfigForm); mSubforms.Add(mTimerConfigForm); //Wire up event handlers foreach (Form f in mSubforms) { f.VisibleChanged += new EventHandler(SubForm_VisibleChanged); } //Set the GUI update timer going! updateTimer.Start(); }