Esempio n. 1
0
        public CpuRunner(MainWindowViewModel mainWindowViewModel, Chip8Cpu cpu, Display display)
        {
            _display = display;
            _cpu = cpu;
            _mainWindowViewModel = mainWindowViewModel;
            _stopwatch = new Stopwatch();
            _displayAdapter = new DisplayAdapter();

            _cancellationTokenSource = new CancellationTokenSource();
        }
Esempio n. 2
0
 public void SetUp()
 {
     _display = new Display();
 }
Esempio n. 3
0
        private void CreateCpu(byte[] buffer)
        {
            var display = new Display();
            var randomizer = new Randomizer();
            var wpfKeyboard = new WpfKeyboard(View);
            var bcdConverter = new BcdConverter();
            var instructionDecoder = new InstructionDecoder();
            var timerClock = new TimerClock();

            var chip8Cpu = new Chip8Cpu(display, randomizer, wpfKeyboard, bcdConverter, instructionDecoder, timerClock);

            Array.Copy(buffer, 0, chip8Cpu.State.Memory, 0x200, buffer.Length);
            chip8Cpu.State.ProgramCounter = 0x200;

            _cpuRunner = new CpuRunner(this, chip8Cpu, display);
            _cpuRunner.Start();
        }