/// <summary> /// Initializes a new instance of the <see cref="CpuCoreBase" /> class. /// </summary> /// <param name="registers">The registers.</param> /// <param name="interruptManager">The interrupt manager.</param> /// <param name="peripheralManager">The peripheral manager.</param> /// <param name="mmu">The mmu.</param> /// <param name="instructionTimer">The instruction timer.</param> /// <param name="alu">The alu.</param> /// <param name="opCodeDecoder">The opcode decoder.</param> /// <param name="instructionBlockFactory">The instruction block decoder.</param> /// <param name="dmaController">The dma controller.</param> /// <param name="messageBus">The message bus.</param> /// <param name="requireInstructionBlockCaching">if set to <c>true</c> [require instruction block caching].</param> /// <exception cref="ArgumentException">Instruction block decoder must support caching</exception> protected CpuCoreBase(IRegisters registers, IInterruptManager interruptManager, IPeripheralManager peripheralManager, IMmu mmu, IInstructionTimer instructionTimer, IAlu alu, IOpCodeDecoder opCodeDecoder, IInstructionBlockFactory instructionBlockFactory, IDmaController dmaController, IMessageBus messageBus, bool requireInstructionBlockCaching) { CoreId = Guid.NewGuid(); _registers = registers; _interruptManager = interruptManager; _peripheralManager = peripheralManager; _mmu = mmu; _instructionTimer = instructionTimer; _alu = alu; _opCodeDecoder = opCodeDecoder; _instructionBlockFactory = instructionBlockFactory; _dmaController = dmaController; _messageBus = messageBus; messageBus.RegisterHandler(Message.PauseCpu, Pause); messageBus.RegisterHandler(Message.ResumeCpu, Resume); if (requireInstructionBlockCaching && !_instructionBlockFactory.SupportsInstructionBlockCaching) { throw new ArgumentException("Instruction block decoder must support caching"); } }
/// <summary> /// Initializes a new instance of the <see cref="CpuCore" /> class. /// </summary> /// <param name="registers">The registers.</param> /// <param name="interruptManager">The interrupt manager.</param> /// <param name="peripheralManager">The peripheral manager.</param> /// <param name="mmu">The mmu.</param> /// <param name="instructionTimer">The instruction timer.</param> /// <param name="alu">The alu.</param> /// <param name="opCodeDecoder">The opcode decoder.</param> /// <param name="instructionBlockFactory">The instruction block decoder.</param> /// <param name="dmaController">The dma controller.</param> /// <param name="messageBus">The message bus.</param> public CpuCore(IRegisters registers, IInterruptManager interruptManager, IPeripheralManager peripheralManager, IMmu mmu, IInstructionTimer instructionTimer, IAlu alu, IOpCodeDecoder opCodeDecoder, IInstructionBlockFactory instructionBlockFactory, IDmaController dmaController, IMessageBus messageBus) : base(registers, interruptManager, peripheralManager, mmu, instructionTimer, alu, opCodeDecoder, instructionBlockFactory, dmaController, messageBus, false) { }
/// <summary> /// Initializes a new instance of the <see cref="InterruptFlagsRegister"/> class. /// </summary> /// <param name="interruptManager">The interrupt manager.</param> /// <param name="interruptEnableRegister">The interrupt enable register.</param> public InterruptFlagsRegister(IInterruptManager interruptManager, IInterruptEnableRegister interruptEnableRegister) { _interruptManager = interruptManager; _interruptEnableRegister = interruptEnableRegister; _interruptFlag = InterruptFlag.None; }