• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Common.MemoryDomain类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BizHawk.Emulation.Common.MemoryDomain的典型用法代码示例。如果您正苦于以下问题:C# MemoryDomain类的具体用法?C# MemoryDomain怎么用?C# MemoryDomain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MemoryDomain类属于BizHawk.Emulation.Common命名空间,在下文中一共展示了MemoryDomain类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Disassemble

		public override string Disassemble(MemoryDomain m, uint addr, out int length)
		{
			ushort tmp;
			string ret = Common.Components.Z80GB.NewDisassembler.Disassemble((ushort)addr, (a) => m.PeekByte(a), out tmp);
			length = tmp;
			return ret;
		}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:7,代码来源:GBDisassembler.cs


示例2: SetupMemoryDomains

		private void SetupMemoryDomains()
		{
			var domains = new List<MemoryDomain>(3);
			var MainMemoryDomain = new MemoryDomain("Main RAM", Ram.Length, MemoryDomain.Endian.Little,
				addr => Ram[addr],
				(addr, value) => Ram[addr] = value);
			var VRamDomain = new MemoryDomain("Video RAM", VDP.VRAM.Length, MemoryDomain.Endian.Little,
				addr => VDP.VRAM[addr],
				(addr, value) => VDP.VRAM[addr] = value);
			var SystemBusDomain = new MemoryDomain("System Bus", 0x10000, MemoryDomain.Endian.Little,
				(addr) =>
				{
					if (addr < 0 || addr >= 65536)
					{
						throw new ArgumentOutOfRangeException();
					}

					return Cpu.ReadMemory((ushort)addr);
				},
				(addr, value) =>
				{
					if (addr < 0 || addr >= 65536)
					{
						throw new ArgumentOutOfRangeException();
					}

					Cpu.WriteMemory((ushort)addr, value);
				});

			domains.Add(MainMemoryDomain);
			domains.Add(VRamDomain);
			domains.Add(SystemBusDomain);
			memoryDomains = new MemoryDomainList(domains);
			(ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(memoryDomains);
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:35,代码来源:ColecoVision.IMemoryDomains.cs


示例3: SetupMemoryDomains

		private void SetupMemoryDomains()
		{
			var domains = new List<MemoryDomain>
			{
				MemoryDomain.FromByteArray("Main RAM", MemoryDomain.Endian.Little, _ram)
			};

			var systemBusDomain = new MemoryDomain("System Bus", 0x10000, MemoryDomain.Endian.Little,
				(addr) =>
				{
					if (addr < 0 || addr >= 65536)
						throw new ArgumentOutOfRangeException();
					return Cpu.ReadMemory((ushort)addr);
				},
				(addr, value) =>
				{
					if (addr < 0 || addr >= 65536)
						throw new ArgumentOutOfRangeException();
					Cpu.WriteMemory((ushort)addr, value);
				});

			domains.Add(systemBusDomain);

			_memoryDomains = new MemoryDomainList(domains);
			(ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains);
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:26,代码来源:TI83.IMemoryDomains.cs


示例4: SetUpMemoryDomains

		private void SetUpMemoryDomains()
		{
			_domainList.Clear();
			// this must be first to coincide with "main memory"
			// note that ewram could also be considered main memory depending on which hairs you split
			AddMemoryDomain(LibMeteor.MemoryArea.iwram, 32 * 1024, "IWRAM");
			AddMemoryDomain(LibMeteor.MemoryArea.ewram, 256 * 1024, "EWRAM");
			AddMemoryDomain(LibMeteor.MemoryArea.bios, 16 * 1024, "BIOS");
			AddMemoryDomain(LibMeteor.MemoryArea.palram, 1024, "PALRAM");
			AddMemoryDomain(LibMeteor.MemoryArea.vram, 96 * 1024, "VRAM");
			AddMemoryDomain(LibMeteor.MemoryArea.oam, 1024, "OAM");
			// even if the rom is less than 32MB, the whole is still valid in meteor
			AddMemoryDomain(LibMeteor.MemoryArea.rom, 32 * 1024 * 1024, "ROM");
			// special domain for system bus
			{
				MemoryDomain sb = new MemoryDomain("System Bus", 1 << 28, MemoryDomain.Endian.Little,
					delegate(long addr)
					{
						if (addr < 0 || addr >= 0x10000000)
							throw new IndexOutOfRangeException();
						return LibMeteor.libmeteor_peekbus((uint)addr);
					},
					delegate(long addr, byte val)
					{
						if (addr < 0 || addr >= 0x10000000)
							throw new IndexOutOfRangeException();
						LibMeteor.libmeteor_writebus((uint)addr, val);
					});
				_domainList.Add(sb);
			}
			// special combined ram memory domain
			{
				var ew = _domainList[1];
				var iw = _domainList[0];
				MemoryDomain cr = new MemoryDomain("Combined WRAM", (256 + 32) * 1024, MemoryDomain.Endian.Little,
					delegate(long addr)
					{
						if (addr < 0 || addr >= (256 + 32) * 1024)
							throw new IndexOutOfRangeException();
						if (addr >= 256 * 1024)
							return iw.PeekByte(addr & 32767);
						else
							return ew.PeekByte(addr);
					},
					delegate(long addr, byte val)
					{
						if (addr < 0 || addr >= (256 + 32) * 1024)
							throw new IndexOutOfRangeException();
						if (addr >= 256 * 1024)
							iw.PokeByte(addr & 32767, val);
						else
							ew.PokeByte(addr, val);
					});
				_domainList.Add(cr);
			}

			_memoryDomains = new MemoryDomainList(_domainList);
			(ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains);
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:59,代码来源:Meteor.IMemoryDomains.cs


示例5: MemoryLuaLibrary

		public MemoryLuaLibrary(Lua lua)
			: base(lua)
		{
			if (MemoryDomainCore != null)
			{
				_currentMemoryDomain = MemoryDomainCore.MainMemory;
			}
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:8,代码来源:EmuLuaLibrary.Memory.cs


示例6: Disassemble

		public string Disassemble(MemoryDomain m, uint addr, out int length)
		{
            if (_selectedDisassemblable == null)
            {
                SetDefaultDisassemblable();
            }
            return _selectedDisassemblable.Disassemble(m, addr, out length);
		}
开发者ID:SaxxonPike,项目名称:BizHawk,代码行数:8,代码来源:C64.IDisassemblable.cs


示例7: InitMemoryDomains

		private void InitMemoryDomains()
		{
			var mm = new List<MemoryDomain>();
			var s = new LibVBANext.MemoryAreas();
			var l = MemoryDomain.Endian.Little;
			LibVBANext.GetMemoryAreas(Core, s);
			mm.Add(MemoryDomain.FromIntPtr("IWRAM", 32 * 1024, l, s.iwram, true, 4));
			mm.Add(MemoryDomain.FromIntPtr("EWRAM", 256 * 1024, l, s.ewram, true, 4));
			mm.Add(MemoryDomain.FromIntPtr("BIOS", 16 * 1024, l, s.bios, false, 4));
			mm.Add(MemoryDomain.FromIntPtr("PALRAM", 1024, l, s.palram, false, 4));
			mm.Add(MemoryDomain.FromIntPtr("VRAM", 96 * 1024, l, s.vram, true, 4));
			mm.Add(MemoryDomain.FromIntPtr("OAM", 1024, l, s.oam, true, 4));
			mm.Add(MemoryDomain.FromIntPtr("ROM", 32 * 1024 * 1024, l, s.rom, true, 4));

			mm.Add(new MemoryDomain("System Bus", 0x10000000, l,
				delegate(long addr)
				{
					if (addr < 0 || addr >= 0x10000000)
						throw new ArgumentOutOfRangeException();
					return LibVBANext.SystemBusRead(Core, (int)addr);
				},
				delegate(long addr, byte val)
				{
					if (addr < 0 || addr >= 0x10000000)
						throw new ArgumentOutOfRangeException();
					LibVBANext.SystemBusWrite(Core, (int)addr, val);
				}, 4));
			// special combined ram memory domain
			{
				var ew = mm[1];
				var iw = mm[0];
				MemoryDomain cr = new MemoryDomain("Combined WRAM", (256 + 32) * 1024, MemoryDomain.Endian.Little,
					delegate(long addr)
					{
						if (addr < 0 || addr >= (256 + 32) * 1024)
							throw new IndexOutOfRangeException();
						if (addr >= 256 * 1024)
							return iw.PeekByte(addr & 32767);
						else
							return ew.PeekByte(addr);
					},
					delegate(long addr, byte val)
					{
						if (addr < 0 || addr >= (256 + 32) * 1024)
							throw new IndexOutOfRangeException();
						if (addr >= 256 * 1024)
							iw.PokeByte(addr & 32767, val);
						else
							ew.PokeByte(addr, val);
					}, 4);
				mm.Add(cr);
			}

			_memoryDomains = new MemoryDomainList(mm);
			(ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains);
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:56,代码来源:VBANext.IMemoryDomains.cs


示例8: WrappedMemoryDomain

            public WrappedMemoryDomain(string name, MemoryDomain m)
            {
                _m = m;

                Name = name;
                Size = m.Size;
                WordSize = m.WordSize;
                EndianType = m.EndianType;
                Writable = m.Writable;
            }
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:10,代码来源:GambatteLink.IMemoryDomains.cs


示例9: Disassemble

        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            _disassemblerInstance.ReadWord = (a) => (short)m.PeekUshort(a, m.EndianType == MemoryDomain.Endian.Big);
            _disassemblerInstance.ReadByte = (a) => (sbyte)m.PeekByte(a);
            _disassemblerInstance.ReadLong = (a) => (int)m.PeekUint(a, m.EndianType == MemoryDomain.Endian.Big);
            var info = _disassemblerInstance.Disassemble((int)addr);

            length = info.Length;

            return string.Format("{0:X4}  {1,-7} {2}", info.RawBytes.Substring(0, 4), info.Mnemonic, info.Args);
        }
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:11,代码来源:GPGX.IDisassembler.cs


示例10: Disassemble

        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            length = 4; // TODO: is this right?
            var instruction = m.PeekUint(addr, true);

            //TODO - reserve buffer here for disassembling into. allocating repeatedly will be slower
            var result = api.m64p_decode_op(instruction, addr);
            string strResult = Marshal.PtrToStringAnsi(result);

            return strResult;
        }
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:11,代码来源:N64.IDisassemblable.cs


示例11: WordWatch

		/// <summary>
		/// Inialize a new instance of <see cref="WordWatch"/>
		/// </summary>
		/// <param name="domain"><see cref="MemoryDomain"/> where you want to track</param>
		/// <param name="address">The address you want to track</param>
		/// <param name="type">How you you want to display the value See <see cref="DisplayType"/></param>
		/// <param name="bigEndian">Specify the endianess. true for big endian</param>
		/// <param name="note">A custom note about the <see cref="Watch"/></param>
		/// <param name="value">Current value</param>
		/// <param name="previous">Previous value</param>
		/// <param name="changeCount">How many times value has changed</param>
		/// <exception cref="ArgumentException">Occurs when a <see cref="DisplayType"/> is incompatible with <see cref="WatchSize.Word"/></exception>
		internal WordWatch(MemoryDomain domain, long address, DisplayType type, bool bigEndian, string note, ushort value, ushort previous, int changeCount)
			: base(domain, address, WatchSize.Word, type, bigEndian, note)
		{
			if (value == 0)
			{
				this._value = GetWord();
			}
			else
			{
				this._value = value;
			}
			this._previous = previous;
			this._changecount = changeCount;
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:26,代码来源:WordWatch.cs


示例12: ByteWatch

        public ByteWatch(MemoryDomain domain, long address, DisplayType type, bool bigEndian, string notes)
        {
            _address = address;
            _domain = domain;
            _value = _previous = GetByte();
            if (AvailableTypes(WatchSize.Byte).Contains(type))
            {
                _type = type;
            }

            _bigEndian = bigEndian;
            if (notes != null)
            {
                Notes = notes;
            }
        }
开发者ID:cas1993per,项目名称:bizhawk,代码行数:16,代码来源:Watch.cs


示例13: ToString

		public static string ToString(Watch watch, MemoryDomain domain)
		{
			var numDigits = (domain.Size - 1).NumHexDigits();

			var sb = new StringBuilder();

			sb
				.Append((watch.Address ?? 0).ToHexString(numDigits)).Append('\t')
				.Append(watch.SizeAsChar).Append('\t')
				.Append(watch.TypeAsChar).Append('\t')
				.Append(watch.BigEndian ? '1' : '0').Append('\t')
				.Append(watch.DomainName).Append('\t')
				.Append(watch.Notes.Trim(new[] { '\r', '\n' }));

			return sb.ToString();
		}
开发者ID:Hathor86,项目名称:BizHawk,代码行数:16,代码来源:Watch.cs


示例14: SetWatch

        public void SetWatch(MemoryDomain domain, IEnumerable<Watch> watches = null, Mode mode = Mode.New)
        {
            if (watches != null)
            {
                _watchList.AddRange(watches);
            }

            _mode = mode;

            DomainDropDown.Items.Clear();
            DomainDropDown.Items.AddRange(MemoryDomains
                .Select(d => d.ToString())
                .ToArray());
            DomainDropDown.SelectedItem = MemoryDomains.MainMemory.ToString();

            SetTitle();
        }
开发者ID:cas1993per,项目名称:bizhawk,代码行数:17,代码来源:WatchEditor.cs


示例15: SetupMemoryDomains

        private void SetupMemoryDomains()
        {
            var domains = new List<MemoryDomain>();

            var mainRamDomain = new MemoryDomain("Main Ram", 0xC000, MemoryDomain.Endian.Little,
                (addr) =>
                {
                    if (addr < 0 || addr >= 0xC000)
                        throw new ArgumentOutOfRangeException();
                    return (byte)_machine.Memory.Read((int)addr);
                },
                (addr, value) =>
                {
                    if (addr < 0 || addr >= 0xC000)
                        throw new ArgumentOutOfRangeException();
                    _machine.Memory.Write((int)addr, value);
                });

            domains.Add(mainRamDomain);

            var systemBusDomain = new MemoryDomain("System Bus", 0x10000, MemoryDomain.Endian.Little,
                (addr) =>
                {
                    if (addr < 0 || addr >= 65536)
                        throw new ArgumentOutOfRangeException();
                    return (byte)_machine.Memory.Read((int)addr);
                },
                (addr, value) =>
                {
                    if (addr < 0 || addr >= 65536)
                        throw new ArgumentOutOfRangeException();
                    _machine.Memory.Write((int)addr, value);
                });

            domains.Add(systemBusDomain);

            _memoryDomains = new MemoryDomainList(domains);
            (ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains);
        }
开发者ID:cas1993per,项目名称:bizhawk,代码行数:39,代码来源:AppleII.IMemoryDomains.cs


示例16: Disassemble

		public override string Disassemble(MemoryDomain m, uint addr, out int length)
		{
			if (_cpu == "ARM v4 (Thumb)")
			{
				addr &= unchecked((uint)~1);
				int op = m.PeekByte((int)addr) | m.PeekByte((int)addr + 1) << 8;
				string ret = Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr | 1, (uint)op);
				length = 2;
				return ret;
			}
			else
			{
				addr &= unchecked((uint)~3);
				int op = m.PeekByte((int)addr)
					| m.PeekByte((int)addr + 1) << 8
					| m.PeekByte((int)addr + 2) << 16
					| m.PeekByte((int)addr + 3) << 24;
				string ret = Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr, (uint)op);
				length = 4;
				return ret;
			}
		}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:22,代码来源:ArmV4Disassembler.cs


示例17: Restart

		public void Restart()
		{
			if (_currentDomain == null ||
				MemoryDomains.Contains(_currentDomain))
			{
				_currentDomain = MemoryDomains.MainMemory;
				_bigEndian = _currentDomain.EndianType == MemoryDomain.Endian.Big;
				_dataSize = 1;
			}

			if (_isBotting)
			{
				StopBot();
			}
			else if (_replayMode)
			{
				FinishReplay();
			}


			if (_lastRom != GlobalWin.MainForm.CurrentlyOpenRom)
			{
				_lastRom = GlobalWin.MainForm.CurrentlyOpenRom;
				SetupControlsAndProperties();
			}
		}
开发者ID:Suboptimalplay,项目名称:BizHawk,代码行数:26,代码来源:BasicBot.cs


示例18: SetupMemoryDomains

		private void SetupMemoryDomains()
		{
			var domains = new List<MemoryDomain>();
			var RAM = new MemoryDomain("RAM", 0x800, MemoryDomain.Endian.Little,
				addr => ram[addr], (addr, value) => ram[addr] = value);
			var SystemBus = new MemoryDomain("System Bus", 0x10000, MemoryDomain.Endian.Little,
				addr => PeekMemory((ushort)addr), (addr, value) => ApplySystemBusPoke((int)addr, value));
			var PPUBus = new MemoryDomain("PPU Bus", 0x4000, MemoryDomain.Endian.Little,
				addr => ppu.ppubus_peek((int)addr), (addr, value) => ppu.ppubus_write((int)addr, value));
			var CIRAMdomain = new MemoryDomain("CIRAM (nametables)", 0x800, MemoryDomain.Endian.Little,
				addr => CIRAM[addr], (addr, value) => CIRAM[addr] = value);
			var OAMdoman = new MemoryDomain("OAM", 64 * 4, MemoryDomain.Endian.Unknown,
				addr => ppu.OAM[addr], (addr, value) => ppu.OAM[addr] = value);

			domains.Add(RAM);
			domains.Add(SystemBus);
			domains.Add(PPUBus);
			domains.Add(CIRAMdomain);
			domains.Add(OAMdoman);

			if (!(Board is FDS) && Board.SaveRam != null)
			{
				var BatteryRam = new MemoryDomain("Battery RAM", Board.SaveRam.Length, MemoryDomain.Endian.Little,
					addr => Board.SaveRam[addr], (addr, value) => Board.SaveRam[addr] = value);
				domains.Add(BatteryRam);
			}

			if (Board.ROM != null)
			{
				var PRGROM = new MemoryDomain("PRG ROM", cart.prg_size * 1024, MemoryDomain.Endian.Little,
					addr => Board.ROM[addr], (addr, value) => Board.ROM[addr] = value);
				domains.Add(PRGROM);
			}

			if (Board.VROM != null)
			{
				var CHRROM = new MemoryDomain("CHR VROM", cart.chr_size * 1024, MemoryDomain.Endian.Little,
					addr => Board.VROM[addr], (addr, value) => Board.VROM[addr] = value);
				domains.Add(CHRROM);
			}

			if (Board.VRAM != null)
			{
				var VRAM = new MemoryDomain("VRAM", Board.VRAM.Length, MemoryDomain.Endian.Little,
					addr => Board.VRAM[addr], (addr, value) => Board.VRAM[addr] = value);
				domains.Add(VRAM);
			}

			if (Board.WRAM != null)
			{
				var WRAM = new MemoryDomain("WRAM", Board.WRAM.Length, MemoryDomain.Endian.Little,
					addr => Board.WRAM[addr], (addr, value) => Board.WRAM[addr] = value);
				domains.Add(WRAM);
			}

			// if there were more boards with special ram sets, we'd want to do something more general
			if (Board is FDS)
			{
				domains.Add((Board as FDS).GetDiskPeeker());
			}
			else if (Board is ExROM)
			{
				domains.Add((Board as ExROM).GetExRAM());
			}

			_memoryDomains = new MemoryDomainList(domains);
			(ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains);
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:68,代码来源:NES.IMemoryDomains.cs


示例19: SetDomain

		private void SetDomain(MemoryDomain domain)
		{
			SetMemoryDomain(domain.Name);
		}
开发者ID:TechnoTaff,项目名称:BizHawk,代码行数:4,代码来源:HexEditor.cs


示例20: SetMemoryDomain

		private void SetMemoryDomain(string name)
		{
			if (name == _romDomain.Name)
			{
				_domain = _romDomain;
			}
			else
			{
				_domain = MemoryDomains[name];
			}

			BigEndian = _domain.EndianType == MemoryDomain.Endian.Big;
			_maxRow = _domain.Size / 2;
			SetUpScrollBar();
			if (0 >= HexScrollBar.Minimum && 0 <= HexScrollBar.Maximum)
			{
				HexScrollBar.Value = 0;
			}

			if (_domain.CanPoke())
			{
				AddressesLabel.ForeColor = SystemColors.ControlText;
			}
			else
			{
				AddressesLabel.ForeColor = SystemColors.ControlDarkDark;
			}

			UpdateGroupBoxTitle();
			SetHeader();
			UpdateValues();
		}
开发者ID:TechnoTaff,项目名称:BizHawk,代码行数:32,代码来源:HexEditor.cs



注:本文中的BizHawk.Emulation.Common.MemoryDomain类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# M68000.DisassemblyInfo类代码示例发布时间:2022-05-24
下一篇:
C# EmuHawk.InputRoll类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap