Exemplo n.º 1
0
 private void StopButton_Click(object sender, EventArgs e)
 {
     MainClock.Stop();
     StopButton.Enabled  = false;
     ResetButton.Enabled = true;
     StepButton.Enabled  = true;
     RunButton.Enabled   = true;
 }
Exemplo n.º 2
0
 private void MainClock_Tick(object sender, EventArgs e)
 {
     CPU.Cycle();
     CyclesLabel.Text = "Cycles: " + CPU.Cycles.ToString();
     this.UpdateWindow();
     if (CPU.Halted)
     {
         MainClock.Stop();
         MessageBox.Show("The processor has been stopped!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Information);
         StopButton.Enabled  = false;
         ResetButton.Enabled = true;
         StepButton.Enabled  = true;
         RunButton.Enabled   = true;
     }
 }
Exemplo n.º 3
0
        public MainForm()
        {
            InitializeComponent();
            MainClock.Enabled = true;
            MainClock.Stop();
            MemoryRichTextBox.SelectionAlignment = HorizontalAlignment.Center;
            MemoryRichTextBox.Enabled            = false;

            double freq = 1.0 / (0.001 * MainClock.Interval);

            freq = Math.Round(freq);

            FrequencyLabel.Text = "Frequency: " + freq.ToString() + " Hz";
            CPU = new i8008_emu.i8008_CPU(this);
            for (int i = 0; i < ports.Length; i++)
            {
                ports[i] = 0;
            }

            string outputPortsString = "";

            for (int i = 8; i < ports.Length; i++)
            {
                outputPortsString += i.ToString() + ": " + ports[i].ToString();
                if (i != ports.Length - 1)
                {
                    outputPortsString += "\n";
                }
            }
            OutputPortsRichTextBox.Text = outputPortsString;

            for (int i = 0; i < 8; i++)
            {
                InputPortSelection.Items.Add(i);
            }
            InputPortSelection.SelectedIndex = 0;

            this.UpdateWindow(true);

            StopButton.Enabled = false;
        }