Exemple #1
0
        public Machine()
        {
            Config.Machine = new ExpandoObject();
            Config.UI      = new ExpandoObject();
            Config.Machine.SystemBootMode = (Int32)BootMode.HLE_IPL;

            m_N64PhysicalMemory = new N64Memory();

            Current   = this;
            DeviceRCP = new RcpProcessor();
            DeviceCPU = new CPUProcessor();
            DevicePIF = new PIFModule();
            MupenHelper.SetMipsCore(DeviceCPU);

            m_CurrentEngine = new SimpleEngine();
            m_CurrentEngine.EngineStatusChanged += m_CurrentEngine_EngineStatusChanged;
        }
Exemple #2
0
        public static void CheckInterrupt()
        {
            Node evt;

            RcpProcessor rcp = Machine.Current.DeviceRCP;

            if ((MI_INTR_REG & MI_INTR_MASK_REG) != 0)
            {
                CP0_CAUSE_REG = (CP0_CAUSE_REG | 0x400);
            }
            else
            {
                CP0_CAUSE_REG &= ~0x400UL;
            }

            if ((CP0_STATUS_REG & 7) != 1)
            {
                return;
            }

            if ((CP0_STATUS_REG & CP0_CAUSE_REG & 0xFF00) != 0)
            {
                evt = AllocNode(m_Q.Pool);

                if (evt == null)
                {
                    throw new InvalidOperationException("Mupen Error: Failed to allocate node for new interrupt");
                }

                evt.Data.Count = CP0_COUNT_REG;
                NextInterrupt  = CP0_COUNT_REG;
                evt.Data.Type  = CHECK_INT;

                if (m_Q.First == null)
                {
                    m_Q.First = evt;
                    evt.Next  = null;
                }
                else
                {
                    evt.Next  = m_Q.First;
                    m_Q.First = evt;
                }
            }
        }