diff options
| author | 2019-04-28 18:43:48 -0400 | |
|---|---|---|
| committer | 2019-09-30 17:21:53 -0400 | |
| commit | f6c53526b3e6852577ad5f5986be89202b15c5b2 (patch) | |
| tree | dab7e623b1e6a2783effbda7a53f232d18aaf6ec /src | |
| parent | applets: Add accessor for AppletFrontendSet (diff) | |
| download | yuzu-f6c53526b3e6852577ad5f5986be89202b15c5b2.tar.gz yuzu-f6c53526b3e6852577ad5f5986be89202b15c5b2.tar.xz yuzu-f6c53526b3e6852577ad5f5986be89202b15c5b2.zip | |
core/loader: Track the NSO build ID of the current process
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/core.cpp | 9 | ||||
| -rw-r--r-- | src/core/core.h | 4 | ||||
| -rw-r--r-- | src/core/loader/nso.cpp | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 92ba42fb9..75a7ffb97 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -339,6 +339,7 @@ struct System::Impl { | |||
| 339 | 339 | ||
| 340 | std::unique_ptr<Memory::CheatEngine> cheat_engine; | 340 | std::unique_ptr<Memory::CheatEngine> cheat_engine; |
| 341 | std::unique_ptr<Tools::Freezer> memory_freezer; | 341 | std::unique_ptr<Tools::Freezer> memory_freezer; |
| 342 | std::array<u8, 0x20> build_id{}; | ||
| 342 | 343 | ||
| 343 | /// Frontend applets | 344 | /// Frontend applets |
| 344 | Service::AM::Applets::AppletManager applet_manager; | 345 | Service::AM::Applets::AppletManager applet_manager; |
| @@ -640,6 +641,14 @@ bool System::GetExitLock() const { | |||
| 640 | return impl->exit_lock; | 641 | return impl->exit_lock; |
| 641 | } | 642 | } |
| 642 | 643 | ||
| 644 | void System::SetCurrentProcessBuildID(std::array<u8, 32> id) { | ||
| 645 | impl->build_id = id; | ||
| 646 | } | ||
| 647 | |||
| 648 | const std::array<u8, 32>& System::GetCurrentProcessBuildID() const { | ||
| 649 | return impl->build_id; | ||
| 650 | } | ||
| 651 | |||
| 643 | System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { | 652 | System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { |
| 644 | return impl->Init(*this, emu_window); | 653 | return impl->Init(*this, emu_window); |
| 645 | } | 654 | } |
diff --git a/src/core/core.h b/src/core/core.h index ff10ebe12..f49b7fbf9 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -330,6 +330,10 @@ public: | |||
| 330 | 330 | ||
| 331 | bool GetExitLock() const; | 331 | bool GetExitLock() const; |
| 332 | 332 | ||
| 333 | void SetCurrentProcessBuildID(std::array<u8, 0x20> id); | ||
| 334 | |||
| 335 | const std::array<u8, 0x20>& GetCurrentProcessBuildID() const; | ||
| 336 | |||
| 333 | private: | 337 | private: |
| 334 | System(); | 338 | System(); |
| 335 | 339 | ||
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index e75c700ad..f629892ae 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -150,6 +150,7 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | |||
| 150 | // Apply cheats if they exist and the program has a valid title ID | 150 | // Apply cheats if they exist and the program has a valid title ID |
| 151 | if (pm) { | 151 | if (pm) { |
| 152 | auto& system = Core::System::GetInstance(); | 152 | auto& system = Core::System::GetInstance(); |
| 153 | system.SetCurrentProcessBuildID(nso_header.build_id); | ||
| 153 | const auto cheats = pm->CreateCheatList(system, nso_header.build_id); | 154 | const auto cheats = pm->CreateCheatList(system, nso_header.build_id); |
| 154 | if (!cheats.empty()) { | 155 | if (!cheats.empty()) { |
| 155 | system.RegisterCheatList(cheats, nso_header.build_id, load_base, image_size); | 156 | system.RegisterCheatList(cheats, nso_header.build_id, load_base, image_size); |