protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.Text = _cpuType == CpuType.Cpu ? "CPU Debugger" : "SPC Debugger"; _notifListener = new NotificationListener(); _notifListener.OnNotification += OnNotificationReceived; switch (_cpuType) { case CpuType.Cpu: ctrlDisassemblyView.Initialize(new CpuDisassemblyManager(), new CpuLineStyleProvider()); break; case CpuType.Spc: ctrlDisassemblyView.Initialize(new SpcDisassemblyManager(), new SpcLineStyleProvider()); break; } ctrlBreakpoints.CpuType = _cpuType; ctrlWatch.CpuType = _cpuType; InitShortcuts(); InitToolbar(); LoadConfig(); toolTip.SetToolTip(picWatchHelp, ctrlWatch.GetTooltipText()); ConfigApi.SetDebuggerFlag(_cpuType == CpuType.Cpu ? DebuggerFlags.CpuDebuggerEnabled : DebuggerFlags.SpcDebuggerEnabled, true); BreakpointManager.AddCpuType(_cpuType); DebugApi.Step(10000, StepType.CpuStep); }
protected override void OnLoad(EventArgs e) { _notifListener = new NotificationListener(); _notifListener.OnNotification += OnNotificationReceived; switch (_cpuType) { case CpuType.Cpu: ctrlDisassemblyView.Initialize(new CpuDisassemblyManager(), new CpuLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.CpuDebuggerEnabled, true); this.Text = "CPU Debugger"; break; case CpuType.Spc: ctrlDisassemblyView.Initialize(new SpcDisassemblyManager(), new SpcLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.SpcDebuggerEnabled, true); this.Text = "SPC Debugger"; break; case CpuType.Sa1: ctrlDisassemblyView.Initialize(new Sa1DisassemblyManager(), new Sa1LineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.Sa1DebuggerEnabled, true); this.Text = "SA-1 Debugger"; break; case CpuType.Gsu: ctrlDisassemblyView.Initialize(new GsuDisassemblyManager(), new GsuLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.GsuDebuggerEnabled, true); this.Text = "GSU Debugger"; ctrlCallstack.Visible = false; ctrlLabelList.Visible = false; mnuStepOver.Visible = false; mnuStepOut.Visible = false; mnuStepInto.Text = "Step"; tlpBottomPanel.ColumnCount = 2; break; } ctrlBreakpoints.CpuType = _cpuType; ctrlWatch.CpuType = _cpuType; InitShortcuts(); InitToolbar(); LoadConfig(); toolTip.SetToolTip(picWatchHelp, ctrlWatch.GetTooltipText()); BreakpointManager.AddCpuType(_cpuType); DebugApi.Step(_cpuType, 10000, StepType.Step); base.OnLoad(e); }
protected override void OnLoad(EventArgs e) { _notifListener = new NotificationListener(); _notifListener.OnNotification += OnNotificationReceived; bool isPaused = EmuApi.IsPaused(); ConfigManager.Config.Debug.Debugger.ApplyConfig(); mnuUseAltSpcOpNames.Visible = false; switch (_cpuType) { case CpuType.Cpu: ctrlDisassemblyView.Initialize(new CpuDisassemblyManager(), new CpuLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.CpuDebuggerEnabled, true); this.Text = "CPU Debugger"; this.ctrlCpuStatus = new ctrlCpuStatus(); this.ctrlCpuStatus.Padding = new Padding(3, 0, 3, 0); this.ctrlCpuStatus.Dock = DockStyle.Top; pnlStatus.Controls.Add(this.ctrlCpuStatus); break; case CpuType.Spc: ctrlDisassemblyView.Initialize(new SpcDisassemblyManager(), new SpcLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.SpcDebuggerEnabled, true); mnuBreakOnWdm.Visible = false; mnuBreakOnCop.Visible = false; mnuBreakOnUnitRead.Visible = false; sepBreakOnUnitRead.Visible = false; mnuUseAltSpcOpNames.Visible = true; this.Text = "SPC Debugger"; this.ctrlSpcStatus = new ctrlSpcStatus(); this.ctrlSpcStatus.Padding = new Padding(3, 0, 3, 0); this.ctrlSpcStatus.Dock = DockStyle.Top; pnlStatus.Controls.Add(this.ctrlSpcStatus); break; case CpuType.Sa1: ctrlDisassemblyView.Initialize(new Sa1DisassemblyManager(), new Sa1LineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.Sa1DebuggerEnabled, true); this.Text = "SA-1 Debugger"; this.ctrlCpuStatus = new ctrlCpuStatus(); this.ctrlCpuStatus.Padding = new Padding(3, 0, 3, 0); this.ctrlCpuStatus.Dock = DockStyle.Top; pnlStatus.Controls.Add(this.ctrlCpuStatus); break; case CpuType.Gsu: ctrlDisassemblyView.Initialize(new GsuDisassemblyManager(), new GsuLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.GsuDebuggerEnabled, true); this.Text = "GSU Debugger"; HideDebuggerElements(); this.ctrlGsuStatus = new ctrlGsuStatus(); this.ctrlGsuStatus.Padding = new Padding(3, 0, 3, 0); this.ctrlGsuStatus.Dock = DockStyle.Top; pnlStatus.Controls.Add(this.ctrlGsuStatus); break; case CpuType.NecDsp: ctrlDisassemblyView.Initialize(new NecDspDisassemblyManager(), new NecDspLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.NecDspDebuggerEnabled, true); this.Text = "DSP Debugger"; HideDebuggerElements(); this.ctrlNecDspStatus = new ctrlNecDspStatus(); this.ctrlNecDspStatus.Padding = new Padding(3, 0, 3, 0); this.ctrlNecDspStatus.Dock = DockStyle.Top; pnlStatus.Controls.Add(this.ctrlNecDspStatus); break; case CpuType.Cx4: ctrlDisassemblyView.Initialize(new Cx4DisassemblyManager(), new Cx4LineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.Cx4DebuggerEnabled, true); this.Text = "CX4 Debugger"; ctrlLabelList.Visible = false; HideDebuggerElements(); this.ctrlCx4Status = new ctrlCx4Status(); this.ctrlCx4Status.Padding = new Padding(3, 0, 3, 0); this.ctrlCx4Status.Dock = DockStyle.Top; pnlStatus.Controls.Add(this.ctrlCx4Status); break; case CpuType.Gameboy: ctrlDisassemblyView.Initialize(new GbDisassemblyManager(), new GbLineStyleProvider()); ConfigApi.SetDebuggerFlag(DebuggerFlags.GbDebuggerEnabled, true); this.Text = "GB Debugger"; ctrlMemoryMapping = new ctrlMemoryMapping(); ctrlMemoryMapping.Size = new Size(this.ClientSize.Width, 33); ctrlMemoryMapping.Margin = new Padding(3, 0, 3, 3); ctrlMemoryMapping.Dock = DockStyle.Bottom; ctrlMemoryMapping.Visible = ConfigManager.Config.Debug.Debugger.ShowMemoryMappings; this.Controls.Add(ctrlMemoryMapping); ctrlMemoryMapping.SendToBack(); sepBrkCopStpWdm.Visible = false; mnuBreakOnBrk.Visible = false; mnuBreakOnWdm.Visible = false; mnuBreakOnCop.Visible = false; mnuBreakOnStp.Visible = false; ctrlPpuStatus.Visible = false; sepGameboyBreak.Visible = true; mnuGbBreakOnDisableLcdOutsideVblank.Visible = true; mnuGbBreakOnInvalidOamAccess.Visible = true; mnuGbBreakOnInvalidOpCode.Visible = true; mnuGbBreakOnInvalidVramAccess.Visible = true; mnuGbBreakOnNopLoad.Visible = true; mnuGbBreakOnOamCorruption.Visible = false; this.ctrlGameboyStatus = new ctrlGameboyStatus(); this.ctrlGameboyStatus.Padding = new Padding(3, 0, 3, 0); this.ctrlGameboyStatus.Dock = DockStyle.Top; pnlStatus.Controls.Add(this.ctrlGameboyStatus); break; } ctrlBreakpoints.CpuType = _cpuType; ctrlWatch.CpuType = _cpuType; InitShortcuts(); InitToolbar(); LoadConfig(); toolTip.SetToolTip(picWatchHelp, ctrlWatch.GetTooltipText()); BreakpointManager.AddCpuType(_cpuType); if (!isPaused) { DebugApi.Step(_cpuType, 10000, StepType.Step); } else { BreakEvent evt = new BreakEvent() { BreakpointId = -1, Source = BreakSource.Unspecified }; RefreshDebugger(evt); } base.OnLoad(e); }