diff options
author | bunnei <bunneidev@gmail.com> | 2020-11-24 15:16:24 -0800 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-11-24 15:16:24 -0800 |
commit | 5f75d9712540d53ad779babff8edd75627882006 (patch) | |
tree | 859ab2bb7b8350bf2c59cac4c84310a9e8aaff55 /src/core/core.h | |
parent | 7791cc8c2e585dcc377e22a26f548db914250a5d (diff) |
core: loader: Implement support for loading indexed programs.
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 cd155625c1..f642befc02 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(); |