private static void Test(PrimaryOpCode op, FlagTest test = FlagTest.None, bool gameBoy = true) { var literal = Rng.Word(); using (var fixture = new DecodeFixture(3, 10, op, literal).DoNotHalt()) { if (!gameBoy) { fixture.NotOnGameboy(); } fixture.Expected.OpCode(OpCode.Jump).Operands(Operand.nn).WordLiteral(literal); if (test != FlagTest.None) { fixture.Expected.FlagTest(test); } } }
private static void TestRelative(PrimaryOpCode op, FlagTest test = FlagTest.None, bool gameBoy = true) { var literal = Rng.SByte(); var(machineCycles, throttlingStates) = test == FlagTest.None ? (3, 12) : (2, 7); using (var fixture = new DecodeFixture(machineCycles, throttlingStates, op, literal).DoNotHalt()) { if (!gameBoy) { fixture.NotOnGameboy(); } fixture.Expected.OpCode(OpCode.JumpRelative).Displacement(literal); if (test != FlagTest.None) { fixture.Expected.FlagTest(test); } } }