/** * Update the values in the visible cells */ private void WatchUpdateTimer_Tick(object sender, EventArgs e) { foreach (KeyValuePair <int, WatchedMemory> kvp in kernel_ref.WatchList) { WatchedMemory mem = kvp.Value; mem.val8bit = kernel_ref.MemMgr.ReadByte(mem.address); mem.val16bit = kernel_ref.MemMgr.ReadWord(mem.address); } WatchGrid.RowCount = kernel_ref.WatchList.Count; WatchGrid.Invalidate(); }
private void DebugPanel_MouseClick(object sender, MouseEventArgs e) { if (ActiveLine[0] != 0) { DebugLine line = kernel.lstFile.Lines[ActiveLine[0]]; if (line != null) { string name = line.GetAddressName(); int address = line.GetAddress(); WatchedMemory mem = new WatchedMemory(name, address, 0, 0); if (kernel.WatchList.ContainsKey(address)) { kernel.WatchList.Remove(address); } kernel.WatchList.Add(address, mem); } } }
private void AddButton_Click(object sender, EventArgs e) { if (AddressText.Text.Length > 0) { int addressVal = Convert.ToInt32(AddressText.Text.Replace("$", "").Replace(":", ""), 16); if (NameText.Text.Length > 0 && addressVal > 0) { if (kernel_ref.WatchList.ContainsKey(addressVal)) { kernel_ref.WatchList.Remove(addressVal); } WatchedMemory mem = new WatchedMemory(NameText.Text, addressVal, kernel_ref.MemMgr.ReadByte(addressVal), kernel_ref.MemMgr.ReadWord(addressVal) ); kernel_ref.WatchList.Add(addressVal, mem); WatchGrid.RowCount = kernel_ref.WatchList.Count; NameText.Text = ""; AddressText.Text = ""; } } }