Beispiel #1
0
        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();
        }
Beispiel #2
0
 public IrqBreakpoint(GameboyAdvance gba, Interrupts.InterruptType interrupt, bool breakOnIrq, bool breakOnIrqReturn, int scanline = -1)
 {
     this.gba       = gba;
     this.interrupt = interrupt;
     //previousPc = 0;
     this.breakOnIrq       = breakOnIrq;
     this.breakOnIrqReturn = breakOnIrqReturn;
     returnAddress         = 0;
     this.scanline         = scanline;
 }
Beispiel #3
0
        public TtyConsole(GameboyAdvance gba)
        {
            this.gba = gba;
            InitializeComponent();

            ttyTextBox.Font = new Font(FontFamily.GenericMonospace, ttyTextBox.Font.Size);

            gba.OnLogMessage = null;

            logLevelCb.SelectedIndex = 0;
        }
Beispiel #4
0
        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();
        }
Beispiel #5
0
        public GfxInspector(GameboyAdvance gba)
        {
            InitializeComponent();

            this.gba = gba;

            palette0Bmp = new DirectBitmap(512, 512);
            palette1Bmp = new DirectBitmap(512, 512);

            tiles0Bmp = new DirectBitmap(256, 256);
            tiles1Bmp = new DirectBitmap(256, 256);

            bgBmp = new DirectBitmap(512, 512);
        }
Beispiel #6
0
        public GbaDebugConsole(GameboyAdvance gba)
        {
            this.gba     = gba;
            EmulatorMode = Mode.BreakPoint;

            // PPU profiler is expensive! Remember to disconnect the ppu profiler if you are not using it
            //ppuProfiler = new PpuProfiler(dmg);

            ConsoleText     = new List <string>();
            ConsoleCodeText = new List <string>();

            NextInstructions = new List <StoredInstruction>();

            // SB : b $64 if [IO_LY] == 2


            // scanline 125
            //breakpoints.Add(new IrqBreakpoint(gba, Interrupts.InterruptType.HBlank, true, true));

            //breakpoints.Add(new Breakpoint(0x08000EFE));


            //breakpoints.Add(new Breakpoint(0x0801b7ac));
            //breakpoints.Add(new Breakpoint(0x08000efe));
            //breakpoints.Add(new Breakpoint(0x08000f00));

            //breakpoints.Add(new Breakpoint(0x8000F08));
            //breakpoints.Add(new Breakpoint(0x0800efe));

            //breakpoints.Add(new Breakpoint(0x64, new ConditionalExpression(snes.memory, 0xFF44, ConditionalExpression.EqualityCheck.Equal, 143)));


            BreakpointStepAvailable = false;

            PeekSequentialInstructions();
            UpdateCodeSnapshot();
        }
Beispiel #7
0
        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
        }
Beispiel #8
0
 public LcdStatusBreakpoint(GameboyAdvance gba, BreakOn breakOn)
 {
     this.gba           = gba;
     this.breakOn       = breakOn;
     cyclesOnFirstCheck = gba.Cpu.Cycles;
 }