public ConsoleWindow(GameboyAdvance gba, GbaDebugConsole dbgConsole) { this.Gba = gba; this.dbgConsole = dbgConsole; InitializeComponent(); this.ClientSize = new System.Drawing.Size(1600, 1000); this.Text = "Y2Gba Debug Console"; this.MaximizeBox = false; this.MinimizeBox = false; //this.FormBorderStyle = FormBorderStyle.FixedDialog; // This is the only way i found to stop the annoying bong sound effect when pressing enter on a text box! this.Controls.Add(okButton); okButton.Visible = false; this.AcceptButton = okButton; codeWnd.Font = new Font(FontFamily.GenericMonospace, console.Font.Size); console.Font = new Font(FontFamily.GenericMonospace, console.Font.Size); emuSnapshot.Enabled = false; emuSnapshot.Font = new Font(FontFamily.GenericMonospace, console.Font.Size); commandInput.KeyUp += CommandInput_KeyUp; commandInput.Focus(); RefreshEmuSnapshot(); }
public ConsoleWindow(GameboyAdvance gba, GbaDebugConsole dbgConsole) { this.Gba = gba; this.dbgConsole = dbgConsole; InitializeComponent(); this.ClientSize = new System.Drawing.Size(1600, 1000); this.Text = "Y2Gba Console"; this.MaximizeBox = false; this.MinimizeBox = false; this.FormBorderStyle = FormBorderStyle.FixedDialog; // This is the only way i found to stop the annoying bong sound effect when pressing enter on a text box! this.Controls.Add(okButton); okButton.Visible = false; this.AcceptButton = okButton; codeWnd.Location = new System.Drawing.Point(10, 10); codeWnd.Multiline = true; codeWnd.ReadOnly = true; codeWnd.Width = 900; codeWnd.Height = 300; codeWnd.Enabled = true; codeWnd.Font = new Font(FontFamily.GenericMonospace, console.Font.Size); this.Controls.Add(codeWnd); console.Location = new System.Drawing.Point(10, codeWnd.Location.Y + codeWnd.Height + 20); console.Multiline = true; console.ReadOnly = true; console.Width = 900; console.Height = 600; console.Enabled = true; console.Font = new Font(FontFamily.GenericMonospace, console.Font.Size); console.ScrollBars = RichTextBoxScrollBars.Both; this.Controls.Add(console); commandInput.Location = new System.Drawing.Point(10, console.Location.Y + console.Height + 10); commandInput.Width = ClientSize.Width - 20; commandInput.KeyUp += CommandInput_KeyUp; this.Controls.Add(commandInput); commandInput.Focus(); emuSnapshot.Location = new System.Drawing.Point(console.Location.X + console.Width + 10, 10); emuSnapshot.Multiline = true; emuSnapshot.Width = 700; emuSnapshot.Height = 900; emuSnapshot.Enabled = false; emuSnapshot.Font = new Font(FontFamily.GenericMonospace, console.Font.Size); this.Controls.Add(emuSnapshot); RefreshEmuSnapshot(); }
public RenderWindow() { InitializeComponent(); Application.ApplicationExit += new EventHandler(this.OnApplicationExit); gba = new Gba.Core.GameboyAdvance(); gba.PowerOn(); gba.OnFrame = () => this.Draw(); dbgConsole = new GbaDebugConsole(gba); consoleWindow = new ConsoleWindow(gba, dbgConsole); consoleWindow.VisibleChanged += ConsoleWindow_VisibleChanged; consoleWindow.Show(); ttyConsole = new TtyConsole(gba); //ttyConsole.Show(); gfxInspectorWindow = new GfxInspector(gba); this.Text = gba.Rom.RomName; KeyDown += OnKeyDown; KeyUp += OnKeyUp; Controls.Add(menu = new MenuStrip { Items = { new ToolStripMenuItem("Emulator") { DropDownItems = { new ToolStripMenuItem("Load ROM", null, (sender, args) =>{ }), new ToolStripMenuItem("Reset", null, (sender, args) =>{ }), } }, new ToolStripMenuItem("Window") { DropDownItems = { new ToolStripMenuItem("Console", null, (sender, args) =>{ consoleWindow.Visible = !consoleWindow.Visible; }), new ToolStripMenuItem("Tty", null, (sender, args) =>{ ttyConsole.Visible = !ttyConsole.Visible; }), new ToolStripMenuItem("Gfx Inspector", null, (sender, args) =>{ gfxInspectorWindow.Visible = !gfxInspectorWindow.Visible; }) } } } }); // 4X gameboy resolution Width = LcdController.Screen_X_Resolution * 4; Height = LcdController.Screen_Y_Resolution * 4 + menu.Height; DoubleBuffered = true; timer.Start(); //Thread.CurrentThread.Priority = ThreadPriority.Highest; #if THREADED_RENDERER drawFrame = false; renderThread = new Thread(new ThreadStart(RenderThread)); renderThread.Start(); #endif }