diff options
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 50d5dab4b..bb268a319 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -421,6 +421,7 @@ struct System::Impl { | |||
| 421 | bool is_async_gpu{}; | 421 | bool is_async_gpu{}; |
| 422 | 422 | ||
| 423 | ExecuteProgramCallback execute_program_callback; | 423 | ExecuteProgramCallback execute_program_callback; |
| 424 | ExitCallback exit_callback; | ||
| 424 | 425 | ||
| 425 | std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{}; | 426 | std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{}; |
| 426 | std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_dynarmic{}; | 427 | std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_dynarmic{}; |
| @@ -798,6 +799,18 @@ void System::ExecuteProgram(std::size_t program_index) { | |||
| 798 | } | 799 | } |
| 799 | } | 800 | } |
| 800 | 801 | ||
| 802 | void System::RegisterExitCallback(ExitCallback&& callback) { | ||
| 803 | impl->exit_callback = std::move(callback); | ||
| 804 | } | ||
| 805 | |||
| 806 | void System::Exit() { | ||
| 807 | if (impl->exit_callback) { | ||
| 808 | impl->exit_callback(); | ||
| 809 | } else { | ||
| 810 | LOG_CRITICAL(Core, "exit_callback must be initialized by the frontend"); | ||
| 811 | } | ||
| 812 | } | ||
| 813 | |||
| 801 | void System::ApplySettings() { | 814 | void System::ApplySettings() { |
| 802 | if (IsPoweredOn()) { | 815 | if (IsPoweredOn()) { |
| 803 | Renderer().RefreshBaseSettings(); | 816 | Renderer().RefreshBaseSettings(); |