本文整理汇总了C#中IMemory类的典型用法代码示例。如果您正苦于以下问题:C# IMemory类的具体用法?C# IMemory怎么用?C# IMemory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMemory类属于命名空间,在下文中一共展示了IMemory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DBExit
public DBExit(IAOF _AOF, IMemory _Memory)
{
AOF = _AOF;
Memory = _Memory;
exit();
}
开发者ID:uname-yang,项目名称:QuickData,代码行数:7,代码来源:DBExit.cs
示例2: InternalExecute
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles)
{
bool carry = cpuState.IsFlagSet(CpuState.Flags.Carry);
cpuState.SetFlag(CpuState.Flags.Carry, arg & 0x80);
arg <<= 1;
if (carry)
{
arg |= 1;
}
write(arg);
cpuState.SetNegativeFlag(arg);
cpuState.SetZeroFlag(arg);
switch (Variants[memory[cpuState.Pc]])
{
case AddressingMode.Accumulator:
cycles = 2;
break;
case AddressingMode.ZeroPage:
cycles = 5;
break;
case AddressingMode.ZeroPageXIndexed:
cycles = 6;
break;
case AddressingMode.Absolute:
cycles = 6;
break;
case AddressingMode.AbsoluteX:
cycles = 7;
break;
}
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:32,代码来源:ROL.cs
示例3: Alu
public Alu(IMemory memory, IRegisterFile registerFile, ICpuStack cpuStack, ILookupTables lookupTables)
{
_memory = memory;
_lookupTables = lookupTables;
_registerFile = registerFile;
_cpuStack = cpuStack;
}
开发者ID:EntityFX,项目名称:Spectrum,代码行数:7,代码来源:Alu.cs
示例4: PpuMap
public PpuMap(IMemory ram, IMemory chr, VRAMLayout layout)
{
m_ram = ram;
m_chr = chr;
m_palette = new Ram(0xFF);
m_layout = layout;
}
开发者ID:bobbarnes1981,项目名称:NESEmulator,代码行数:7,代码来源:PpuMap.cs
示例5: InternalExecute
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles)
{
cpuState.A = cpuState.PopStack(memory);
cpuState.SetNegativeFlag(cpuState.A);
cpuState.SetZeroFlag(cpuState.A);
cycles = 4;
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:7,代码来源:PLA.cs
示例6: DumpAsText
public static string DumpAsText(IMemory memory)
{
var dumpStringBuilder = new StringBuilder(299320);
dumpStringBuilder.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF");
var ip = 0;
while (ip < memory.Size)
{
int rowStartPointer = ip;
dumpStringBuilder.Append(ip.ToString("X4"));
dumpStringBuilder.Append(" ");
for (int columnIndex = 0; columnIndex < 0x10; columnIndex++)
{
dumpStringBuilder.Append(memory.Raw[rowStartPointer].ToString("X2"));
dumpStringBuilder.Append(' ');
rowStartPointer++;
}
dumpStringBuilder.Append(' ');
rowStartPointer = ip;
for (int columnIndex = 0; columnIndex < 0x10; columnIndex++)
{
dumpStringBuilder.Append(_codePageMap[memory.Raw[rowStartPointer]]);
rowStartPointer++;
}
ip += 0x10;
dumpStringBuilder.AppendLine();
}
return dumpStringBuilder.ToString();
}
开发者ID:EntityFX,项目名称:Spectrum,代码行数:29,代码来源:MemoryDumpHelper.cs
示例7: InternalExecute
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles)
{
var res = (byte)((cpuState.X - 1) & 0xFF);
cpuState.X = res;
cpuState.SetNegativeFlag(res);
cpuState.SetZeroFlag(res);
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:7,代码来源:DEX.cs
示例8: InternalExecute
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles)
{
ushort result = arg;
result <<= 1;
var byteResult = (byte) (result & 0xFF);
write(byteResult);
cpuState.SetNegativeFlag(byteResult);
cpuState.SetZeroFlag(byteResult);
cpuState.SetFlag(CpuState.Flags.Carry, result & 0xFF00);
switch (Variants[memory[cpuState.Pc]])
{
case AddressingMode.Accumulator:
cycles = 2;
break;
case AddressingMode.ZeroPage:
cycles = 5;
break;
case AddressingMode.ZeroPageXIndexed:
cycles = 6;
break;
case AddressingMode.Absolute:
cycles = 6;
break;
case AddressingMode.AbsoluteX:
cycles = 7;
break;
}
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:29,代码来源:ASL.cs
示例9: Patch
public Patch(IMemory memory, IntPtr targetAddress, byte[] replaceWith)
{
_protector = new MemoryPageProtector(new Win32Implementation(), targetAddress, (IntPtr)replaceWith.Length);
_memory = memory;
TargetAddress = targetAddress;
_replaceWith = replaceWith;
}
开发者ID:sgraf812,项目名称:BananaHook,代码行数:7,代码来源:Patch.cs
示例10: Cpu
public Cpu(IMemory memory, IInput input, IOutput output)
{
_memory = memory;
In = input;
Out = output;
Registers = new byte[16];
Commands = new Dictionary<byte, Command>
{
{0x01, new IncCommand(this)},
{0x02, new DecCommand(this)},
{0x03, new MovCommand(this)},
{0x04, new MovcCommand(this)},
{0x05, new LslCommand(this)},
{0x06, new LsrCommand(this)},
{0x07, new JmpCommand(this)},
{0x0A, new JfeCommand(this)},
{0x0B, new RetCommand(this)},
{0x0C, new AddCommand(this)},
{0x0D, new SubCommand(this)},
{0x0E, new XorCommand(this)},
{0x0F, new OrCommand(this)},
{0x10, new InCommand(this)},
{0x11, new OutCommand(this)}
};
}
开发者ID:ramunsk,项目名称:SimpleVM,代码行数:26,代码来源:Cpu.cs
示例11: Execute
public int Execute(CpuState cpuState, IMemory memory)
{
// Addresses are relative to the beginning of the next instruction not
// the beginning of this one, so we'll need to advance the program counter.
cpuState.Pc += 2;
if (ShouldBranch(cpuState, memory))
{
var offset = memory[cpuState.Pc - 1];
ushort newPc;
if ((offset & 0x80) != 0)
{
newPc = (ushort) (cpuState.Pc - (0x100 - offset));
}
else
{
newPc = (ushort)(cpuState.Pc + offset);
}
int cycles = 3;
if ((newPc & 0xFF00) != (cpuState.Pc & 0xFF00))
{
// Extra cycle if the relative branch occurs to cross a page boundary
++cycles;
}
cpuState.Pc = newPc;
return cycles;
}
return 2;
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:31,代码来源:BaseBranchInstruction.cs
示例12: InternalExecute
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, ref int cycles)
{
cpuState.X = arg;
cpuState.SetNegativeFlag(arg);
cpuState.SetZeroFlag(arg);
}
开发者ID:Cyberlane,项目名称:LeetNES,代码行数:7,代码来源:LDX.cs
示例13: Execute
public int Execute(CpuState cpuState, IMemory memory)
{
throw new Exception("die");
cpuState.Interrupt(0xFFFE, memory);
return 7;
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:7,代码来源:BRK.cs
示例14: Int3Hook
public unsafe Int3Hook(IMemory memory, IntPtr targetAddress, IntPtr hookAddress)
: base(memory, targetAddress, new[] { (byte)OpCode.Int3 })
{
_hookAddress = hookAddress;
_notToBeGCed = VectoredHandler;
_handler = AddVectoredExceptionHandler(0, _notToBeGCed);
}
开发者ID:sgraf812,项目名称:BananaHook,代码行数:7,代码来源:Int3Hook.cs
示例15: FrameBuffer8bpp
/// <summary>
/// Initializes a new instance of the <see cref="FrameBuffer8bpp"/> class.
/// </summary>
/// <param name="memory">The memory.</param>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
/// <param name="offset">The offset.</param>
/// <param name="bytesPerLine">The bytes per line.</param>
public FrameBuffer8bpp(IMemory memory, uint width, uint height, uint offset, uint bytesPerLine)
{
this.memory = memory;
this.width = width;
this.height = height;
this.offset = offset;
this.bytesPerLine = bytesPerLine;
}
开发者ID:hj1980,项目名称:Mosa,代码行数:16,代码来源:FrameBuffer8bpp.cs
示例16: FrameBuffer32bpp
/// <summary>
/// Initializes a new instance of the <see cref="FrameBuffer32bpp"/> class.
/// </summary>
/// <param name="memory">The memory.</param>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
/// <param name="offset">The offset.</param>
/// <param name="depth">The depth.</param>
public FrameBuffer32bpp(IMemory memory, uint width, uint height, uint offset, uint depth)
{
this.memory = memory;
this.width = width;
this.height = height;
this.offset = offset;
this.depth = depth;
}
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:16,代码来源:FrameBuffer32bpp.cs
示例17: Interrupt
public void Interrupt(int interruptAddress, IMemory mem)
{
PushStack((byte)(Pc >> 8), mem);
PushStack((byte)(Pc & 0xFF), mem);
PushStack(StatusRegister, mem);
SetFlag(Flags.InterruptDisable, true);
Pc = mem.ReadShort(interruptAddress);
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:8,代码来源:CpuState.cs
示例18: InternalExecute
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles)
{
var breakSet = cpuState.IsFlagSet(CpuState.Flags.Break);
cpuState.StatusRegister = cpuState.PopStack(memory);
cpuState.StatusRegister |= 1 << 5;
cpuState.SetFlag(CpuState.Flags.Break, breakSet);
cycles = 4;
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:8,代码来源:PLP.cs
示例19: Setup
public void Setup()
{
_memory = Substitute.For<IMemory>();
_input = Substitute.For<IInput>();
_output = Substitute.For<IOutput>();
_cpu = new Cpu(_memory, _input, _output);
}
开发者ID:ramunsk,项目名称:SimpleVM,代码行数:8,代码来源:CpuShould.cs
示例20: Execute
public int Execute(CpuState cpuState, IMemory memory)
{
var ret = cpuState.Pc + 2;
cpuState.PushStack((byte)((ret & 0xFF00) >> 8), memory);
cpuState.PushStack((byte) (ret & 0xFF), memory);
cpuState.Pc = memory.ReadShort(cpuState.Pc + 1);
return 6;
}
开发者ID:Dervall,项目名称:LeetNES,代码行数:8,代码来源:JSR.cs
注:本文中的IMemory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论