Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        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);
                }
            }
        }