示例#1
0
        public IIRQRead m_int_read;         // opcode reader for IM2 interrupt handling

        /// <summary>
        /// Creates Z80 CPU emulation class
        /// </summary>
        /// <param name="memory">Memory access provider class</param>
        /// <param name="inputOutputPortPorts">IO provider class</param>
        /// <param name="irqRead">Interrupt provider for IM2 mode</param>
        /// <param name="reset">True for reset the CPU after creating</param>
        public Z80(IZ80Memory memory, IZ80Port inputOutputPortPorts, IIRQRead irqRead, bool reset = true)
        {
            m_memory = memory;
            m_memory?.SetCPU(this);

            m_ports = inputOutputPortPorts;
            m_ports?.SetCPU(this);

            m_int_read = irqRead;

            m_registers = new Z80Registers();

            InitializeOpcodes();
            if (reset)
            {
                Reset();
            }
        }
示例#2
0
 /// <summary>
 /// Sets/ changes port acces provider
 /// </summary>
 /// <param name="in_ports"></param>
 public void SetPorts(IZ80Port in_ports)
 {
     m_ports = in_ports;
     m_ports.SetCPU(this);
 }