From 67891954ec83035678cb8bd481ec6885d84941ea Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 11 Apr 2019 16:39:59 -0700 Subject: [PATCH] loader: fix support for 7.0.0+ games with NPDM flag bit 4 set. --- stratosphere/loader/source/ldr_npdm.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stratosphere/loader/source/ldr_npdm.cpp b/stratosphere/loader/source/ldr_npdm.cpp index 603369f4a..912dc772f 100644 --- a/stratosphere/loader/source/ldr_npdm.cpp +++ b/stratosphere/loader/source/ldr_npdm.cpp @@ -117,8 +117,15 @@ Result NpdmUtils::LoadNpdmInternal(FILE *f_npdm, NpdmUtils::NpdmCache *cache) { return rc; } - if (info->header->mmu_flags > 0xF) { - return rc; + /* 7.0.0 added 0x10 as a valid bit to NPDM flags. */ + if (GetRuntimeFirmwareVersion() >= FirmwareVersion_700) { + if (info->header->mmu_flags > 0x1F) { + return rc; + } + } else { + if (info->header->mmu_flags > 0xF) { + return rc; + } } if (info->header->aci0_offset < sizeof(NpdmUtils::NpdmHeader) || info->header->aci0_size < sizeof(NpdmUtils::NpdmAci0) || info->header->aci0_offset + info->header->aci0_size > npdm_size) {