Example #1
0
 public void Restart()
 {
     LoggingActiveCheckbox.Checked = _emu.Cpu.CDLLoggingActive;
     _cdl = _emu.Cpu.CDL;
     _emu.InitCDLMappings();
     UpdateDisplay();
 }
Example #2
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;
                        }
                    }
                }
            }
        }
        public void QUERY_set_cdl(CodeDataLog cdl)
        {
            WritePipeMessage(eMessage.eMessage_QUERY_set_cdl);
            if (cdl == null)
            {
                for (int i = 0; i < 4 * 2; i++)
                {
                    WritePipePointer(IntPtr.Zero);
                }
            }
            else
            {
                WritePipePointer(cdl.GetPin("CARTROM"), false);
                bwPipe.Write(cdl["CARTROM"].Length);

                if (cdl.Has("CARTRAM"))
                {
                    WritePipePointer(cdl.GetPin("CARTRAM"), false);
                    bwPipe.Write(cdl["CARTRAM"].Length);
                }
                else
                {
                    WritePipePointer(IntPtr.Zero);
                    WritePipePointer(IntPtr.Zero);
                }

                WritePipePointer(cdl.GetPin("WRAM"));
                bwPipe.Write(cdl["WRAM"].Length);

                WritePipePointer(cdl.GetPin("APURAM"), false);
                bwPipe.Write(cdl["APURAM"].Length);
                bwPipe.Flush();
            }
        }
Example #4
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);
                    }
                }
            }
        }
Example #5
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);
        }
Example #6
0
		public void Restart()
		{
			LoggingActiveCheckbox.Checked = _emu.Cpu.CDLLoggingActive;
			_cdl = _emu.Cpu.CDL;
			_emu.InitCDLMappings();
			UpdateDisplay();
		}
Example #7
0
		void ICodeDataLogger.SetCDL(CodeDataLog cdl)
		{
			CDL = cdl;
			if(cdl == null)
				LibGambatte.gambatte_setcdcallback(GambatteState, null);
			else
				LibGambatte.gambatte_setcdcallback(GambatteState, CDCallback);
		}
Example #8
0
		public void Restart()
		{
			//don't try to recover the current CDL!
			//even though it seems like it might be nice, it might get mixed up between games. even if we use CheckCDL. Switching games with the same memory map will be bad.
			_cdl = null;
			SetCurrentFilename(null);
			SetLoggingActiveCheck(false);
			UpdateDisplay(true);
		}
Example #9
0
		public void Restart()
		{
			//don't try to recover the current CDL!
			//even though it seems like it might be nice, it might get mixed up between games. even if we use CheckCDL. Switching games with the same memory map will be bad.
			_cdl = null;
			_currentFileName = null;
			LoggingActiveCheckbox.Checked = false;
			UpdateDisplay();
		}
Example #10
0
 public void Restart()
 {
     //don't try to recover the current CDL!
     //even though it seems like it might be nice, it might get mixed up between games. even if we use CheckCDL. Switching games with the same memory map will be bad.
     _cdl = null;
     SetCurrentFilename(null);
     SetLoggingActiveCheck(false);
     UpdateDisplay(true);
 }
Example #11
0
        private void NewMenuItem_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show(this, "OK to create new CDL?", "Query", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                _cdl         = CodeDataLog.Create(_emu.Cpu.Mappings);
                _emu.Cpu.CDL = _cdl;
                UpdateDisplay();
            }
        }
Example #12
0
 public void SetCDL(CodeDataLog cdl)
 {
     CDL = cdl;
     if (cdl == null)
     {
         LibGPGX.gpgx_set_cd_callback(null);
     }
     else
     {
         LibGPGX.gpgx_set_cd_callback(CDCallback);
     }
 }
		public void NewCDL(CodeDataLog cdl)
		{
			cdl["MD CART"] = new byte[MemoryDomains["MD CART"].Size];
			cdl["68K RAM"] = new byte[MemoryDomains["68K RAM"].Size];
			cdl["Z80 RAM"] = new byte[MemoryDomains["Z80 RAM"].Size];

			if (MemoryDomains.Has("SRAM"))
				cdl["SRAM"] = new byte[MemoryDomains["SRAM"].Size];

			cdl.SubType = "GEN";
			cdl.SubVer = 0;
		}
