예제 #1
0
파일: CDL.cs 프로젝트: zdimension/BizHawk
        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 || Global.Config.CDLAutoStart)
                {
                    CodeDataLogger.SetCDL(_cdl);
                }

                SetCurrentFilename(path);
            }

            UpdateDisplay(true);
        }
예제 #2
0
파일: CDL.cs 프로젝트: zdimension/BizHawk
 protected override void OnClosed(EventArgs e)
 {
     //deactivate logger
     if (CodeDataLogger != null)             //just in case...
     {
         CodeDataLogger.SetCDL(null);
     }
 }
예제 #3
0
파일: CDL.cs 프로젝트: zdimension/BizHawk
        private void tsbLoggingActive_CheckedChanged(object sender, EventArgs e)
        {
            if (tsbLoggingActive.Checked && _cdl == null)
            {
                //implicitly create a new file
                NewFileLogic();
            }

            if (_cdl != null && tsbLoggingActive.Checked)
            {
                CodeDataLogger.SetCDL(_cdl);
            }
            else
            {
                CodeDataLogger.SetCDL(null);
            }
        }
예제 #4
0
파일: CDL.cs 프로젝트: zdimension/BizHawk
        void NewFileLogic()
        {
            _cdl = new CodeDataLog();
            CodeDataLogger.NewCDL(_cdl);

            if (tsbLoggingActive.Checked || Global.Config.CDLAutoStart)
            {
                CodeDataLogger.SetCDL(_cdl);
            }
            else
            {
                CodeDataLogger.SetCDL(null);
            }

            SetCurrentFilename(null);

            UpdateDisplay(true);
        }
예제 #5
0
파일: CDL.cs 프로젝트: zdimension/BizHawk
        private void DisassembleMenuItem_Click(object sender, EventArgs e)
        {
            if (_cdl == null)
            {
                MessageBox.Show(this, "Cannot disassemble with no CDL loaded!", "Alert");
                return;
            }

            var sfd    = new SaveFileDialog();
            var result = sfd.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                using (var fs = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
                {
                    CodeDataLogger.DisassembleCDL(fs, _cdl);
                }
            }
        }
예제 #6
0
 void ShutdownCDL()
 {
     _cdl = null;
     CodeDataLogger.SetCDL(null);
 }