Пример #1
0
        private void button_AddBP_Click(object sender, EventArgs e)
        {
            var f      = new BpEditor();
            var result = f.ShowDialog();

            if (result == DialogResult.OK)
            {
                dynamic     Data = f.Data;
                BREAK_POINT bp   = BpObj.Toggle(Data.Address);
                if (bp != null)
                {
                    bp.Data = f.Data;
                    BpObj2UI();
                    VM_UpdateBPs();
                    RefreshCpuStatus();
                }
            }
        }
Пример #2
0
        public BREAK_POINT Toggle(UInt16 Address)
        {
            BREAK_POINT result;

            result = null;
            int index = Items.FindIndex(x => x.Data.Address == Address);

            if (index == -1)
            {
                BREAK_POINT bp = new BREAK_POINT(Address);
                Items.Add(bp);
                result = bp;
            }
            else
            {
                Items.RemoveAt(index);
            }

            return(result);
        }
Пример #3
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var f = new BpEditor();

            if (listView_BPs.SelectedItems.Count > 0)
            {
                ListViewItem lvitem = listView_BPs.SelectedItems[0];
                UInt16       addr   = Convert.ToUInt16(lvitem.Text, 16);
                BREAK_POINT  bp     = BpObj.Find(addr);
                f.Data = bp.Data;
                var result = f.ShowDialog();
                if (result == DialogResult.OK)
                {
                    bp.Data = f.Data;
                    BpObj2UI();
                    VM_UpdateBPs();
                    RefreshCpuStatus();
                }
            }
        }
Пример #4
0
        void BpObj2UI()
        {
            int i;

            listView_BPs.Items.Clear();
            for (i = 0; i < BpObj.Items.Count; i++)
            {
                BREAK_POINT  bp     = BpObj.Items[i];
                ListViewItem lvitem = new ListViewItem();
                lvitem.Text = bp.Data.Address.ToString("X");
                string cond_str  = "";
                bool   show_data = false;
                if ((bp.Data.Access & 1) != 0)
                {
                    cond_str += "E";
                }
                if ((bp.Data.Access & 2) != 0)
                {
                    cond_str += "R";
                }
                if ((bp.Data.Access & 4) != 0)
                {
                    cond_str += "W";
                }
                if ((bp.Data.Access & 1) != 0)
                {
                    if ((bp.Data.Register & 1) != 0)
                    {
                        cond_str += "A";
                    }
                    if ((bp.Data.Register & 2) != 0)
                    {
                        cond_str += "X";
                    }
                    if ((bp.Data.Register & 4) != 0)
                    {
                        cond_str += "Y";
                    }
                }
                if ((bp.Data.Compare & 1) != 0)
                {
                    cond_str += "=";
                }
                if ((bp.Data.Compare & 2) != 0)
                {
                    cond_str += ">";
                }
                if ((bp.Data.Compare & 4) != 0)
                {
                    cond_str += "<";
                }
                if ((bp.Data.Access & 1) != 0 && // Need reg & compare for Execution break
                    bp.Data.Register != 0 &&
                    bp.Data.Compare != 0)
                {
                    show_data = true;
                }
                if ((bp.Data.Access & 6) != 0 && // Need compare for mR/mW break
                    bp.Data.Compare != 0)
                {
                    show_data = true;
                }
                if (show_data)
                {
                    cond_str += bp.Data.Data.ToString("X");
                }
                lvitem.SubItems.Add(cond_str);
                listView_BPs.Items.Add(lvitem);
            }
        }