2016-08-25 19:02:33 -04:00
|
|
|
|
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.Config;
|
2016-12-18 12:43:20 -05:00
|
|
|
|
using Mesen.GUI.Controls;
|
2016-08-25 19:02:33 -04:00
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Debugger.Controls
|
|
|
|
|
{
|
|
|
|
|
public partial class ctrlAddressList : BaseScrollableTextboxUserControl
|
|
|
|
|
{
|
|
|
|
|
private int[] _addresses;
|
|
|
|
|
|
|
|
|
|
public ctrlAddressList()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2017-09-06 21:41:15 -04:00
|
|
|
|
this.ctrlDataViewer.MarginWidth = 5;
|
2016-08-25 19:02:33 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override ctrlScrollableTextbox ScrollableTextbox
|
|
|
|
|
{
|
|
|
|
|
get { return this.ctrlDataViewer; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetData(byte[] values, int[] addresses)
|
|
|
|
|
{
|
|
|
|
|
this.ctrlDataViewer.Header = null;
|
|
|
|
|
this.ctrlDataViewer.LineNumbers = addresses;
|
2017-09-06 21:41:15 -04:00
|
|
|
|
this.ctrlDataViewer.LineIndentations = values.Select(val => 3).ToArray();
|
2017-09-12 19:38:42 -04:00
|
|
|
|
this.ctrlDataViewer.TextLines = values.Select(val => val.ToString("X2")).ToArray();
|
2016-08-25 19:02:33 -04:00
|
|
|
|
_addresses = addresses;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int? CurrentAddress
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if(_addresses?.Length > 0) {
|
2017-02-28 18:26:45 -05:00
|
|
|
|
return _addresses[Math.Min(this.ctrlDataViewer.GetLineIndex(this.ctrlDataViewer.CurrentLine), _addresses.Length - 1)];
|
2016-08-25 19:02:33 -04:00
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|