core: Update RegisterCheatList for new VM

This commit is contained in:
Zach Hilman 2019-05-30 19:36:18 -04:00
parent a0055192fe
commit 37850eeee5
2 changed files with 16 additions and 11 deletions

View file

@ -37,6 +37,7 @@
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h" #include "core/hle/service/sm/sm.h"
#include "core/loader/loader.h" #include "core/loader/loader.h"
#include "core/memory/cheat_engine.h"
#include "core/perf_stats.h" #include "core/perf_stats.h"
#include "core/reporter.h" #include "core/reporter.h"
#include "core/settings.h" #include "core/settings.h"
@ -329,7 +330,7 @@ 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; std::unique_ptr<Memory::CheatEngine> cheat_engine;
std::unique_ptr<Tools::Freezer> memory_freezer; std::unique_ptr<Tools::Freezer> memory_freezer;
/// Frontend applets /// Frontend applets
@ -544,13 +545,6 @@ 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, VAddr code_region_start,
VAddr code_region_end) {
impl->cheat_engine = std::make_unique<FileSys::CheatEngine>(*this, list, build_id,
code_region_start, code_region_end);
}
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);
} }
@ -559,6 +553,13 @@ std::shared_ptr<FileSys::VfsFilesystem> System::GetFilesystem() const {
return impl->virtual_filesystem; return impl->virtual_filesystem;
} }
void System::RegisterCheatList(const std::vector<Memory::CheatEntry>& list,
const std::array<u8, 32>& build_id, VAddr main_region_begin,
u64 main_region_size) {
impl->cheat_engine = std::make_unique<Memory::CheatEngine>(*this, list, build_id);
impl->cheat_engine->SetMainMemoryParameters(main_region_begin, main_region_size);
}
void System::SetAppletFrontendSet(Service::AM::Applets::AppletFrontendSet&& set) { void System::SetAppletFrontendSet(Service::AM::Applets::AppletFrontendSet&& set) {
impl->applet_manager.SetAppletFrontendSet(std::move(set)); impl->applet_manager.SetAppletFrontendSet(std::move(set));
} }

View file

@ -18,7 +18,6 @@ class EmuWindow;
} // namespace Core::Frontend } // namespace Core::Frontend
namespace FileSys { namespace FileSys {
class CheatList;
class ContentProvider; class ContentProvider;
class ContentProviderUnion; class ContentProviderUnion;
enum class ContentProviderUnionSlot; enum class ContentProviderUnionSlot;
@ -36,6 +35,10 @@ class AppLoader;
enum class ResultStatus : u16; enum class ResultStatus : u16;
} // namespace Loader } // namespace Loader
namespace Memory {
struct CheatEntry;
} // namespace Memory
namespace Service { namespace Service {
namespace AM::Applets { namespace AM::Applets {
@ -286,8 +289,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 RegisterCheatList(const std::vector<Memory::CheatEntry>& list,
VAddr code_region_start, VAddr code_region_end); const std::array<u8, 0x20>& build_id, VAddr main_region_begin,
u64 main_region_size);
void SetAppletFrontendSet(Service::AM::Applets::AppletFrontendSet&& set); void SetAppletFrontendSet(Service::AM::Applets::AppletFrontendSet&& set);