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

            if (existingWindow != null)
            {
                existingWindow.BringToFront();
                existingWindow.Focus();
            }
            else
            {
                Form frm = null;
                switch (window)
                {
                case DebugWindow.PpuViewer: frm = new frmPpuViewer(); break;

                case DebugWindow.TraceLogger: frm = new frmTraceLogger(); break;

                case DebugWindow.MemoryViewer: frm = new frmMemoryViewer(); break;

                case DebugWindow.Assembler: frm = new frmAssembler(); break;

                case DebugWindow.Debugger: frm = new frmDebugger(); break;

                case DebugWindow.ScriptWindow: frm = new frmScript(); break;

                case DebugWindow.ApuViewer: frm = new frmApuViewer(); break;

                case DebugWindow.EventViewer: frm = new frmEventViewer(); break;
                }
                _openedWindows.Add(frm);
                frm.FormClosed += Debugger_FormClosed;
                frm.Show();
            }
        }
Пример #2
0
        public static frmPpuViewer OpenPpuViewer(PpuViewerMode mode)
        {
            frmPpuViewer frm = new frmPpuViewer(mode);

            frm.Icon = Properties.Resources.Video;
            _openedWindows.Add(frm);
            frm.FormClosed += Debugger_FormClosed;
            frm.Show();
            return(frm);
        }
Пример #3
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);
            }
        }
Пример #4
0
 public void SelectChrTile(int tileIndex, int paletteIndex, bool allowOpenWindow)
 {
     if (_isCompact && allowOpenWindow)
     {
         //If in compact mode, don't move to the CHR tab, open or use another window instead
         frmPpuViewer otherPpuViewer = null;
         foreach (BaseForm frm in DebugWindowManager.GetWindows())
         {
             if (frm != this && frm is frmPpuViewer && (!((frmPpuViewer)frm)._isCompact || ((frmPpuViewer)frm)._selectedTab == ((frmPpuViewer)frm).tpgChrViewer))
             {
                 //If a window exists and is either not in compact mode, or in compact mode and showing the CHR viewer, use it
                 otherPpuViewer = frm as frmPpuViewer;
                 break;
             }
         }
         if (otherPpuViewer == null)
         {
             //Open up a new viewer, in compact mode
             otherPpuViewer = DebugWindowManager.OpenPpuViewer(PpuViewerMode.ChrViewer);
             otherPpuViewer.SelectChrTile(tileIndex, paletteIndex, false);
         }
         else
         {
             //Reuse an existing viewer that's not in compact mode
             otherPpuViewer.SelectChrTile(tileIndex, paletteIndex, false);
             otherPpuViewer.BringToFront();
         }
     }
     else
     {
         if (!InteropEmu.DebugIsExecutionStopped() || ConfigManager.Config.DebugInfo.PpuRefreshOnBreak)
         {
             //Only change the palette if execution is not stopped (or if we're configured to refresh the viewer on break/pause)
             //Otherwise, the CHR viewer will refresh its data (and it might not match the data we loaded at the specified scanline/cycle anymore)
             ctrlChrViewer.SelectedPaletteIndex = paletteIndex;
         }
         ctrlChrViewer.SelectedTileIndex = tileIndex;
         tabMain.SelectTab(tpgChrViewer);
         _selectedTab = tpgChrViewer;
     }
 }
Пример #5
0
        public static void OpenDebugWindow(DebugWindow window)
        {
            Form existingWindow = GetExistingSingleInstanceWindow(window);

            if (existingWindow != null)
            {
                existingWindow.BringToFront();
                existingWindow.Focus();
            }
            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;
                }
                _openedWindows.Add(frm);
                frm.FormClosed += Debugger_FormClosed;
                frm.Show();
            }
        }