From 33f8284bc0f80b18bdce6f8e9a363f5b70388788 Mon Sep 17 00:00:00 2001
From: Mary <me@thog.eu>
Date: Mon, 21 Sep 2020 05:45:30 +0200
Subject: hle/ui: Basic multi programs support (#1560)

* hos/gui: Add a check of NCA program index in titleid

This add a check to `ApplicationLoader` for the last 2 digits of the game TitleId who seems to be the NCA program index.
We currently return the last index, instead of the lower one.
Same check is added to ApplicationLibrary in the UI.

I've cleaned up both file too.

* hle: implement partial relaunch logic

TODO: make the emulator auto relauch.

* Handle auto relaunch

* hle: Unify update usage system

* hle: Implement support of multi programs in update system

* Add some documentation

* Address rip's comment

Co-authored-by: Ac_K <Acoustik666@gmail.com>
---
 Ryujinx/Ui/GtkHostUiHandler.cs | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'Ryujinx/Ui/GtkHostUiHandler.cs')

diff --git a/Ryujinx/Ui/GtkHostUiHandler.cs b/Ryujinx/Ui/GtkHostUiHandler.cs
index 90830056..fd193dd7 100644
--- a/Ryujinx/Ui/GtkHostUiHandler.cs
+++ b/Ryujinx/Ui/GtkHostUiHandler.cs
@@ -2,6 +2,7 @@ using Gtk;
 using Ryujinx.Common.Logging;
 using Ryujinx.HLE;
 using Ryujinx.HLE.HOS.Applets;
+using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
 using System;
 using System.Threading;
 
@@ -121,5 +122,11 @@ namespace Ryujinx.Ui
 
             return error || okPressed;
         }
+
+        public void ExecuteProgram(HLE.Switch device, ProgramSpecifyKind kind, ulong value)
+        {
+            device.UserChannelPersistence.ExecuteProgram(kind, value);
+            MainWindow.GlWidget?.Exit();
+        }
     }
 }
-- 
cgit v1.2.3-70-g09d2