Debugger: Improved scanline/cycle fields' usability
This commit is contained in:
parent
a04a8747ba
commit
99d1728da9
3 changed files with 57 additions and 28 deletions
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -12,29 +13,15 @@ namespace Mesen.GUI.Controls
|
||||||
{
|
{
|
||||||
private NumericUpDown nud;
|
private NumericUpDown nud;
|
||||||
|
|
||||||
public event EventHandler ValueChanged
|
public event EventHandler ValueChanged { add { nud.ValueChanged += value; } remove { nud.ValueChanged -= value; } }
|
||||||
{
|
public new event EventHandler Validated { add { nud.Validated += value; } remove { nud.Validated -= value; } }
|
||||||
add { nud.ValueChanged += value; }
|
public new event EventHandler Click { add { nud.Click += value; } remove { nud.Click -= value; } }
|
||||||
remove { nud.ValueChanged -= value; }
|
public new event KeyEventHandler KeyDown { add { nud.KeyDown += value; } remove { nud.KeyDown -= value; } }
|
||||||
}
|
public new event KeyPressEventHandler KeyPress { add { nud.KeyPress += value; } remove { nud.KeyPress -= value; } }
|
||||||
|
|
||||||
public new event EventHandler Validated
|
[Browsable(true)]
|
||||||
{
|
[EditorBrowsable(EditorBrowsableState.Always)]
|
||||||
add { nud.Validated += value; }
|
public new event EventHandler TextChanged { add { nud.TextChanged += value; } remove { nud.TextChanged -= value; } }
|
||||||
remove { nud.Validated -= value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public new event EventHandler Click
|
|
||||||
{
|
|
||||||
add { nud.Click += value; }
|
|
||||||
remove { nud.Click -= value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public new event KeyEventHandler KeyDown
|
|
||||||
{
|
|
||||||
add { nud.KeyDown += value; }
|
|
||||||
remove { nud.KeyDown -= value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public decimal Value
|
public decimal Value
|
||||||
{
|
{
|
||||||
|
|
30
GUI.NET/Debugger/frmPpuViewer.Designer.cs
generated
30
GUI.NET/Debugger/frmPpuViewer.Designer.cs
generated
|
@ -51,9 +51,9 @@ namespace Mesen.GUI.Debugger
|
||||||
this.ctrlPaletteViewer = new Mesen.GUI.Debugger.Controls.ctrlPaletteViewer();
|
this.ctrlPaletteViewer = new Mesen.GUI.Debugger.Controls.ctrlPaletteViewer();
|
||||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
this.lblShowFrameAt = new System.Windows.Forms.Label();
|
this.lblShowFrameAt = new System.Windows.Forms.Label();
|
||||||
this.nudScanline = new MesenNumericUpDown();
|
this.nudScanline = new Mesen.GUI.Controls.MesenNumericUpDown();
|
||||||
this.lblCycle = new System.Windows.Forms.Label();
|
this.lblCycle = new System.Windows.Forms.Label();
|
||||||
this.nudCycle = new MesenNumericUpDown();
|
this.nudCycle = new Mesen.GUI.Controls.MesenNumericUpDown();
|
||||||
this.btnReset = new System.Windows.Forms.Button();
|
this.btnReset = new System.Windows.Forms.Button();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.tabMain.SuspendLayout();
|
this.tabMain.SuspendLayout();
|
||||||
|
@ -241,12 +241,19 @@ namespace Mesen.GUI.Debugger
|
||||||
// nudScanline
|
// nudScanline
|
||||||
//
|
//
|
||||||
this.nudScanline.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
this.nudScanline.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||||
|
this.nudScanline.DecimalPlaces = 0;
|
||||||
|
this.nudScanline.Increment = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
this.nudScanline.Location = new System.Drawing.Point(275, 4);
|
this.nudScanline.Location = new System.Drawing.Point(275, 4);
|
||||||
this.nudScanline.Maximum = new decimal(new int[] {
|
this.nudScanline.Maximum = new decimal(new int[] {
|
||||||
260,
|
260,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
|
this.nudScanline.MaximumSize = new System.Drawing.Size(10000, 20);
|
||||||
this.nudScanline.Minimum = new decimal(new int[] {
|
this.nudScanline.Minimum = new decimal(new int[] {
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
|
@ -261,6 +268,7 @@ namespace Mesen.GUI.Debugger
|
||||||
0,
|
0,
|
||||||
0});
|
0});
|
||||||
this.nudScanline.ValueChanged += new System.EventHandler(this.nudScanlineCycle_ValueChanged);
|
this.nudScanline.ValueChanged += new System.EventHandler(this.nudScanlineCycle_ValueChanged);
|
||||||
|
this.nudScanline.TextChanged += new System.EventHandler(this.nudScanlineCycle_TextChanged);
|
||||||
//
|
//
|
||||||
// lblCycle
|
// lblCycle
|
||||||
//
|
//
|
||||||
|
@ -275,16 +283,34 @@ namespace Mesen.GUI.Debugger
|
||||||
// nudCycle
|
// nudCycle
|
||||||
//
|
//
|
||||||
this.nudCycle.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
this.nudCycle.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||||
|
this.nudCycle.DecimalPlaces = 0;
|
||||||
|
this.nudCycle.Increment = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
this.nudCycle.Location = new System.Drawing.Point(392, 4);
|
this.nudCycle.Location = new System.Drawing.Point(392, 4);
|
||||||
this.nudCycle.Maximum = new decimal(new int[] {
|
this.nudCycle.Maximum = new decimal(new int[] {
|
||||||
340,
|
340,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
0});
|
||||||
|
this.nudCycle.MaximumSize = new System.Drawing.Size(10000, 20);
|
||||||
|
this.nudCycle.Minimum = new decimal(new int[] {
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
0});
|
0});
|
||||||
this.nudCycle.Name = "nudCycle";
|
this.nudCycle.Name = "nudCycle";
|
||||||
this.nudCycle.Size = new System.Drawing.Size(52, 20);
|
this.nudCycle.Size = new System.Drawing.Size(52, 20);
|
||||||
this.nudCycle.TabIndex = 6;
|
this.nudCycle.TabIndex = 6;
|
||||||
|
this.nudCycle.Value = new decimal(new int[] {
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
this.nudCycle.ValueChanged += new System.EventHandler(this.nudScanlineCycle_ValueChanged);
|
this.nudCycle.ValueChanged += new System.EventHandler(this.nudScanlineCycle_ValueChanged);
|
||||||
|
this.nudCycle.TextChanged += new System.EventHandler(this.nudScanlineCycle_TextChanged);
|
||||||
//
|
//
|
||||||
// btnReset
|
// btnReset
|
||||||
//
|
//
|
||||||
|
|
|
@ -120,12 +120,28 @@ namespace Mesen.GUI.Debugger
|
||||||
ConfigManager.ApplyChanges();
|
ConfigManager.ApplyChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetUpdateScanlineCycle(int scanline, int cycle)
|
||||||
|
{
|
||||||
|
scanline = Math.Min(260, Math.Max(-1, scanline));
|
||||||
|
cycle = Math.Min(340, Math.Max(0, cycle));
|
||||||
|
|
||||||
|
InteropEmu.DebugSetPpuViewerScanlineCycle(scanline, cycle);
|
||||||
|
ConfigManager.Config.DebugInfo.PpuDisplayScanline = scanline;
|
||||||
|
ConfigManager.Config.DebugInfo.PpuDisplayCycle = cycle;
|
||||||
|
ConfigManager.ApplyChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nudScanlineCycle_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int scanline, cycle;
|
||||||
|
if(int.TryParse(this.nudScanline.Text, out scanline) && int.TryParse(this.nudCycle.Text, out cycle)) {
|
||||||
|
SetUpdateScanlineCycle(int.Parse(this.nudScanline.Text), int.Parse(this.nudCycle.Text));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void nudScanlineCycle_ValueChanged(object sender, EventArgs e)
|
private void nudScanlineCycle_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
InteropEmu.DebugSetPpuViewerScanlineCycle((int)this.nudScanline.Value, (int)this.nudCycle.Value);
|
SetUpdateScanlineCycle((int)this.nudScanline.Value, (int)this.nudCycle.Value);
|
||||||
ConfigManager.Config.DebugInfo.PpuDisplayScanline = (int)this.nudScanline.Value;
|
|
||||||
ConfigManager.Config.DebugInfo.PpuDisplayCycle = (int)this.nudCycle.Value;
|
|
||||||
ConfigManager.ApplyChanges();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tabMain_SelectedIndexChanged(object sender, EventArgs e)
|
private void tabMain_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue