Ejemplo n.º 1
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 = ToolFormBase.OpenFileDialog(
                    _currentFilename,
                    PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
                    "Code Data Logger Files",
                    "cdl");

                if (file != null)
                {
                    using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
                    {
                        var newCDL = new CodeDataLog();
                        newCDL.Load(fs);
                        if (!_cdl.Check(newCDL))
                        {
                            MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
                            return;
                        }
                        _cdl.LogicalOrFrom(newCDL);
                        UpdateDisplay(true);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void LoadFile(string path)
        {
            using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read))
            {
                var newCDL = new CodeDataLog();
                newCDL.Load(fs);

                //have the core create a CodeDataLog to check mapping information against
                var testCDL = new CodeDataLog();
                CodeDataLogger.NewCDL(testCDL);
                if (!newCDL.Check(testCDL))
                {
                    if (!autoloading)
                    {
                        MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
                    }
                    return;
                }

                //ok, it's all good:
                _cdl = newCDL;
                CodeDataLogger.SetCDL(null);
                if (tsbLoggingActive.Checked || Global.Config.CDLAutoStart)
                {
                    tsbLoggingActive.Checked = true;
                    CodeDataLogger.SetCDL(_cdl);
                }

                SetCurrentFilename(path);
            }

            UpdateDisplay(true);
        }
Ejemplo n.º 3
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();
                            _recent.Add(file.FullName);
                            _currentFileName = file.FullName;
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
 public void LoadFile(string path)
 {
     using (var fs = new FileStream(path, 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();
         }
     }
 }
Ejemplo n.º 5
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();
             }
         }
     }
 }
Ejemplo n.º 6
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 = ToolFormBase.OpenFileDialog(
					_currentFilename,
					PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
					"Code Data Logger Files",
					"cdl");

				if (file != null)
				{
					using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
					{
						var newCDL = new CodeDataLog();
						newCDL.Load(fs);
						if (!_cdl.Check(newCDL))
						{
							MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
							return;
						}
						_cdl.LogicalOrFrom(newCDL);
						UpdateDisplay(true);
					}
				}
			}
		}
Ejemplo n.º 7
0
		public void LoadFile(string path)
		{
			using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read))
			{
				var newCDL = new CodeDataLog();
				newCDL.Load(fs);

				//have the core create a CodeDataLog to check mapping information against
				var testCDL = new CodeDataLog();
				CodeDataLogger.NewCDL(testCDL);
				if (!newCDL.Check(testCDL))
				{
					MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
					return;
				}

				//ok, it's all good:
				_cdl = newCDL;
				CodeDataLogger.SetCDL(null);
				if (tsbLoggingActive.Checked)
					CodeDataLogger.SetCDL(_cdl);

				SetCurrentFilename(path);
			}

			UpdateDisplay(true);
		}