Example #14
0
 void ICodeDataLogger.SetCDL(CodeDataLog cdl)
 {
     CDL = cdl;
     if (cdl == null)
     {
         LibGambatte.gambatte_setcdcallback(GambatteState, null);
     }
     else
     {
         LibGambatte.gambatte_setcdcallback(GambatteState, CDCallback);
     }
 }
Example #15
0
        void ICodeDataLogger.NewCDL(CodeDataLog cdl)
        {
            InitCDLMappings();
            var mm = this.Cpu.Mappings;

            foreach (var kvp in SizesFromHuMap(mm))
            {
                cdl[kvp.Key] = new byte[kvp.Value];
            }

            cdl.SubType = "PCE";
            cdl.SubVer  = 0;
        }
Example #16
0
		void ICodeDataLogger.NewCDL(CodeDataLog cdl)
		{
			cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];

			//cdl["HRAM"] = new byte[_memoryDomains["HRAM"].Size]; //this is probably useless, but it's here if someone needs it
			cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size];

			if (MemoryDomains.Has("CartRAM"))
				cdl["CartRAM"] = new byte[MemoryDomains["WRAM"].Size];

			cdl.SubType = "GB";
			cdl.SubVer = 0;
		}
Example #17
0
        public void NewCDL(CodeDataLog cdl)
        {
            cdl["MD CART"] = new byte[MemoryDomains["MD CART"].Size];
            cdl["68K RAM"] = new byte[MemoryDomains["68K RAM"].Size];
            cdl["Z80 RAM"] = new byte[MemoryDomains["Z80 RAM"].Size];

            if (MemoryDomains.Has("SRAM"))
            {
                cdl["SRAM"] = new byte[MemoryDomains["SRAM"].Size];
            }

            cdl.SubType = "GEN";
            cdl.SubVer  = 0;
        }
Example #18
0
		void ICodeDataLogger.NewCDL(CodeDataLog cdl)
		{
			cdl["ROM"] = new byte[memoryDomains["ROM"].Size];
			cdl["Main RAM"] = new byte[memoryDomains["Main RAM"].Size];

		if (memoryDomains.Has("Save RAM"))
			cdl["Save RAM"] = new byte[memoryDomains["Save RAM"].Size];

		if (memoryDomains.Has("Cart (Volatile) RAM"))
			cdl["Cart (Volatile) RAM"] = new byte[memoryDomains["Cart (Volatile) RAM"].Size];

			cdl.SubType = "SMS";
			cdl.SubVer = 0;
		}
Example #19
0
        void ICodeDataLogger.NewCDL(CodeDataLog cdl)
        {
            cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];

            //cdl["HRAM"] = new byte[_memoryDomains["HRAM"].Size]; //this is probably useless, but it's here if someone needs it
            cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size];

            if (MemoryDomains.Has("CartRAM"))
            {
                cdl["CartRAM"] = new byte[MemoryDomains["CartRAM"].Size];
            }

            cdl.SubType = "GB";
            cdl.SubVer  = 0;
        }
Example #20
0
 void ICodeDataLogger.SetCDL(CodeDataLog cdl)
 {
     CDL = cdl;
     if (cdl == null)
     {
         Cpu.ReadMemory  = ReadMemory;
         Cpu.WriteMemory = WriteMemory;
         Cpu.FetchMemory = FetchMemory_StubThunk;
     }
     else
     {
         Cpu.ReadMemory  = ReadMemory_CDL;
         Cpu.WriteMemory = WriteMemory;
         Cpu.FetchMemory = FetchMemory_CDL;
     }
 }
Example #21
0
 public void SetCDL(CodeDataLog cdl)
 {
     CDL = cdl;
     if (cdl == null)
     {
         Cpu.ReadMemory = ReadMemory;
         Cpu.WriteMemory = WriteMemory;
         Cpu.FetchMemory = FetchMemory_StubThunk;
     }
     else
     {
         Cpu.ReadMemory = ReadMemory_CDL;
         Cpu.WriteMemory = WriteMemory;
         Cpu.FetchMemory = FetchMemory_CDL;
     }
 }
