diff options
Diffstat (limited to 'src/core/loader/ncch.cpp')
| -rw-r--r-- | src/core/loader/ncch.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 6fbaf4036..d4be61e0e 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp | |||
| @@ -117,12 +117,12 @@ 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) { | 120 | boost::optional<u32> AppLoader_NCCH::LoadKernelSystemMode() { |
| 121 | ResultStatus result = LoadExeFS(); | 121 | if (!is_loaded) { |
| 122 | if (result != ResultStatus::Success) | 122 | if (LoadExeFS() != ResultStatus::Success) |
| 123 | return result; | 123 | return boost::none; |
| 124 | memory_type = exheader_header.arm11_system_local_caps.system_mode; | 124 | } |
| 125 | return ResultStatus::Success; | 125 | return exheader_header.arm11_system_local_caps.system_mode.Value(); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | ResultStatus AppLoader_NCCH::LoadExec() { | 128 | ResultStatus AppLoader_NCCH::LoadExec() { |
| @@ -285,7 +285,8 @@ ResultStatus AppLoader_NCCH::LoadExeFS() { | |||
| 285 | LOG_DEBUG(Loader, "Core version: %d", core_version); | 285 | LOG_DEBUG(Loader, "Core version: %d", core_version); |
| 286 | LOG_DEBUG(Loader, "Thread priority: 0x%X", priority); | 286 | LOG_DEBUG(Loader, "Thread priority: 0x%X", priority); |
| 287 | 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); | 288 | LOG_DEBUG(Loader, "System Mode: %d", |
| 289 | exheader_header.arm11_system_local_caps.system_mode); | ||
| 289 | 290 | ||
| 290 | if (exheader_header.arm11_system_local_caps.program_id != ncch_header.program_id) { | 291 | if (exheader_header.arm11_system_local_caps.program_id != ncch_header.program_id) { |
| 291 | LOG_ERROR(Loader, "ExHeader Program ID mismatch: the ROM is probably encrypted."); | 292 | LOG_ERROR(Loader, "ExHeader Program ID mismatch: the ROM is probably encrypted."); |