-
Notifications
You must be signed in to change notification settings - Fork 1
/
Breakpoints.cs
51 lines (44 loc) · 1.21 KB
/
Breakpoints.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Emu6502
{
public partial class Breakpoints : Form
{
private Nes nes;
public Breakpoints(Nes nes)
{
InitializeComponent();
this.nes = nes;
PopulateList();
}
private void PopulateList()
{
breakpointList.Items.Clear();
List<ushort> addrs = nes.Cpu.Breakpoints.GetBreakpointAddresses();
addrs.Sort();
foreach (ushort addr in addrs)
breakpointList.Items.Add(String.Format("${0:X4}", addr));
}
private void addBtn_Click(object sender, EventArgs e)
{
ushort addr=0;
try
{
addr = Convert.ToUInt16(breakpointEdit.Text, 16);
}
catch
{
MessageBox.Show("Malformatted address");
return;
}
nes.Cpu.Breakpoints.SetBreakpoint(addr);
PopulateList();
}
}
}