private static void TestPrimary(GameBoyPrimaryOpCode op, Operand o0, Operand o1, OpCode excepted = OpCode.Load, int machineCycles = 2, int throttlingStates = 7) { using (var fixture = new DecodeFixture(machineCycles, throttlingStates, op).OnlyGameboy()) { fixture.Expected.OpCode(excepted).Operands(o0, o1); } }
private static void TestPrimaryNoHalt(GameBoyPrimaryOpCode op, OpCode excepted = OpCode.Load, int machineCycles = 1, int throttlingStates = 4) { using (var fixture = new DecodeFixture(machineCycles, throttlingStates, op).OnlyGameboy().DoNotHalt()) { fixture.Expected.OpCode(excepted); } }
private static void TestWordLiteral16(GameBoyPrimaryOpCode op, Operand o0, Operand o1) { var w = Rng.Word(); using (var fixture = new DecodeFixture(5, 16, op, w).OnlyGameboy()) { fixture.Expected.OpCode(OpCode.Load16).Operands(o0, o1).WordLiteral(w); } }
private static void TestByteLiteral(GameBoyPrimaryOpCode op, Operand o0, Operand o1) { var n = Rng.Byte(); using (var fixture = new DecodeFixture(3, 10, op, n).OnlyGameboy()) { fixture.Expected.OpCode(OpCode.Load).Operands(o0, o1).ByteLiteral(n); } }
private static void TestDisplacedIndex(GameBoyPrimaryOpCode op, Operand o0, Operand o1, int machineCycles = 3, int throttlingStates = 11) { var displacement = Rng.SByte(); using (var fixture = new DecodeFixture(machineCycles, throttlingStates, op, displacement).OnlyGameboy()) { fixture.Expected.OpCode(OpCode.Load16).Operands(o0, o1).Displacement(displacement); } }