2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

core: Add support for registering and controlling ownership of CheatEngine

This commit is contained in:
Zach Hilman 2018-12-22 21:32:05 -05:00
parent 769b346682
commit 7053546687
2 changed files with 13 additions and 0 deletions

View file

@ -32,6 +32,7 @@
#include "core/perf_stats.h" #include "core/perf_stats.h"
#include "core/settings.h" #include "core/settings.h"
#include "core/telemetry_session.h" #include "core/telemetry_session.h"
#include "file_sys/cheat_engine.h"
#include "frontend/applets/profile_select.h" #include "frontend/applets/profile_select.h"
#include "frontend/applets/software_keyboard.h" #include "frontend/applets/software_keyboard.h"
#include "frontend/applets/web_browser.h" #include "frontend/applets/web_browser.h"
@ -197,6 +198,7 @@ struct System::Impl {
GDBStub::Shutdown(); GDBStub::Shutdown();
Service::Shutdown(); Service::Shutdown();
service_manager.reset(); service_manager.reset();
cheat_engine.reset();
telemetry_session.reset(); telemetry_session.reset();
gpu_core.reset(); gpu_core.reset();
@ -247,6 +249,8 @@ struct System::Impl {
CpuCoreManager cpu_core_manager; CpuCoreManager cpu_core_manager;
bool is_powered_on = false; bool is_powered_on = false;
std::unique_ptr<FileSys::CheatEngine> cheat_engine;
/// Frontend applets /// Frontend applets
std::unique_ptr<Core::Frontend::ProfileSelectApplet> profile_selector; std::unique_ptr<Core::Frontend::ProfileSelectApplet> profile_selector;
std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet> software_keyboard; std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet> software_keyboard;
@ -445,6 +449,11 @@ Tegra::DebugContext* System::GetGPUDebugContext() const {
return impl->debug_context.get(); return impl->debug_context.get();
} }
void System::RegisterCheatList(const std::vector<FileSys::CheatList>& list,
const std::string& build_id) {
impl->cheat_engine = std::make_unique<FileSys::CheatEngine>(list, build_id);
}
void System::SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs) { void System::SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs) {
impl->virtual_filesystem = std::move(vfs); impl->virtual_filesystem = std::move(vfs);
} }

View file

@ -20,6 +20,7 @@ class WebBrowserApplet;
} // namespace Core::Frontend } // namespace Core::Frontend
namespace FileSys { namespace FileSys {
class CheatList;
class VfsFilesystem; class VfsFilesystem;
} // namespace FileSys } // namespace FileSys
@ -253,6 +254,9 @@ public:
std::shared_ptr<FileSys::VfsFilesystem> GetFilesystem() const; std::shared_ptr<FileSys::VfsFilesystem> GetFilesystem() const;
void RegisterCheatList(const std::vector<FileSys::CheatList>& list,
const std::string& build_id);
void SetProfileSelector(std::unique_ptr<Frontend::ProfileSelectApplet> applet); void SetProfileSelector(std::unique_ptr<Frontend::ProfileSelectApplet> applet);
const Frontend::ProfileSelectApplet& GetProfileSelector() const; const Frontend::ProfileSelectApplet& GetProfileSelector() const;