Пример #1
0
        public static Form OpenDebugWindow(DebugWindow window)
        {
            Form existingWindow = GetExistingSingleInstanceWindow(window);

            if (existingWindow != null)
            {
                existingWindow.BringToFront();
                if (existingWindow.WindowState == FormWindowState.Minimized)
                {
                    //Unminimize window if it was minimized
                    existingWindow.WindowState = FormWindowState.Normal;
                }
                existingWindow.Focus();
                return(existingWindow);
            }
            else
            {
                BaseForm frm = null;
                switch (window)
                {
                case DebugWindow.PpuViewer: frm = new frmPpuViewer(); frm.Icon = Properties.Resources.Video; break;

                case DebugWindow.TraceLogger: frm = new frmTraceLogger(); frm.Icon = Properties.Resources.LogWindow; break;

                case DebugWindow.MemoryViewer: frm = new frmMemoryViewer(); frm.Icon = Properties.Resources.CheatCode; break;

                case DebugWindow.Assembler: frm = new frmAssembler(); frm.Icon = Properties.Resources.Chip; break;

                case DebugWindow.Debugger: frm = new frmDebugger(); frm.Icon = Properties.Resources.Bug; break;

                case DebugWindow.ScriptWindow: frm = new frmScript(); frm.Icon = Properties.Resources.Script; break;

                case DebugWindow.ApuViewer: frm = new frmApuViewer(); frm.Icon = Properties.Resources.Audio; break;

                case DebugWindow.EventViewer: frm = new frmEventViewer(); frm.Icon = Properties.Resources.NesEventViewer; break;

                case DebugWindow.TextHooker: frm = new frmTextHooker(); frm.Icon = Properties.Resources.Font; break;

                case DebugWindow.Profiler: frm = new frmProfiler(); frm.Icon = Properties.Resources.Speed; break;

                case DebugWindow.WatchWindow: frm = new frmWatchWindow(); frm.Icon = Properties.Resources.Find; break;
                }

                if (_openedWindows.Count == 0)
                {
                    DebugWorkspaceManager.GetWorkspace();
                    DebugWorkspaceManager.AutoLoadDbgFiles(true);
                }

                _openedWindows.Add(frm);
                frm.FormClosed += Debugger_FormClosed;
                frm.Show();
                return(frm);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                DebugWorkspaceManager.GetWorkspace();
                DebugWorkspaceManager.AutoLoadDbgFiles(true);
                _notifListener = new InteropEmu.NotificationListener(ConfigManager.Config.DebugInfo.DebugConsoleId);
                _notifListener.OnNotification += _notifListener_OnNotification;
                ctrlWatch.UpdateWatch(true);
            }
        }
Пример #3
0
        public frmProfiler()
        {
            InitializeComponent();

            if (!DesignMode)
            {
                DebugWorkspaceManager.AutoLoadDbgFiles(true);

                ctrlProfiler.RefreshData();
                tmrRefresh.Start();

                RestoreLocation(ConfigManager.Config.DebugInfo.ProfilerLocation, ConfigManager.Config.DebugInfo.ProfilerSize);
            }
        }
Пример #4
0
        public frmProfiler()
        {
            InitializeComponent();

            if (!DesignMode)
            {
                DebugWorkspaceManager.AutoLoadDbgFiles(true);

                ctrlProfiler.RefreshData();
                tmrRefresh.Start();

                if (!ConfigManager.Config.DebugInfo.ProfilerSize.IsEmpty)
                {
                    this.StartPosition = FormStartPosition.Manual;
                    this.Size          = ConfigManager.Config.DebugInfo.ProfilerSize;
                    this.Location      = ConfigManager.Config.DebugInfo.ProfilerLocation;
                }
            }
        }
Пример #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            DebugWorkspaceManager.AutoLoadDbgFiles(true);

            this._selectedTab = this.tabMain.SelectedTab;

            DebugInfo config = ConfigManager.Config.DebugInfo;

            this.mnuAutoRefresh.Checked             = config.RamAutoRefresh;
            this.mnuHighDensityMode.Checked         = config.RamHighDensityTextMode;
            this.mnuByteEditingMode.Checked         = config.RamByteEditingMode;
            this.mnuEnablePerByteNavigation.Checked = config.RamEnablePerByteNavigation;
            UpdateRefreshSpeedMenu();

            this.mnuIgnoreRedundantWrites.Checked = config.RamIgnoreRedundantWrites;
            this.UpdateFlags();

            this.mnuShowCharacters.Checked           = config.RamShowCharacters;
            this.mnuShowLabelInfoOnMouseOver.Checked = config.RamShowLabelInfo;

            this.ctrlHexViewer.TextZoom = config.RamTextZoom;
            this.ctrlHexViewer.BaseFont = new Font(config.RamFontFamily, config.RamFontSize, config.RamFontStyle);

            this.ctrlMemoryAccessCounters.BaseFont = new Font(config.RamFontFamily, config.RamFontSize, config.RamFontStyle);
            this.ctrlMemoryAccessCounters.TextZoom = config.RamTextZoom;

            this.mnuHighlightExecution.Checked = config.RamHighlightExecution;
            this.mnuHightlightReads.Checked    = config.RamHighlightReads;
            this.mnuHighlightWrites.Checked    = config.RamHighlightWrites;
            this.mnuHideUnusedBytes.Checked    = config.RamHideUnusedBytes;
            this.mnuHideReadBytes.Checked      = config.RamHideReadBytes;
            this.mnuHideWrittenBytes.Checked   = config.RamHideWrittenBytes;
            this.mnuHideExecutedBytes.Checked  = config.RamHideExecutedBytes;

            this.mnuHighlightLabelledBytes.Checked = config.RamHighlightLabelledBytes;
            this.mnuHighlightBreakpoints.Checked   = config.RamHighlightBreakpoints;
            this.mnuHighlightChrDrawnBytes.Checked = config.RamHighlightChrDrawnBytes;
            this.mnuHighlightChrReadBytes.Checked  = config.RamHighlightChrReadBytes;
            this.mnuHighlightCodeBytes.Checked     = config.RamHighlightCodeBytes;
            this.mnuHighlightDataBytes.Checked     = config.RamHighlightDataBytes;
            this.mnuHighlightDmcDataBytes.Checked  = config.RamHighlightDmcDataBytes;

            this.UpdateFadeOptions();

            this.InitTblMappings();

            this.ctrlHexViewer.StringViewVisible = mnuShowCharacters.Checked;
            this.ctrlHexViewer.MemoryViewer      = this;

            UpdateImportButton();
            InitMemoryTypeDropdown(true);

            _notifListener = new InteropEmu.NotificationListener(ConfigManager.Config.DebugInfo.DebugConsoleId);
            _notifListener.OnNotification += _notifListener_OnNotification;

            this.mnuShowCharacters.CheckedChanged        += this.mnuShowCharacters_CheckedChanged;
            this.mnuIgnoreRedundantWrites.CheckedChanged += mnuIgnoreRedundantWrites_CheckedChanged;

            if (!ConfigManager.Config.DebugInfo.MemoryViewerSize.IsEmpty)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.Size          = ConfigManager.Config.DebugInfo.MemoryViewerSize;
                this.Location      = ConfigManager.Config.DebugInfo.MemoryViewerLocation;
            }

            this.InitShortcuts();
        }