Пример #1
0
        private void End(HLE.Switch device)
        {
#if USE_DEBUGGING
            _debugger.Dispose();
#endif

            if (_ending)
            {
                return;
            }

            _ending = true;

            if (device != null)
            {
                UpdateGameMetadata(device.System.TitleIdText);

                if (_gLWidget != null)
                {
                    // We tell the widget that we are exiting
                    _gLWidget.Exit();

                    // Wait for the other thread to dispose the HLE context before exiting.
                    _deviceExitStatus.WaitOne();
                }
            }

            Dispose();

            Profile.FinishProfiling();
            DiscordIntegrationModule.Exit();
            Logger.Shutdown();
            Application.Quit();
        }
Пример #2
0
        private void CreateGameWindow(HLE.Switch device)
        {
            device.Hid.InitializePrimaryController(ConfigurationState.Instance.Hid.ControllerType);

            _gLWidget = new GLRenderer(_emulationContext);

            Application.Invoke(delegate
            {
                _viewBox.Remove(_gameTableWindow);
                _gLWidget.Expand = true;
                _viewBox.Child   = _gLWidget;

                _gLWidget.ShowAll();
                EditFooterForGameRender();
            });

            _gLWidget.WaitEvent.WaitOne();

            _gLWidget.Start();

            device.Dispose();
            _deviceExitStatus.Set();

            // NOTE: Everything that is here will not be executed when you close the UI.
            Application.Invoke(delegate
            {
                _viewBox.Remove(_gLWidget);
                _gLWidget.Exit();

                if (_gLWidget.Window != this.Window && _gLWidget.Window != null)
                {
                    _gLWidget.Window.Dispose();
                }

                _gLWidget.Dispose();

                _viewBox.Add(_gameTableWindow);

                _gameTableWindow.Expand = true;

                this.Window.Title = $"Ryujinx {Program.Version}";

                _emulationContext = null;
                _gameLoaded       = false;
                _gLWidget         = null;

                DiscordIntegrationModule.SwitchToMainMenu();

                RecreateFooterForMenu();

                UpdateColumns();
                UpdateGameTable();

                Task.Run(RefreshFirmwareLabel);

                _stopEmulation.Sensitive            = false;
                _firmwareInstallFile.Sensitive      = true;
                _firmwareInstallDirectory.Sensitive = true;
            });
        }
Пример #3
0
        private void End(HLE.Switch device)
        {
#if USE_DEBUGGING
            _debugger.Dispose();
#endif

            if (_ending)
            {
                return;
            }

            _ending = true;

            if (device != null)
            {
                UpdateGameMetadata(device.System.TitleIdText);

                if (_gLWidget != null)
                {
                    _gLWidget.Exit();
                    _screenExitStatus.WaitOne();
                }
            }

            Dispose();

            Profile.FinishProfiling();
            DiscordIntegrationModule.Exit();
            Logger.Shutdown();
            Application.Quit();
        }
Пример #4
0
 private void StopEmulation_Pressed(object sender, EventArgs args)
 {
     _gLWidget?.Exit();
 }
Пример #5
0
        private void CreateGameWindow(HLE.Switch device)
        {
            ControllerType type = (Ryujinx.Configuration.Hid.ControllerType)ConfigurationState.Instance.Hid.ControllerType switch {
                Ryujinx.Configuration.Hid.ControllerType.ProController => ControllerType.ProController,
                Ryujinx.Configuration.Hid.ControllerType.Handheld => ControllerType.Handheld,
                Ryujinx.Configuration.Hid.ControllerType.NpadPair => ControllerType.JoyconPair,
                Ryujinx.Configuration.Hid.ControllerType.NpadLeft => ControllerType.JoyconLeft,
                Ryujinx.Configuration.Hid.ControllerType.NpadRight => ControllerType.JoyconRight,
                _ => ControllerType.Handheld
            };

            device.Hid.Npads.AddControllers(new ControllerConfig {
                PlayerId = HidControllerID.Player1,
                Type     = type
            });

            _gLWidget = new GLRenderer(_emulationContext);

            Application.Invoke(delegate
            {
                _viewBox.Remove(_gameTableWindow);
                _gLWidget.Expand = true;
                _viewBox.Child   = _gLWidget;

                _gLWidget.ShowAll();
                EditFooterForGameRender();
            });

            _gLWidget.WaitEvent.WaitOne();

            _gLWidget.Start();

            device.Dispose();
            _deviceExitStatus.Set();

            // NOTE: Everything that is here will not be executed when you close the UI.
            Application.Invoke(delegate
            {
                _viewBox.Remove(_gLWidget);
                _gLWidget.Exit();

                if (_gLWidget.Window != this.Window && _gLWidget.Window != null)
                {
                    _gLWidget.Window.Dispose();
                }

                _gLWidget.Dispose();

                _viewBox.Add(_gameTableWindow);

                _gameTableWindow.Expand = true;

                this.Window.Title = $"Ryujinx {Program.Version}";

                _emulationContext = null;
                _gameLoaded       = false;
                _gLWidget         = null;

                DiscordIntegrationModule.SwitchToMainMenu();

                RecreateFooterForMenu();

                UpdateColumns();
                UpdateGameTable();

                Task.Run(RefreshFirmwareLabel);

                _stopEmulation.Sensitive            = false;
                _firmwareInstallFile.Sensitive      = true;
                _firmwareInstallDirectory.Sensitive = true;
            });
        }
Пример #6
0
        private void CreateGameWindow(HLE.Switch device)
        {
            device.Hid.InitializePrimaryController(ConfigurationState.Instance.Hid.ControllerType);

            _gLWidget?.Exit();
            _gLWidget?.Dispose();
            _gLWidget = new GLRenderer(_emulationContext);

            Application.Invoke(delegate
            {
                _viewBox.Remove(_gameTableWindow);
                _gLWidget.Expand = true;
                _viewBox.Child   = _gLWidget;

                _gLWidget.ShowAll();
                _listStatusBox.Hide();
            });

            _gLWidget.WaitEvent.WaitOne();

            _gLWidget.Start();

            Application.Invoke(delegate
            {
                _viewBox.Remove(_gLWidget);
                _gLWidget.Exit();

                if (_gLWidget.Window != this.Window && _gLWidget.Window != null)
                {
                    _gLWidget.Window.Dispose();
                }

                _viewBox.Add(_gameTableWindow);

                _gameTableWindow.Expand = true;

                this.Window.Title = "Ryujinx";

                _listStatusBox.ShowAll();

                UpdateColumns();
                UpdateGameTable();

                Task.Run(RefreshFirmwareLabel);
            });

            device.Dispose();

            _emulationContext = null;
            _gameLoaded       = false;
            _gLWidget         = null;

            DiscordIntegrationModule.SwitchToMainMenu();

            Application.Invoke(delegate
            {
                _stopEmulation.Sensitive            = false;
                _firmwareInstallFile.Sensitive      = true;
                _firmwareInstallDirectory.Sensitive = true;
            });

            _screenExitStatus.Set();
        }