private void CustomPIns_Load(object sender, EventArgs e) { Main.customPIns = CustomPIns.LoadAllPCI(Main.DirOf(Application.ExecutablePath) + "\\Pseudo Instructions"); for (int x = 0; x < Main.customPIns.Length; x++) { listCPI.Items.Add(Main.customPIns[x].name); if (listCPI.SelectedIndex < 0) { listCPI.SelectedIndex = 0; } } }
private void Main_Load(object sender, EventArgs e) { ASMDeclarations.DeclareHelpStr(); ASMDeclarations.DeclareInstructions(); string[] args = Environment.GetCommandLineArgs(); if (args.Length == 2) { GlobalFileName = args[1]; LoadCWP3RTB(); codeDefBox.SelectionStart = 0; codeDefBox.SelectionLength = codeDefBox.Text.Length; codeDefBox.SelectionFont = codeDefBox.Font; codeDefBox.SelectionLength = 0; ASMBox.SelectionStart = 0; ASMBox.SelectionLength = ASMBox.Text.Length; ASMBox.SelectionFont = ASMBox.Font; ASMBox.SelectionLength = 0; } //Set minimum size this.MinimumSize = new System.Drawing.Size(654, 564); //Set settings file int off = Application.ExecutablePath.LastIndexOf("\\"); settFile = sLeft(Application.ExecutablePath, off + 1); pathDir = settFile; settFile += "cwps3.ini"; //Load settings string a = FileIO.OpenFile(settFile); if (a != "" && a != null) { string[] b = a.Split('\n'); try { outputType = Convert.ToInt32(b[0]); bitOrder = Convert.ToInt32(b[1]); minMemRange = Convert.ToUInt32(b[2], 16); maxMemRange = Convert.ToUInt32(b[3], 16); colEnabled = Convert.ToBoolean(b[4]); colIns = Convert.ToBoolean(b[5]); colReg = Convert.ToBoolean(b[6]); colCom = Convert.ToBoolean(b[7]); colCommand = Convert.ToBoolean(b[8]); colLab = Convert.ToBoolean(b[9]); } catch { } } if (System.IO.Directory.Exists(Main.DirOf(Application.ExecutablePath) + "\\Pseudo Instructions") == false) { System.IO.Directory.CreateDirectory(Main.DirOf(Application.ExecutablePath) + "\\Pseudo Instructions"); } customPIns = CustomPIns.LoadAllPCI(Main.DirOf(Application.ExecutablePath) + "\\Pseudo Instructions"); ASMBox.Focus(); }