summaryrefslogtreecommitdiff
path: root/src/core/core.h
diff options
context:
space:
mode:
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 @@
5#pragma once 5#pragma once
6 6
7#include <cstddef> 7#include <cstddef>
8#include <functional>
8#include <memory> 9#include <memory>
9#include <string> 10#include <string>
10#include <vector> 11#include <vector>
@@ -173,9 +174,11 @@ public:
173 * @param emu_window Reference to the host-system window used for video output and keyboard 174 * @param emu_window Reference to the host-system window used for video output and keyboard
174 * input. 175 * input.
175 * @param filepath String path to the executable application to load on the host file system. 176 * @param filepath String path to the executable application to load on the host file system.
177 * @param program_index Specifies the index within the container of the program to launch.
176 * @returns ResultStatus code, indicating if the operation succeeded. 178 * @returns ResultStatus code, indicating if the operation succeeded.
177 */ 179 */
178 [[nodiscard]] ResultStatus Load(Frontend::EmuWindow& emu_window, const std::string& filepath); 180 [[nodiscard]] ResultStatus Load(Frontend::EmuWindow& emu_window, const std::string& filepath,
181 std::size_t program_index = 0);
179 182
180 /** 183 /**
181 * Indicates if the emulated system is powered on (all subsystems initialized and able to run an 184 * Indicates if the emulated system is powered on (all subsystems initialized and able to run an
@@ -385,6 +388,23 @@ public:
385 /// Tells if system is running on multicore. 388 /// Tells if system is running on multicore.
386 [[nodiscard]] bool IsMulticore() const; 389 [[nodiscard]] bool IsMulticore() const;
387 390
391 /// Type used for the frontend to designate a callback for System to re-launch the application
392 /// using a specified program index.
393 using ExecuteProgramCallback = std::function<void(std::size_t)>;
394
395 /**
396 * Registers a callback from the frontend for System to re-launch the application using a
397 * specified program index.
398 * @param callback Callback from the frontend to relaunch the application.
399 */
400 void RegisterExecuteProgramCallback(ExecuteProgramCallback&& callback);
401
402 /**
403 * Instructs the frontend to re-launch the application using the specified program_index.
404 * @param program_index Specifies the index within the application of the program to launch.
405 */
406 void ExecuteProgram(std::size_t program_index);
407
388private: 408private:
389 System(); 409 System();
390 410