summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar David2019-09-22 16:24:42 +1000
committerGravatar GitHub2019-09-22 16:24:42 +1000
commit9187350b322c3140c2bec3938b91289ab55e9aae (patch)
treec2f9d045cee2bb87b1182ae93d5072b416b1b87c /src/core/core.cpp
parentMerge pull request #2709 from DarkLordZach/oss-ext-fonts-1 (diff)
parentdmnt_cheat_vm: Default initialize structure values (diff)
downloadyuzu-9187350b322c3140c2bec3938b91289ab55e9aae.tar.gz
yuzu-9187350b322c3140c2bec3938b91289ab55e9aae.tar.xz
yuzu-9187350b322c3140c2bec3938b91289ab55e9aae.zip
Merge pull request #2535 from DarkLordZach/cheat-v2
cheat_engine: Use Atmosphere's Cheat VM and fix cheat crash
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index f22244cf7..76bb2bae9 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -17,6 +17,7 @@
17#include "core/file_sys/bis_factory.h" 17#include "core/file_sys/bis_factory.h"
18#include "core/file_sys/card_image.h" 18#include "core/file_sys/card_image.h"
19#include "core/file_sys/mode.h" 19#include "core/file_sys/mode.h"
20#include "core/file_sys/patch_manager.h"
20#include "core/file_sys/registered_cache.h" 21#include "core/file_sys/registered_cache.h"
21#include "core/file_sys/romfs_factory.h" 22#include "core/file_sys/romfs_factory.h"
22#include "core/file_sys/savedata_factory.h" 23#include "core/file_sys/savedata_factory.h"
@@ -37,13 +38,12 @@
37#include "core/hle/service/service.h" 38#include "core/hle/service/service.h"
38#include "core/hle/service/sm/sm.h" 39#include "core/hle/service/sm/sm.h"
39#include "core/loader/loader.h" 40#include "core/loader/loader.h"
41#include "core/memory/cheat_engine.h"
40#include "core/perf_stats.h" 42#include "core/perf_stats.h"
41#include "core/reporter.h" 43#include "core/reporter.h"
42#include "core/settings.h" 44#include "core/settings.h"
43#include "core/telemetry_session.h" 45#include "core/telemetry_session.h"
44#include "core/tools/freezer.h" 46#include "core/tools/freezer.h"
45#include "file_sys/cheat_engine.h"
46#include "file_sys/patch_manager.h"
47#include "video_core/debug_utils/debug_utils.h" 47#include "video_core/debug_utils/debug_utils.h"
48#include "video_core/renderer_base.h" 48#include "video_core/renderer_base.h"
49#include "video_core/video_core.h" 49#include "video_core/video_core.h"
@@ -204,6 +204,11 @@ struct System::Impl {
204 gpu_core->Start(); 204 gpu_core->Start();
205 cpu_core_manager.StartThreads(); 205 cpu_core_manager.StartThreads();
206 206
207 // Initialize cheat engine
208 if (cheat_engine) {
209 cheat_engine->Initialize();
210 }
211
207 // All threads are started, begin main process execution, now that we're in the clear. 212 // All threads are started, begin main process execution, now that we're in the clear.
208 main_process->Run(load_parameters->main_thread_priority, 213 main_process->Run(load_parameters->main_thread_priority,
209 load_parameters->main_thread_stack_size); 214 load_parameters->main_thread_stack_size);
@@ -329,7 +334,7 @@ struct System::Impl {
329 CpuCoreManager cpu_core_manager; 334 CpuCoreManager cpu_core_manager;
330 bool is_powered_on = false; 335 bool is_powered_on = false;
331 336
332 std::unique_ptr<FileSys::CheatEngine> cheat_engine; 337 std::unique_ptr<Memory::CheatEngine> cheat_engine;
333 std::unique_ptr<Tools::Freezer> memory_freezer; 338 std::unique_ptr<Tools::Freezer> memory_freezer;
334 339
335 /// Frontend applets 340 /// Frontend applets
@@ -544,13 +549,6 @@ Tegra::DebugContext* System::GetGPUDebugContext() const {
544 return impl->debug_context.get(); 549 return impl->debug_context.get();
545} 550}
546 551
547void System::RegisterCheatList(const std::vector<FileSys::CheatList>& list,
548 const std::string& build_id, VAddr code_region_start,
549 VAddr code_region_end) {
550 impl->cheat_engine = std::make_unique<FileSys::CheatEngine>(*this, list, build_id,
551 code_region_start, code_region_end);
552}
553
554void System::SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs) { 552void System::SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs) {
555 impl->virtual_filesystem = std::move(vfs); 553 impl->virtual_filesystem = std::move(vfs);
556} 554}
@@ -559,6 +557,13 @@ std::shared_ptr<FileSys::VfsFilesystem> System::GetFilesystem() const {
559 return impl->virtual_filesystem; 557 return impl->virtual_filesystem;
560} 558}
561 559
560void System::RegisterCheatList(const std::vector<Memory::CheatEntry>& list,
561 const std::array<u8, 32>& build_id, VAddr main_region_begin,
562 u64 main_region_size) {
563 impl->cheat_engine = std::make_unique<Memory::CheatEngine>(*this, list, build_id);
564 impl->cheat_engine->SetMainMemoryParameters(main_region_begin, main_region_size);
565}
566
562void System::SetAppletFrontendSet(Service::AM::Applets::AppletFrontendSet&& set) { 567void System::SetAppletFrontendSet(Service::AM::Applets::AppletFrontendSet&& set) {
563 impl->applet_manager.SetAppletFrontendSet(std::move(set)); 568 impl->applet_manager.SetAppletFrontendSet(std::move(set));
564} 569}