Beispiel #1
0
        public MainEmulator()
        {
            _memoryMapper = new MemoryMapper();
            _portMapper   = new PortMapper();
            _cpu          = new Z80 {
                MemProvider = _memoryMapper, PortProvider = _portMapper
            };

            _graphics = new Graphics();
            _memoryMapper.Register(0x1000, 0x1fff, _graphics, true, false);
            _portMapper.Register(5, 7, _graphics);

            _ram = new Ram();
            _memoryMapper.Register(0, 0xffff, _ram, true, true);
            _portMapper.Register(0, 0, _ram);

            _tickCounter = new TickCounter(_cancellationTokenSource.Token);
            _portMapper.Register(130, 133, _tickCounter);

            _diskController = new DiskController(_memoryMapper, () => _cpu.Reset());
            _portMapper.Register(160, 169, _diskController);

            _serial = new Serial(_memoryMapper);
            _portMapper.Register(170, 179, _serial);

            _led = new Led();
            _portMapper.Register(3, 3, _led);

            _speaker = new Speaker();
            _portMapper.Register(4, 4, _speaker);

            _keyboard = new Keyboard();
            _portMapper.Register(128, 129, _keyboard);

            //FBootLoader = new BootLoader(FMemoryMapper);

            _memoryMapper.FinishRegistration();

            OriginalSpeed = true;
        }
Beispiel #2
0
        public MainEmulator()
        {
            _memoryMapper = new MemoryMapper();
            _portMapper = new PortMapper();
            _cpu = new Z80 { MemProvider = _memoryMapper, PortProvider = _portMapper };

            _graphics = new Graphics();
            _memoryMapper.Register(0x1000, 0x1fff, _graphics, true, false);
            _portMapper.Register(5, 7, _graphics);

            _ram = new Ram();
            _memoryMapper.Register(0, 0xffff, _ram, true, true);
            _portMapper.Register(0, 0, _ram);

            _tickCounter = new TickCounter(_cancellationTokenSource.Token);
            _portMapper.Register(130, 133, _tickCounter);

            _diskController = new DiskController(_memoryMapper, () => _cpu.Reset());
            _portMapper.Register(160, 169, _diskController);

            _serial = new Serial(_memoryMapper);
            _portMapper.Register(170, 179, _serial);

            _led = new Led();
            _portMapper.Register(3, 3, _led);

            _speaker = new Speaker();
            _portMapper.Register(4, 4, _speaker);

            _keyboard = new Keyboard();
            _portMapper.Register(128, 129, _keyboard);

            //FBootLoader = new BootLoader(FMemoryMapper);

            _memoryMapper.FinishRegistration();

            OriginalSpeed = true;
        }