summaryrefslogtreecommitdiffstats
path: root/src/core/core.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-11-25 00:16:24 +0100
committerbunnei <bunneidev@gmail.com>2020-11-25 00:16:24 +0100
commit5f75d9712540d53ad779babff8edd75627882006 (patch)
tree859ab2bb7b8350bf2c59cac4c84310a9e8aaff55 /src/core/core.h
parenthle: services: Fix a crash with improper NVFlinger lifetime management. (#4977) (diff)
downloadyuzu-5f75d9712540d53ad779babff8edd75627882006.tar
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.gz
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.bz2
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.lz
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.xz
yuzu-5f75d9712540d53ad779babff8edd75627882006.tar.zst
yuzu-5f75d9712540d53ad779babff8edd75627882006.zip
Diffstat (limited to 'src/core/core.h')
-rw-r--r--src/core/core.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/core.h b/src/core/core.h
index cd155625c..f642befc0 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -5,6 +5,7 @@
#pragma once
#include <cstddef>
+#include <functional>
#include <memory>
#include <string>
#include <vector>
@@ -173,9 +174,11 @@ public:
* @param emu_window Reference to the host-system window used for video output and keyboard
* input.
* @param filepath String path to the executable application to load on the host file system.
+ * @param program_index Specifies the index within the container of the program to launch.
* @returns ResultStatus code, indicating if the operation succeeded.
*/
- [[nodiscard]] ResultStatus Load(Frontend::EmuWindow& emu_window, const std::string& filepath);
+ [[nodiscard]] ResultStatus Load(Frontend::EmuWindow& emu_window, const std::string& filepath,
+ std::size_t program_index = 0);
/**
* Indicates if the emulated system is powered on (all subsystems initialized and able to run an
@@ -385,6 +388,23 @@ public:
/// Tells if system is running on multicore.
[[nodiscard]] bool IsMulticore() const;
+ /// Type used for the frontend to designate a callback for System to re-launch the application
+ /// using a specified program index.
+ using ExecuteProgramCallback = std::function<void(std::size_t)>;
+
+ /**
+ * Registers a callback from the frontend for System to re-launch the application using a
+ * specified program index.
+ * @param callback Callback from the frontend to relaunch the application.
+ */
+ void RegisterExecuteProgramCallback(ExecuteProgramCallback&& callback);
+
+ /**
+ * Instructs the frontend to re-launch the application using the specified program_index.
+ * @param program_index Specifies the index within the application of the program to launch.
+ */
+ void ExecuteProgram(std::size_t program_index);
+
private:
System();