Example #22
0
 public void Restart()
 {
     if (Global.Emulator is PCEngine)
     {
         _emu = (PCEngine)Global.Emulator;
         LoggingActiveCheckbox.Checked = _emu.Cpu.CDLLoggingActive;
         _cdl = _emu.Cpu.CDL;
         _emu.InitCDLMappings();
         UpdateDisplay();
     }
     else
     {
         _emu = null;
         Close();
     }
 }
Example #23
0
		public void Restart()
		{
			if (Global.Emulator is PCEngine)
			{
				_emu = (PCEngine)Global.Emulator;
				LoggingActiveCheckbox.Checked = _emu.Cpu.CDLLoggingActive;
				_cdl = _emu.Cpu.CDL;
				_emu.InitCDLMappings();
				UpdateDisplay();
			}
			else
			{
				_emu = null;
				Close();
			}
		}
Example #24
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();
         }
     }
 }
Example #25
0
        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);
        }
Example #26
0
        void ICodeDataLogger.NewCDL(CodeDataLog cdl)
        {
            cdl["ROM"]      = new byte[memoryDomains["ROM"].Size];
            cdl["Main RAM"] = new byte[memoryDomains["Main RAM"].Size];

            if (memoryDomains.Has("Save RAM"))
            {
                cdl["Save RAM"] = new byte[memoryDomains["Save RAM"].Size];
            }

            if (memoryDomains.Has("Cart (Volatile) RAM"))
            {
                cdl["Cart (Volatile) RAM"] = new byte[memoryDomains["Cart (Volatile) RAM"].Size];
            }

            cdl.SubType = "SMS";
            cdl.SubVer  = 0;
        }
Example #27
0
        public void NewCDL(CodeDataLog cdl)
        {
            cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];
            cdl["Main RAM"] = new byte[MemoryDomains["Main RAM"].Size];

            if (MemoryDomains.Has("Save RAM"))
            {
                cdl["Save RAM"] = new byte[MemoryDomains["Save RAM"].Size];
            }

            if (MemoryDomains.Has("Cart (Volatile) RAM"))
            {
                cdl["Cart (Volatile) RAM"] = new byte[MemoryDomains["Cart (Volatile) RAM"].Size];
            }

            cdl.SubType = "SMS";
            cdl.SubVer = 0;
        }
Example #28
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();
             }
         }
     }
 }
Example #29
0
	  public void DisassembleCDL(Stream s, CodeDataLog cdl, IMemoryDomains mem)
	  {
	    var w = new StreamWriter(s);
	    w.WriteLine("; Bizhawk CDL Disassembly");
	    w.WriteLine();
	    foreach (var kvp in cdl)
	    {
	      w.WriteLine(".\"{0}\" size=0x{1:x8}", kvp.Key, kvp.Value.Length);

	      byte[] cd = kvp.Value;
	      var md = mem[kvp.Key];

	      for (int i = 0; i < kvp.Value.Length; i++)
	      {
	        if ((kvp.Value[i] & (byte)HuC6280.CDLUsage.Code) != 0)
	        {
	          int unused;
	          string dis = HuC6280.DisassembleExt(
	            0,
	            out unused,
	            delegate(ushort addr)
	            {
	              return md.PeekByte(addr + i);
	            },
	            delegate(ushort addr)
	            {
	              return md.PeekWord(addr + i, false);
	            }
	          );
	          w.WriteLine("0x{0:x8}: {1}", i, dis);
	        }
	      }
	      w.WriteLine();
	    }
	    w.WriteLine("; EOF");
	    w.Flush();
	  }
Example #30
0
 void ICodeDataLogger.SetCDL(CodeDataLog cdl)
 {
     Cpu.CDL = cdl;
 }
Example #31
0
 //not supported
 void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl)
 {
 }
