예제 #1
0
 public MockCpuDebug(
     ICpuHoldEvent debuggerSyncEvent,
     ICpuStepEvent debuggerStepEvent)
 {
     _debuggerStepEvent = debuggerStepEvent;
     _debuggerSyncEvent = debuggerSyncEvent;
 }
예제 #2
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             = _serviceProvider.GetService <ICpuHoldEvent>();
            _cpuStepEvent             = _serviceProvider.GetService <ICpuStepEvent>();
            _cancellationTokenWrapper = _serviceProvider.GetService <CancellationTokenWrapper>();
            _cancellationTokenWrapper.Reset();
        }
예제 #3
0
 public Parser(
     IDebuggableCpu cpuDebug,
     IAddressMap addressMap,
     ILabelMap labels,
     ILogFormatter formatter,
     ICpuHoldEvent debuggerSyncEvent,
     ICpuStepEvent debuggerStepEvent,
     ILogger <Parser> logger,
     IRegisterTracker tracker)
 {
     _cpuDebug          = cpuDebug;
     _addressMap        = addressMap;
     _labels            = labels;
     _formatter         = formatter;
     _debuggerSyncEvent = debuggerSyncEvent;
     _debuggerStepEvent = debuggerStepEvent;
     _logger            = logger;
     _tracker           = tracker;
 }