Пример #1
0
        public Chip8Cpu(IDisplay display, IRandomizer randomizer, IKeyboard keyboard, IBcdConverter bcdConverter, IInstructionDecoder instructionDecoder, ITimerClock timerClock)
        {
            _display = display;
            _randomizer = randomizer;
            _keyboard = keyboard;
            _bcdConverter = bcdConverter;
            _instructionDecoder = instructionDecoder;
            _timerClock = timerClock;

            State = new CpuState();
        }
Пример #2
0
 public void SetUp()
 {
     _cpuState = new CpuState();
 }
Пример #3
0
        private void AssertHexadecimalDigit(byte[] digit, int memoryLocation)
        {
            var state = new CpuState();

            for (var i = 0; i < digit.Length; i++)
            {
                var offset = (short)(memoryLocation + i);
                state.Memory[offset].Should().Be(digit[i]);
            }
        }