summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
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.cpp
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.cpp')
-rw-r--r--src/core/core.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 1aa477a29..7ca3652af 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -145,7 +145,7 @@ struct System::Impl {
}
ResultStatus Init(System& system, Frontend::EmuWindow& emu_window) {
- LOG_DEBUG(HW_Memory, "initialized OK");
+ LOG_DEBUG(Core, "initialized OK");
device_memory = std::make_unique<Core::DeviceMemory>();
@@ -208,9 +208,11 @@ struct System::Impl {
return ResultStatus::Success;
}
- ResultStatus Load(System& system, Frontend::EmuWindow& emu_window,
- const std::string& filepath) {
- app_loader = Loader::GetLoader(system, GetGameFileFromPath(virtual_filesystem, filepath));
+ ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, const std::string& filepath,
+ std::size_t program_index) {
+ app_loader = Loader::GetLoader(system, GetGameFileFromPath(virtual_filesystem, filepath),
+ program_index);
+
if (!app_loader) {
LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath);
return ResultStatus::ErrorGetLoader;
@@ -416,6 +418,8 @@ struct System::Impl {
bool is_multicore{};
bool is_async_gpu{};
+ ExecuteProgramCallback execute_program_callback;
+
std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{};
std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_dynarmic{};
};
@@ -451,8 +455,9 @@ void System::Shutdown() {
impl->Shutdown();
}
-System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath) {
- return impl->Load(*this, emu_window, filepath);
+System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath,
+ std::size_t program_index) {
+ return impl->Load(*this, emu_window, filepath, program_index);
}
bool System::IsPoweredOn() const {
@@ -789,4 +794,16 @@ bool System::IsMulticore() const {
return impl->is_multicore;
}
+void System::RegisterExecuteProgramCallback(ExecuteProgramCallback&& callback) {
+ impl->execute_program_callback = std::move(callback);
+}
+
+void System::ExecuteProgram(std::size_t program_index) {
+ if (impl->execute_program_callback) {
+ impl->execute_program_callback(program_index);
+ } else {
+ LOG_CRITICAL(Core, "execute_program_callback must be initialized by the frontend");
+ }
+}
+
} // namespace Core