12 |
{ |
{ |
13 |
public partial class ByteEditor : Form |
public partial class ByteEditor : Form |
14 |
{ |
{ |
15 |
private const uint max_address_width = 16; |
private const int max_address_width = 16; |
16 |
private byte[] byte_data = new byte[] { }; |
private byte[] byte_data = new byte[] { }; |
17 |
private uint base_address = 0; |
private int base_address = 0; |
18 |
public ByteEditor() |
public ByteEditor() |
19 |
{ |
{ |
20 |
InitializeComponent(); |
InitializeComponent(); |
28 |
lblAddressMarker.Text = lblAddressMarker.Text + string.Format("{0:X2} ", i); |
lblAddressMarker.Text = lblAddressMarker.Text + string.Format("{0:X2} ", i); |
29 |
} |
} |
30 |
} |
} |
31 |
public ByteEditor(byte[] data, uint BaseAddress) : this() { byte_data = data; base_address = BaseAddress; } |
public ByteEditor(byte[] data, int BaseAddress) : this() { byte_data = data; base_address = BaseAddress; } |
32 |
|
|
33 |
private void ByteEditor_Load(object sender, EventArgs e) |
private void ByteEditor_Load(object sender, EventArgs e) |
34 |
{ |
{ |
35 |
uint max_ram_view = (uint)byte_data.Length; |
uint max_ram_view = (uint)byte_data.Length; |
36 |
//for (uint i = 0; i < byte_data.Length; i += max_address_width) { max_ram_view += max_address_width; } |
//for (uint i = 0; i < byte_data.Length; i += max_address_width) { max_ram_view += max_address_width; } |
37 |
for (uint i = base_address; i < (base_address + max_ram_view); i += max_address_width) |
for (int i = base_address; i < (base_address + max_ram_view); i += max_address_width) |
38 |
{ |
{ |
39 |
txtAddresses.Text = txtAddresses.Text + string.Format("{0:X8}:\n", i); |
txtAddresses.Text = txtAddresses.Text + string.Format("{0:X8}:\n", i); |
40 |
} |
} |