diff --git a/source/firm.c b/source/firm.c index 40c921c..eac5cc8 100755 --- a/source/firm.c +++ b/source/firm.c @@ -255,7 +255,7 @@ void main(void) } bool loadFromSd = CONFIG(LOADSDFIRMSANDMODULES); - u32 firmVersion = loadFirm(&firmType, firmSource, loadFromSd); + u32 firmVersion = loadFirm(&firmType, firmSource, loadFromSd, isSdMounted); switch(firmType) { @@ -274,7 +274,7 @@ void main(void) launchFirm(firmType, loadFromSd); } -static inline u32 loadFirm(FirmwareType *firmType, FirmwareSource firmSource, bool loadFromSd) +static inline u32 loadFirm(FirmwareType *firmType, FirmwareSource firmSource, bool loadFromSd, bool isSdMounted) { section = firm->section; @@ -317,7 +317,7 @@ static inline u32 loadFirm(FirmwareType *firmType, FirmwareSource firmSource, bo else if(firmVersion < 0x25) mustLoadFromSd = true; } - if(loadFromSd || mustLoadFromSd) + if(isSdMounted && (loadFromSd || mustLoadFromSd)) { u32 firmSize = fileRead(firm, *firmType == NATIVE_FIRM1X2X ? firmwareFiles[0] : firmwareFiles[(u32)*firmType], 0x400000); diff --git a/source/firm.h b/source/firm.h index 8cd68ef..80c95ea 100644 --- a/source/firm.h +++ b/source/firm.h @@ -47,7 +47,7 @@ typedef struct firmHeader { firmSectionHeader section[4]; } firmHeader; -static inline u32 loadFirm(FirmwareType *firmType, FirmwareSource firmSource, bool loadFromSd); +static inline u32 loadFirm(FirmwareType *firmType, FirmwareSource firmSource, bool loadFromSd, bool isSdMounted); static inline void patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32 emuHeader, u32 devMode); static inline void patchLegacyFirm(FirmwareType firmType, u32 firmVersion, u32 devMode); static inline void patch1x2xNativeAndSafeFirm(u32 devMode);