Example #1
0
        private void RuntimeThread()
        {
            try
            {
                if (_switchToXmb == true)
                {
                    this.SwitchToXmb();
                }

                if (_video != null)
                {
                    _video.Resume();
                }

                while (_shutDown == false)
                {
                    switch (_state)
                    {
                    case InstanceState.Ended:
                    case InstanceState.Idle:
                    case InstanceState.Paused:
                    case InstanceState.Crashed:
                        _stateChangeEvent.WaitOne();
                        break;

                    case InstanceState.Debugging:
                        // TODO: debugging runtime loop code
                        break;

                    case InstanceState.Running:
                        while (_bios.Game == null)
                        {
                            // Wait for a game to get set
                            _bios.WaitUntilLoaded();
                        }
                        // Run the kernel
                        _bios.Execute();
                        break;
                    }
                }
            }
            catch (ThreadAbortException)
            {
            }
            catch (ThreadInterruptedException)
            {
            }
        }
Example #2
0
        private void RuntimeThread()
        {
            try
            {
                if (_switchToXmb == true)
                {
                    this.SwitchToXmb();
                }

                while (_shutDown == false)
                {
                    switch (_state)
                    {
                    case InstanceState.Ended:
                    case InstanceState.Idle:
                    case InstanceState.Paused:
                    case InstanceState.Crashed:
                        _stateChangeEvent.WaitOne();
                        break;

                    case InstanceState.Debugging:
                        // TODO: debugging runtime loop code
                        break;

                    case InstanceState.Running:
                        Debug.Assert(_bios.Game != null);
                        if (_bios.Game != null)
                        {
                            // Run the kernel
                            _bios.Execute();
                        }
                        break;
                    }
                }
            }
            catch (ThreadAbortException)
            {
            }
            catch (ThreadInterruptedException)
            {
            }
        }