private void FullUpdate()
 {
     RegisterPanel.UpdateValues();
     UpdatePC();
     UpdateDisassembler();
     BreakPointControl1.UpdateValues();
 }
        private void AddBreakpointContextMenuItem_Click(object sender, EventArgs e)
        {
            var indices = DisassemblerView.SelectedIndices;

            if (indices.Count > 0)
            {
                var line = DisassemblyLines[indices[0]];
                BreakPointControl1.AddBreakpoint(line.Address, Emulation.Common.MemoryCallbackType.Execute);
            }
        }
        private void SeekToBtn_Click(object sender, EventArgs e)
        {
            CancelSeekBtn.Enabled = true;
            var pcVal     = (uint)(SeekToBox.ToRawInt() ?? 0);
            var pcBitSize = PCRegister.BitSize;

            BreakPointControl1.RemoveCurrentSeek();
            BreakPointControl1.AddSeekBreakpoint(pcVal, pcBitSize);
            BreakPointControl1.UpdateValues();
        }
        private void EngageDebugger()
        {
            _disassemblyLines.Clear();
            MainForm.OnPauseChanged += OnPauseChanged;
            CancelSeekBtn.Enabled    = false;
            if (CanDisassemble)
            {
                try
                {
                    if (CanSetCpu && Disassembler.AvailableCpus.Count() > 1)
                    {
                        var c = new ComboBox
                        {
                            Location      = new Point(UIHelper.ScaleX(35), UIHelper.ScaleY(17)),
                            Width         = UIHelper.ScaleX(121),
                            DropDownStyle = ComboBoxStyle.DropDownList
                        };

                        c.Items.AddRange(Disassembler.AvailableCpus.Cast <object>().ToArray());
                        c.SelectedItem          = Disassembler.Cpu;
                        c.SelectedIndexChanged += OnCpuDropDownIndexChanged;

                        DisassemblerBox.Controls.Add(c);
                    }
                    else
                    {
                        DisassemblerBox.Controls.Add(new Label
                        {
                            Location = new Point(UIHelper.ScaleX(35), UIHelper.ScaleY(23)),
                            Size     = new Size(UIHelper.ScaleX(100), UIHelper.ScaleY(15)),
                            Text     = Disassembler.Cpu
                        });
                    }
                }
                catch (NotImplementedException)
                {
                    DisassemblerBox.Controls.Add(new Label
                    {
                        Location = new Point(UIHelper.ScaleX(35), UIHelper.ScaleY(23)),
                        Size     = new Size(UIHelper.ScaleX(100), UIHelper.ScaleY(15)),
                        Text     = Disassembler.Cpu
                    });
                }

                _pcRegisterSize = Debuggable.GetCpuFlagsAndRegisters()[Disassembler.PCRegisterName].BitSize / 4;
                SetDisassemblerItemCount();
                UpdateDisassembler();
            }
            else
            {
                DisassemblerBox.Enabled   = false;
                DisassemblerView.RowCount = 0;
                DisassemblerBox.Controls.Add(new Label
                {
                    Location = new Point(UIHelper.ScaleX(35), UIHelper.ScaleY(23)),
                    Size     = new Size(UIHelper.ScaleX(100), UIHelper.ScaleY(15)),
                    Text     = "Unknown"
                });

                toolTip1.SetToolTip(DisassemblerBox, "This core does not currently support disassembling");
            }

            RegisterPanel.Core           = Debuggable;
            RegisterPanel.ParentDebugger = this;
            RegisterPanel.GenerateUI();

            if (CanUseMemoryCallbacks)
            {
                BreakPointControl1.MainForm       = MainForm;
                BreakPointControl1.Core           = Debuggable;
                BreakPointControl1.Mcs            = MemoryCallbacks;
                BreakPointControl1.ParentDebugger = this;
                BreakPointControl1.MemoryDomains  = MemoryDomains;
                BreakPointControl1.GenerateUI();
                EnabledBreakpointBox();
            }
            else
            {
                DisableBreakpointBox();
            }

            SeekToBox.Enabled = SeekToBtn.Enabled = CanUseMemoryCallbacks && RegisterPanel.CanGetCpuRegisters;

            if (RegisterPanel.CanGetCpuRegisters && CanDisassemble)
            {
                var pc = PCRegister;
                SeekToBox.Nullable = false;
                SeekToBox.SetHexProperties((long)Math.Pow(2, pc.BitSize));
                SeekToBox.SetFromRawInt(0);
            }
            else
            {
                SeekToBox.Nullable = true;
                SeekToBox.Text     = "";
            }

            StepIntoMenuItem.Enabled = StepIntoBtn.Enabled = CanStepInto;
            StepOutMenuItem.Enabled  = StepOutBtn.Enabled = CanStepOut;
            StepOverMenuItem.Enabled = StepOverBtn.Enabled = CanStepOver;

            if (!StepIntoMenuItem.Enabled)
            {
                toolTip1.SetToolTip(StepIntoBtn, "This core does not currently implement this feature");
            }

            if (!StepOutMenuItem.Enabled)
            {
                toolTip1.SetToolTip(StepOutBtn, "This core does not currently implement this feature");
            }

            if (!StepOverMenuItem.Enabled)
            {
                toolTip1.SetToolTip(StepOverBtn, "This core does not currently implement this feature");
            }
        }
 private void CancelSeekBtn_Click(object sender, EventArgs e)
 {
     BreakPointControl1.RemoveCurrentSeek();
     CancelSeekBtn.Enabled = false;
 }
 private void DisengageDebugger()
 {
     BreakPointControl1.Shutdown();
     MainForm.OnPauseChanged -= OnPauseChanged;
 }