示例#1
0
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show(this, "OK to load new CDL?", "Query", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                var file = ToolHelpers.GetCdlFileFromUser(_currentFileName);
                if (file != null)
                {
                    using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
                    {
                        var newCDL = CodeDataLog.Load(fs);
                        if (!newCDL.CheckConsistency(_emu.Cpu.Mappings))
                        {
                            MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
                        }
                        else
                        {
                            _cdl         = newCDL;
                            _emu.Cpu.CDL = _cdl;
                            UpdateDisplay();
                            Global.Config.RecentPceCdlFiles.Add(file.FullName);
                            _currentFileName = file.FullName;
                        }
                    }
                }
            }
        }
示例#2
0
 private void AppendMenuItem_Click(object sender, EventArgs e)
 {
     if (_cdl == null)
     {
         MessageBox.Show(this, "Cannot append with no CDL loaded!", "Alert");
     }
     else
     {
         var file = ToolHelpers.GetCdlFileFromUser(_currentFileName);
         if (file != null)
         {
             using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
             {
                 var newCDL = CodeDataLog.Load(fs);
                 _cdl.LogicalOrFrom(newCDL);
                 UpdateDisplay();
             }
         }
     }
 }