コード例 #1
0
        public void Setup()
        {
            _logger = (UnitTestLogger <CPU6502>)_serviceProvider.GetService <ILogger <CPU6502> >();
            _logger.GetOutput(); // Clear any buffered output

            mem = _serviceProvider.GetService <IAddressMap>();
            mem.Install(new Ram(0x0000, 0x10000));

            _display = _serviceProvider.GetService <IMemoryMappedDisplay>();
            _display.Locate(DISPLAY_BASE_ADDR, DISPLAY_SIZE);
            mem.Install(_display);
            AsyncUtil.RunSync(mem.Initialise);
            _display.Clear();
            _cpu          = (CPU6502)_serviceProvider.GetService <IDebuggableCpu>();
            _cpu.LogLevel = LogLevel.Trace;
            mem.WriteWord(_cpu.RESET_VECTOR, PROG_START);
            mem.Labels.Clear();
            mem.Labels.Add("DISPLAY_CONTROL_ADDR", MemoryMappedDisplay.DISPLAY_CONTROL_BLOCK_ADDR);
            mem.Labels.Add("DISPLAY_BASE_ADDR", DISPLAY_BASE_ADDR);
            mem.Labels.Add("DISPLAY_SIZE", DISPLAY_SIZE);
            mem.Labels.Add("RESET_VECTOR", _cpu.RESET_VECTOR);
            mem.Labels.Add("IRQ_VECTOR", _cpu.IRQ_VECTOR);
            mem.Labels.Add("NMI_VECTOR", _cpu.NMI_VECTOR);
            _cpuHoldEvent = (MockCpuHoldEvent)_serviceProvider.GetService <ICpuHoldEvent>();
            _cpuStepEvent = (MockCpuStepEvent)_serviceProvider.GetService <ICpuStepEvent>();
            _cpuHoldEvent.Init();
            _cpuStepEvent.Init();
            _cancellationTokenWrapper = _serviceProvider.GetService <CancellationTokenWrapper>();
            _cancellationTokenWrapper.Reset();
        }
コード例 #2
0
        public void Setup()
        {
            _cpuDebug   = _serviceProvider.GetService <IDebuggableCpu>();
            _addressMap = _serviceProvider.GetService <IAddressMap>();
            AsyncUtil.RunSync(_addressMap.Initialise);

            _labels = _serviceProvider.GetService <ILabelMap>();
            _labels.Clear();
            _logFormatter = _serviceProvider.GetService <ILogFormatter>();
            _parser       = _serviceProvider.GetService <IParser>();
            _logger       = (UnitTestLogger <Parser>)_serviceProvider.GetService <ILogger <Parser> >();
            _cpuDebug.Breakpoints.Clear();
            _cpuHoldEvent = (MockCpuHoldEvent)_serviceProvider.GetService <ICpuHoldEvent>();
            _cpuStepEvent = (MockCpuStepEvent)_serviceProvider.GetService <ICpuStepEvent>();
            _cpuHoldEvent.Init();
            _cpuStepEvent.Init();
            _logger.GetOutput(); // Flush any old content
        }