当前位置: 首页>>代码示例>>C#>>正文


C# Common.MemoryDomain类代码示例

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


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


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