public void TestInterpreter() { var ExecuteStep = Chip8Interpreter.CreateExecuteStep(); var CpuContext = new CpuContext(new SimpleFastMemory4BigEndian(12), new Display(), new Syscall(), new Controller()); var Instructions = new ushort[] { 0x70FF, 0x7102, 0x7103, }; CpuContext.PC = 0; foreach (var Instruction in Instructions) { CpuContext.WriteInstruction(Instruction); } CpuContext.PC = 0; Assert.AreEqual(0, CpuContext.PC); Assert.AreEqual(0x00, CpuContext.V[0]); Assert.AreEqual(0x00, CpuContext.V[1]); { for (int n = 0; n < Instructions.Length; n++) { ExecuteStep(CpuContext.ReadInstruction, CpuContext); } } Assert.AreEqual(Instructions.Length * 2, CpuContext.PC); Assert.AreEqual(0xFF, CpuContext.V[0]); Assert.AreEqual(0x05, CpuContext.V[1]); }