Example #32
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.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 = 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;
						}
					}
				}
			}
		}
		public void SetCDL(CodeDataLog cdl)
		{
			CDL = cdl;
			if (cdl == null) LibGPGX.gpgx_set_cd_callback(null);
			else LibGPGX.gpgx_set_cd_callback(CDCallback);
		}
Example #34
0
		void NewFileLogic()
		{
			_cdl = new CodeDataLog();
			CodeDataLogger.NewCDL(_cdl);

			if (tsbLoggingActive.Checked)
				CodeDataLogger.SetCDL(_cdl);
			else CodeDataLogger.SetCDL(null);

			SetCurrentFilename(null);

			UpdateDisplay(true);
		}
Example #35
0
 void ICodeDataLogger.SetCDL(CodeDataLog cdl)
 {
     ((ICodeDataLogger)L).SetCDL(cdl);
 }
Example #36
0
 void ICodeDataLogger.NewCDL(CodeDataLog cdl)
 {
     ((ICodeDataLogger)L).NewCDL(cdl);
 }
Example #37
0
 void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl)
 {
     ((ICodeDataLogger)L).DisassembleCDL(s, cdl);
 }
Example #38
0
		private void NewMenuItem_Click(object sender, EventArgs e)
		{
			var result = MessageBox.Show(this, "OK to create new CDL?", "Query", MessageBoxButtons.YesNo);
			if (result == DialogResult.Yes)
			{
				_cdl = CodeDataLog.Create(_emu.Cpu.Mappings);
				_emu.Cpu.CDL = _cdl;
				UpdateDisplay();
			}
		}
Example #39
0
 void ShutdownCDL()
 {
     _cdl = null;
     CodeDataLogger.SetCDL(null);
 }
Example #40
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();
				}
			}
		}
Example #41
0
 void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl)
 {
     Cpu.DisassembleCDL(s, cdl, memoryDomains);
 }
Example #42
0
		//not supported
		void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl) { }
Example #43
0
 // TODO: we have Disassembling now
 // not supported
 public void DisassembleCDL(Stream s, CodeDataLog cdl)
 {
 }
 void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl)
 {
     ((ICodeDataLogger)L).DisassembleCDL(s, cdl);
 }
Example #45
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);
		}
 void ICodeDataLogger.NewCDL(CodeDataLog cdl)
 {
     ((ICodeDataLogger)L).NewCDL(cdl);
 }
Example #47
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);
					}
				}
			}
		}
 void ICodeDataLogger.SetCDL(CodeDataLog cdl)
 {
     ((ICodeDataLogger)L).SetCDL(cdl);
 }
Example #49
0
 public void DisassembleCDL(Stream s, CodeDataLog cdl)
 {
 }
Example #50
0
		public void QUERY_set_cdl(CodeDataLog cdl)
		{
			WritePipeMessage(eMessage.eMessage_QUERY_set_cdl);
			if (cdl == null)
			{
				for(int i=0;i<4*2;i++)
					WritePipePointer(IntPtr.Zero);
			}
			else
			{
				WritePipePointer(cdl.GetPin("CARTROM"),false);
				bwPipe.Write(cdl["CARTROM"].Length);

				if (cdl.Has("CARTRAM"))
				{
					WritePipePointer(cdl.GetPin("CARTRAM"), false);
					bwPipe.Write(cdl["CARTRAM"].Length);
				}
				else
				{
					WritePipePointer(IntPtr.Zero);
					WritePipePointer(IntPtr.Zero);
				}
				
				WritePipePointer(cdl.GetPin("WRAM"));
				bwPipe.Write(cdl["WRAM"].Length);
				
				WritePipePointer(cdl.GetPin("APURAM"), false);
				bwPipe.Write(cdl["APURAM"].Length);
				bwPipe.Flush();
			}
		}
Example #51
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;
                 }
             }
         }
     }
 }
Example #52
0
		void NewFileLogic()
		{
			_cdl = new CodeDataLog();
			CodeDataLogger.NewCDL(_cdl);

			if (LoggingActiveCheckbox.Checked)
				CodeDataLogger.SetCDL(_cdl);
			else CodeDataLogger.SetCDL(null);

			_currentFileName = null;

			UpdateDisplay();
		}