diff options
author | bunnei <bunneidev@gmail.com> | 2020-11-25 00:27:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 00:27:22 +0100 |
commit | 0832da3e4054d0b47c39e95553b5f3be5848eae9 (patch) | |
tree | 1e7688670225c60bbcbc2827cf427a67e1686404 /src/core/core.h | |
parent | hle: services: Fix a crash with improper NVFlinger lifetime management. (#4977) (diff) | |
parent | frontend: yuzu (qt): Register a callback for ExecuteProgram. (diff) | |
download | yuzu-0832da3e4054d0b47c39e95553b5f3be5848eae9.tar yuzu-0832da3e4054d0b47c39e95553b5f3be5848eae9.tar.gz yuzu-0832da3e4054d0b47c39e95553b5f3be5848eae9.tar.bz2 yuzu-0832da3e4054d0b47c39e95553b5f3be5848eae9.tar.lz yuzu-0832da3e4054d0b47c39e95553b5f3be5848eae9.tar.xz yuzu-0832da3e4054d0b47c39e95553b5f3be5848eae9.tar.zst yuzu-0832da3e4054d0b47c39e95553b5f3be5848eae9.zip |
Diffstat (limited to 'src/core/core.h')
-rw-r--r-- | src/core/core.h | 22 |
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(); |