diff options
author | Zephyron <zephyron@citron-emu.orgq> | 2025-02-28 16:15:10 +1000 |
---|---|---|
committer | Zephyron <zephyron@citron-emu.orgq> | 2025-02-28 16:15:10 +1000 |
commit | 84e5fbc0899bb838ae2c813edee30b32735f4a5f (patch) | |
tree | 82b19cd571cf314a50bf132d36821ac15c860e4c /src/core/loader | |
parent | a442078ee4c257e8c013a6edeec72de2267eb9da (diff) |
feat: Make firmware mandatory for title launching
This commit implements a requirement for firmware to be installed before titles
can be launched, similar to how keys are required.
Changes include:
- Add IsFirmwareAvailable method to KeyManager to check for essential keys
- Add CheckFirmwarePresence method to verify actual firmware files (NCAs)
- Add firmware checks in game loading process for both desktop and Android
- Add error messages when firmware is missing
- Add strings for firmware-related error messages
The implementation checks for both essential keys and the presence of system
applets like Mii Edit and Home Menu to ensure proper firmware is installed.
Games will not launch if firmware is missing, and users will be shown an
appropriate error message.
Diffstat (limited to 'src/core/loader')
-rw-r--r-- | src/core/loader/loader.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index b6e355622..0135d6f81 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -19,6 +19,10 @@ #include "core/loader/nso.h" #include "core/loader/nsp.h" #include "core/loader/xci.h" +#include "core/hle/service/am/am.h" +#include "core/hle/service/filesystem/filesystem.h" +#include "core/file_sys/registered_cache.h" +#include "core/file_sys/content_archive.h" namespace Loader { @@ -250,6 +254,20 @@ std::unique_ptr<AppLoader> GetLoader(Core::System& system, FileSys::VirtualFile return nullptr; } + // Check if firmware is available + constexpr u64 MiiEditId = 0x0100000000001009; // Mii Edit applet ID + auto bis_system = system.GetFileSystemController().GetSystemNANDContents(); + if (bis_system) { + auto mii_applet_nca = bis_system->GetEntry(MiiEditId, FileSys::ContentRecordType::Program); + if (!mii_applet_nca) { + LOG_ERROR(Loader, "Firmware is required to launch games but is not available"); + return nullptr; + } + } else { + LOG_ERROR(Loader, "System NAND contents not available"); + return nullptr; + } + FileType type = IdentifyFile(file); const FileType filename_type = GuessFromFilename(file->GetName()); |