diff options
| author | 2016-11-19 20:40:04 -0500 | |
|---|---|---|
| committer | 2016-11-19 20:40:04 -0500 | |
| commit | 1323ab2f5f1627b39e48b6f970ad8208fa7af71e (patch) | |
| tree | 6b3257864d76a4cdd3d8bb9847e55a2a51ff7573 /src/core/loader/ncch.cpp | |
| parent | Merge pull request #2172 from jroweboy/fix-mingw (diff) | |
| download | yuzu-1323ab2f5f1627b39e48b6f970ad8208fa7af71e.tar.gz yuzu-1323ab2f5f1627b39e48b6f970ad8208fa7af71e.tar.xz yuzu-1323ab2f5f1627b39e48b6f970ad8208fa7af71e.zip | |
Kernel/Loader: Grab the system mode from the NCCH ExHeader.
3dsx and elf files default to system mode 2 (96MB allocated to the application).
This allows Home Menu to boot without modifications.
Closes #1849
Diffstat (limited to 'src/core/loader/ncch.cpp')
| -rw-r--r-- | src/core/loader/ncch.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index fadd7b16b..6fbaf4036 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp | |||
| @@ -117,6 +117,14 @@ FileType AppLoader_NCCH::IdentifyType(FileUtil::IOFile& file) { | |||
| 117 | return FileType::Error; | 117 | return FileType::Error; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | ResultStatus AppLoader_NCCH::LoadKernelSystemMode(u32& memory_type) { | ||
| 121 | ResultStatus result = LoadExeFS(); | ||
| 122 | if (result != ResultStatus::Success) | ||
| 123 | return result; | ||
| 124 | memory_type = exheader_header.arm11_system_local_caps.system_mode; | ||
| 125 | return ResultStatus::Success; | ||
| 126 | } | ||
| 127 | |||
| 120 | ResultStatus AppLoader_NCCH::LoadExec() { | 128 | ResultStatus AppLoader_NCCH::LoadExec() { |
| 121 | using Kernel::SharedPtr; | 129 | using Kernel::SharedPtr; |
| 122 | using Kernel::CodeSet; | 130 | using Kernel::CodeSet; |
| @@ -277,6 +285,7 @@ ResultStatus AppLoader_NCCH::LoadExeFS() { | |||
| 277 | LOG_DEBUG(Loader, "Core version: %d", core_version); | 285 | LOG_DEBUG(Loader, "Core version: %d", core_version); |
| 278 | LOG_DEBUG(Loader, "Thread priority: 0x%X", priority); | 286 | LOG_DEBUG(Loader, "Thread priority: 0x%X", priority); |
| 279 | LOG_DEBUG(Loader, "Resource limit category: %d", resource_limit_category); | 287 | LOG_DEBUG(Loader, "Resource limit category: %d", resource_limit_category); |
| 288 | LOG_DEBUG(Loader, "System Mode: %d", exheader_header.arm11_system_local_caps.system_mode); | ||
| 280 | 289 | ||
| 281 | if (exheader_header.arm11_system_local_caps.program_id != ncch_header.program_id) { | 290 | if (exheader_header.arm11_system_local_caps.program_id != ncch_header.program_id) { |
| 282 | LOG_ERROR(Loader, "ExHeader Program ID mismatch: the ROM is probably encrypted."); | 291 | LOG_ERROR(Loader, "ExHeader Program ID mismatch: the ROM is probably encrypted."); |