diff options
| author | 2023-12-18 00:49:46 -0500 | |
|---|---|---|
| committer | 2023-12-22 21:52:49 -0500 | |
| commit | db7b2bc8f136868ea5251d5a504bd9f89d993c67 (patch) | |
| tree | 74a01823219cd4248cea08f42b52110702ad5426 /src/core/loader | |
| parent | general: properly support multiple memory instances (diff) | |
| download | yuzu-db7b2bc8f136868ea5251d5a504bd9f89d993c67.tar.gz yuzu-db7b2bc8f136868ea5251d5a504bd9f89d993c67.tar.xz yuzu-db7b2bc8f136868ea5251d5a504bd9f89d993c67.zip | |
kernel: restrict nce to applications
Diffstat (limited to 'src/core/loader')
| -rw-r--r-- | src/core/loader/deconstructed_rom_directory.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index 60ee78e89..c9f8707b7 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp | |||
| @@ -129,9 +129,10 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect | |||
| 129 | } | 129 | } |
| 130 | metadata.Print(); | 130 | metadata.Print(); |
| 131 | 131 | ||
| 132 | // Enable NCE only for programs with 39-bit address space. | 132 | // Enable NCE only for applications with 39-bit address space. |
| 133 | const bool is_39bit = | 133 | const bool is_39bit = |
| 134 | metadata.GetAddressSpaceType() == FileSys::ProgramAddressSpaceType::Is39Bit; | 134 | metadata.GetAddressSpaceType() == FileSys::ProgramAddressSpaceType::Is39Bit; |
| 135 | const bool is_application = metadata.GetPoolPartition() == FileSys::PoolPartition::Application; | ||
| 135 | Settings::SetNceEnabled(is_39bit); | 136 | Settings::SetNceEnabled(is_39bit); |
| 136 | 137 | ||
| 137 | const std::array static_modules = {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", | 138 | const std::array static_modules = {"rtld", "main", "subsdk0", "subsdk1", "subsdk2", |
| @@ -147,7 +148,7 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect | |||
| 147 | 148 | ||
| 148 | const auto GetPatcher = [&](size_t i) -> Core::NCE::Patcher* { | 149 | const auto GetPatcher = [&](size_t i) -> Core::NCE::Patcher* { |
| 149 | #ifdef HAS_NCE | 150 | #ifdef HAS_NCE |
| 150 | if (Settings::IsNceEnabled()) { | 151 | if (is_application && Settings::IsNceEnabled()) { |
| 151 | return &module_patchers[i]; | 152 | return &module_patchers[i]; |
| 152 | } | 153 | } |
| 153 | #endif | 154 | #endif |
| @@ -175,7 +176,7 @@ AppLoader_DeconstructedRomDirectory::LoadResult AppLoader_DeconstructedRomDirect | |||
| 175 | 176 | ||
| 176 | // Enable direct memory mapping in case of NCE. | 177 | // Enable direct memory mapping in case of NCE. |
| 177 | const u64 fastmem_base = [&]() -> size_t { | 178 | const u64 fastmem_base = [&]() -> size_t { |
| 178 | if (Settings::IsNceEnabled()) { | 179 | if (is_application && Settings::IsNceEnabled()) { |
| 179 | auto& buffer = system.DeviceMemory().buffer; | 180 | auto& buffer = system.DeviceMemory().buffer; |
| 180 | buffer.EnableDirectMappedAddress(); | 181 | buffer.EnableDirectMappedAddress(); |
| 181 | return reinterpret_cast<u64>(buffer.VirtualBasePointer()); | 182 | return reinterpret_cast<u64>(buffer.VirtualBasePointer()); |