예제 #1
0
        public void OnFetchWillReturnFetchedValue()
        {
            ushort absoluteAddress = 0x1944;

            cpu.AbsoluteAddress = absoluteAddress;

            byte fetchedValue         = 0x52;
            byte startingFetchedValue = 0xd1;

            cpu.Fetched = startingFetchedValue;

            A.CallTo(() => cpu.Read(absoluteAddress)).Returns(fetchedValue);

            var fetchResult = addressMode.Fetch();

            VerifyFetchResult(fetchResult, fetchedValue, startingFetchedValue);
        }
예제 #2
0
        protected AddressModeTests()
        {
            cpu = A.Fake <ICpu>();

            cpu.ProgramCounter = ProgramCounter;

            A.CallTo(() => cpu.Read(ProgramCounter)).Returns(ReadValue);
        }
예제 #3
0
        protected byte ReadFromStack()
        {
            cpu.StackPointer++;

            return(cpu.Read((ushort)(0x0100 + cpu.StackPointer)));
        }