Пример #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 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.Debugger: frm = new frmDebugger(CpuType.Cpu); frm.Icon = Properties.Resources.Debugger; break;

                case DebugWindow.SpcDebugger: frm = new frmDebugger(CpuType.Spc); frm.Icon = Properties.Resources.SpcDebugger; break;

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

                case DebugWindow.MemoryTools: frm = new frmMemoryTools(); frm.Icon = Properties.Resources.CheatCode; break;

                case DebugWindow.TileViewer: frm = new frmTileViewer(); frm.Icon = Properties.Resources.VerticalLayout; break;

                case DebugWindow.TilemapViewer: frm = new frmTilemapViewer(); frm.Icon = Properties.Resources.VideoOptions; break;

                case DebugWindow.PaletteViewer: frm = new frmPaletteViewer(); frm.Icon = Properties.Resources.VideoFilter; break;

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

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

                _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)
            {
                BringToFront(existingWindow);
                return(existingWindow);
            }
            else
            {
                BaseForm frm = null;

                switch (window)
                {
                case DebugWindow.Debugger: frm = new frmDebugger(CpuType.Cpu); frm.Icon = Properties.Resources.Debugger; break;

                case DebugWindow.SpcDebugger: frm = new frmDebugger(CpuType.Spc); frm.Icon = Properties.Resources.SpcDebugger; break;

                case DebugWindow.Sa1Debugger: frm = new frmDebugger(CpuType.Sa1); frm.Icon = Properties.Resources.Sa1Debugger; break;

                case DebugWindow.GsuDebugger: frm = new frmDebugger(CpuType.Gsu); frm.Icon = Properties.Resources.GsuDebugger; break;

                case DebugWindow.NecDspDebugger: frm = new frmDebugger(CpuType.NecDsp); frm.Icon = Properties.Resources.NecDspDebugger; break;

                case DebugWindow.Cx4Debugger: frm = new frmDebugger(CpuType.Cx4); frm.Icon = Properties.Resources.Cx4Debugger; break;

                case DebugWindow.GbDebugger: frm = new frmDebugger(CpuType.Gameboy); frm.Icon = Properties.Resources.GbDebugger; break;

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

                case DebugWindow.MemoryTools: frm = new frmMemoryTools(); frm.Icon = Properties.Resources.CheatCode; break;

                case DebugWindow.TileViewer: frm = new frmTileViewer(CpuType.Cpu); frm.Icon = Properties.Resources.VerticalLayout; break;

                case DebugWindow.TilemapViewer: frm = new frmTilemapViewer(CpuType.Cpu); frm.Icon = Properties.Resources.VideoOptions; break;

                case DebugWindow.PaletteViewer: frm = new frmPaletteViewer(CpuType.Cpu); frm.Icon = Properties.Resources.VideoFilter; break;

                case DebugWindow.SpriteViewer: frm = new frmSpriteViewer(CpuType.Cpu); frm.Icon = Properties.Resources.PerfTracker; break;

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

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

                case DebugWindow.RegisterViewer: frm = new frmRegisterViewer(); frm.Icon = Properties.Resources.RegisterIcon; break;

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

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

                case DebugWindow.DebugLog: frm = new frmDebugLog(); frm.Icon = Properties.Resources.LogWindow; break;

                case DebugWindow.GbTileViewer: frm = new frmTileViewer(CpuType.Gameboy); frm.Icon = Properties.Resources.VerticalLayout; break;

                case DebugWindow.GbTilemapViewer: frm = new frmTilemapViewer(CpuType.Gameboy); frm.Icon = Properties.Resources.VideoOptions; break;

                case DebugWindow.GbPaletteViewer: frm = new frmPaletteViewer(CpuType.Gameboy); frm.Icon = Properties.Resources.VideoFilter; break;

                case DebugWindow.GbSpriteViewer: frm = new frmSpriteViewer(CpuType.Gameboy); frm.Icon = Properties.Resources.PerfTracker; break;

                case DebugWindow.GbEventViewer: frm = new frmEventViewer(CpuType.Gameboy); frm.Icon = Properties.Resources.NesEventViewer; break;
                }

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

                _openedWindows.Add(frm);
                frm.FormClosed += Debugger_FormClosed;
                frm.Show();
                return(frm);
            }
        }