private void EditRoutineMenuItem_Click(object sender, EventArgs e) { int idx = listBox_routines.SelectedIndex; if (idx >= 0 && idx < listBox_routines.Items.Count) { var routine = _routines[idx]; EditValueForm form = new EditValueForm("Edit Dlist", "Enter the address and coordinates of the dlist to add.", IsInputValid, $"{routine.Address:X8}; {routine.X}; {routine.Y}; {routine.Z}"); if (form.ShowDialog() == DialogResult.OK) { var parts = form.Result.Replace(" ", "").Split(";"); routine.X = routine.Y = routine.Z = 0; routine.Address = SegmentedAddress.Parse(parts[0], true); if (parts.Length > 1) { routine.X = int.Parse(parts[1]); routine.Y = int.Parse(parts[2]); routine.Z = int.Parse(parts[3]); } NewRender(); } } }
private void AddRoutineMenuItem_Click(object sender, System.EventArgs e) { EditValueForm form = new EditValueForm("Add Dlist", "Enter the address and coordinates of the dlist to add.", IsInputValid); if (form.ShowDialog() == DialogResult.OK) { var parts = form.Result.Replace(" ", "").Split(";"); int x = 0, y = 0, z = 0; var addr = SegmentedAddress.Parse(parts[0], true); if (parts.Length > 1) { x = int.Parse(parts[1]); y = int.Parse(parts[2]); z = int.Parse(parts[3]); } AddDList(addr.VAddr, x, y, z); } }
private void okBtn_Click(object sender, EventArgs e) { switch (comboBox1.SelectedItem) { case SRC_ADDR: uint addr = SegmentedAddress.Parse(addressValue.Text).VAddr; ResultSegment = Memory.Segment.FromVram($"{addr:X8}", addr); break; case SRC_IDENT_MTX: ResultSegment = Memory.Segment.FromFill("Ident Matrices", new byte[] { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }); break; case SRC_NULL: ResultSegment = Memory.Segment.FromFill("Null Bytes"); break; case SRC_EMPTY: ResultSegment = Memory.Segment.Empty(); break; case SRC_EMPTY_DLIST: ResultSegment = Memory.Segment.FromBytes("Empty Dlist", new byte[] { 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); break; default: break; } DialogResult = DialogResult.OK; Close(); }