Mesen-SX/UI/Debugger/Controls/ctrlPpuStatus.cs

41 lines
968 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Mesen.GUI.Controls;
using Mesen.GUI.Forms;
namespace Mesen.GUI.Debugger.Controls
{
public partial class ctrlPpuStatus : BaseControl
{
private EntityBinder _binder = new EntityBinder();
private DebugState _lastState;
public ctrlPpuStatus()
{
InitializeComponent();
if(IsDesignMode) {
return;
}
_binder.Entity = new PpuState();
_binder.AddBinding(nameof(PpuState.Cycle), txtCycle, eNumberFormat.Decimal);
_binder.AddBinding(nameof(PpuState.Scanline), txtScanline, eNumberFormat.Decimal);
_binder.AddBinding(nameof(PpuState.HClock), txtHClocks, eNumberFormat.Decimal);
}
public void UpdateStatus(DebugState state)
{
_lastState = state;
_binder.Entity = state.Ppu;
_binder.UpdateUI();
}
}
}