コード例 #1
0
ファイル: ConditionExpression.cs プロジェクト: avdosev/vm
        public bool Evaluate(IReadOnlyMemory memory)
        {
            var leftValue  = LeftOperand.Evaluate(memory).ToInt();
            var rightValue = RightOperand.Evaluate(memory).ToInt();
            var result     = EvaluateExpression(leftValue, rightValue, Operation);

            return(result);
        }
コード例 #2
0
 public static int ByteLength(this IReadOnlyMemory memory)
 {
     if (memory == null)
     {
         throw new ArgumentNullException(nameof(memory));
     }
     return(memory.Length * memory.ElementSize);
 }
コード例 #3
0
        public static bool IsEmpty(this IReadOnlyMemory memory)
        {
            if (memory == null)
            {
                return(true);
            }

            return(memory.ByteLength() == 0);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: GreenOlvi/GBEmuConsole
        private static void PrintMemory(IReadOnlyMemory memory)
        {
            var sb = new StringBuilder();

            for (uint i = 0; i < 16; i++)
            {
                sb.AppendFormat("{0:x2}", memory.GetByte(i));
                sb.Append(" ");
            }
            Console.WriteLine(sb.ToString());
        }
コード例 #5
0
ファイル: Cartridge.cs プロジェクト: GreenOlvi/GBEmuConsole
 public Cartridge(IReadOnlyMemory rom)
 {
     _rom = rom;
 }
コード例 #6
0
ファイル: LuaTString.cs プロジェクト: perstark/HBRelog
 public LuaTString(IReadOnlyMemory memory, IAbsoluteAddress address)
 {
     Address = address;
     _memory = memory;
     _luaTString = memory.Read<LuaTStringHeader>(address);
 }
コード例 #7
0
 public LuaTKey(IReadOnlyMemory memory, LuaTKeyStruct luaTKeyStruct)
 {
     _luaTKeyStruct = luaTKeyStruct;
     _memory = memory;
 }
コード例 #8
0
 internal LuaValue(IReadOnlyMemory memory, LuaValueStruct luaValue)
 {
     _luaValue = luaValue;
     _memory = memory;
 }
コード例 #9
0
 public LuaTValue(IReadOnlyMemory memory, LuaTValueStruct luaTValue)
 {
     _luaTValue = luaTValue;
     _memory = memory;
 }
コード例 #10
0
ファイル: LuaNode.cs プロジェクト: perstark/HBRelog
 public LuaNode(IReadOnlyMemory memory, IAbsoluteAddress address)
 {
     Address = address;
     _memory = memory;
     _luaNode = address.Deref<LuaNodeStruct>();
 }
コード例 #11
0
ファイル: LuaTable.cs プロジェクト: perstark/HBRelog
 public LuaTable(IReadOnlyMemory memory, IAbsoluteAddress address)
 {
     Address = address;
     _memory = memory;
     _luaTable = _memory.Read<LuaTableStuct>(address);
 }
コード例 #12
0
 public Word Evaluate(IReadOnlyMemory _) => Value;
コード例 #13
0
 public Computer(IReadOnlyMemory rom)
 {
     _programEngine = new ProgramEngine(rom);
 }
コード例 #14
0
ファイル: MemoryAdressOperand.cs プロジェクト: avdosev/vm
 public Word Evaluate(IReadOnlyMemory memory) => memory.ReadWord(Value);
コード例 #15
0
 public ProgramEngine(IReadOnlyMemory rom)
 {
     _rom = rom;
 }
コード例 #16
0
 public bool ShouldStop(IReadOnlyMemory memory) => true;
コード例 #17
0
 public new bool ShouldStop(IReadOnlyMemory memory) => Condition.Evaluate(memory);
コード例 #18
0
 public static bool IsEmpty(this IReadOnlyMemory memory)
 {
     return(memory.ByteLength() == 0);
 }