DCPU-16 Computer class
Esempio n. 1
0
        /// <summary>
        /// OnCpuError
        /// 
        /// Called on DCPU-16 Error
        /// </summary>
        /// <param name="_cpu">Reference to existing DCPU-16 object</param>
        protected void OnCpuError(ref CDCPU16 _cpu)
        {
            if (_cpu == null) return;

        }
Esempio n. 2
0
        //----------------------------------------------------------
        // On Events
        //----------------------------------------------------------
        // TODO: test to ensure thread safety! 

        /// <summary>
        /// OnCpuExecutePostStep
        /// 
        /// Called after execution of DCPU-16 instruction. 
        /// </summary>
        /// <param name="_cpu">Reference to existing DCPU-16 object</param>
        protected void OnCpuExecutePostStep(ref CDCPU16 _cpu)
        {
            if (_cpu == null) return;

            if (m_MakeCpuDoublebuffer != false)
            {
                lock (m_CpuDoublebuffer)
                {
                    
                    // make a copy of ram. 
                    Array.Copy(_cpu.Memory.RAM, m_CpuDoublebuffer.Memory.RAM, 0x10000);
                    Array.Copy(_cpu.Registers.GP, m_CpuDoublebuffer.Registers.GP, 8);

                    m_CpuDoublebuffer.Registers.O = _cpu.Registers.O;
                    m_CpuDoublebuffer.Registers.PC = _cpu.Registers.PC;
                    m_CpuDoublebuffer.Registers.SP = _cpu.Registers.SP;
                    m_CpuDoublebuffer.CycleCount = _cpu.CycleCount;

                    m_MakeCpuDoublebuffer = false;
                }
            }          
        }