Example #1
0
        private void clearSelectedButton_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection rowCollection = dataGridView2.SelectedRows;

            if (rowCollection.Count < 1)
            {
                return;
            }

            foreach (DataGridViewRow row in rowCollection)
            {
                KeyValuePair <SPECCY_EVENT, Monitor.BreakPointCondition> kv;

                //convert dashes (-) to -1 (int) where required,
                //else convert the actual value to int.
                int _addr = -1;
                int _val  = -1;
                if ((String)row.Cells[1].Value != "-")
                {
                    _addr = Convert.ToInt32(row.Cells[1].Value);
                }

                if ((String)row.Cells[2].Value != "-")
                {
                    _val = Convert.ToInt32(row.Cells[2].Value);
                }

                SPECCY_EVENT speccyEvent = Utilities.GetEnumFromString <SPECCY_EVENT>((string)row.Cells[0].Value, SPECCY_EVENT.OPCODE_PC);
                kv = new KeyValuePair <SPECCY_EVENT, Monitor.BreakPointCondition>(speccyEvent, new Monitor.BreakPointCondition(speccyEvent, _addr, _val));
                monitor.RemoveBreakpoint(kv);
            }
        }
Example #2
0
        private void addOtherBreakpointButton_Click(object sender, EventArgs e)
        {
            if ((comboBox2.SelectedIndex < 0) || (comboBox2.SelectedIndex < 14 && maskedTextBox2.Text.Length < 1))
            {
                return;
            }

            int addr = -1;
            int val  = -1;

            SPECCY_EVENT speccyEvent = Utilities.GetEnumFromString <SPECCY_EVENT>(comboBox2.Text, SPECCY_EVENT.OPCODE_PC);

            if (comboBox2.SelectedIndex < 14)
            {
                addr = Utilities.ConvertToInt(maskedTextBox2.Text);

                if (addr > 65535)
                {
                    System.Windows.Forms.MessageBox.Show("The address is not within 0 to 65535!", "Invalid input", MessageBoxButtons.OK);
                    return;
                }
            }
            else if (speccyEvent == SPECCY_EVENT.ULA_WRITE || speccyEvent == SPECCY_EVENT.ULA_READ)
            {
                addr = 254; //0xfe
            }
            if (maskedTextBox3.Text.Length > 0)
            {
                val = Utilities.ConvertToInt(maskedTextBox3.Text);

                if (val > 255)
                {
                    System.Windows.Forms.MessageBox.Show("The value is not within 0 to 255!", "Invalid input", MessageBoxButtons.OK);
                    return;
                }
            }
            else
            {
                val = -1;
            }

            string       _str = comboBox2.SelectedItem.ToString();// +"@" + addr.ToString();
            SPECCY_EVENT speccEventFromString = Utilities.GetEnumFromString <SPECCY_EVENT>(_str, SPECCY_EVENT.OPCODE_PC);

            KeyValuePair <SPECCY_EVENT, Monitor.BreakPointCondition> kv = new KeyValuePair <SPECCY_EVENT, Monitor.BreakPointCondition>(speccEventFromString, new Monitor.BreakPointCondition(speccEventFromString, addr, val));

            monitor.AddBreakpoint(kv);
        }
Example #3
0
        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            maskedTextBox3.Text = "";
            SPECCY_EVENT speccyEvent = Utilities.GetEnumFromString <SPECCY_EVENT>(comboBox2.Text, SPECCY_EVENT.OPCODE_PC);

            if (speccyEvent == SPECCY_EVENT.ULA_WRITE || speccyEvent == SPECCY_EVENT.ULA_READ)
            {
                maskedTextBox2.Text     = "$fe";
                maskedTextBox2.ReadOnly = true;
                maskedTextBox3.ReadOnly = false;
            }
            else if (speccyEvent == SPECCY_EVENT.INTERRUPT || speccyEvent == SPECCY_EVENT.RE_INTERRUPT)
            {
                maskedTextBox2.Text = "";

                maskedTextBox3.ReadOnly = true;
                maskedTextBox2.ReadOnly = true;
            }
            else
            {
                maskedTextBox3.ReadOnly = false;
                maskedTextBox2.ReadOnly = false;
            }
        }