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/citron/main.cpp | |
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/citron/main.cpp')
-rw-r--r-- | src/citron/main.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/citron/main.cpp b/src/citron/main.cpp index cb6cedd19..d4ff764a8 100644 --- a/src/citron/main.cpp +++ b/src/citron/main.cpp @@ -4787,19 +4787,24 @@ void GMainWindow::OnCheckFirmwareDecryption() { } bool GMainWindow::CheckFirmwarePresence() { - constexpr u64 MiiEditId = static_cast<u64>(Service::AM::AppletProgramId::MiiEdit); + constexpr u64 MiiEditId = 0x0100000000001009; // Mii Edit applet ID + constexpr u64 QLaunchId = 0x0100000000001000; // Home Menu applet ID auto bis_system = system->GetFileSystemController().GetSystemNANDContents(); if (!bis_system) { return false; } + // Check for essential system applets auto mii_applet_nca = bis_system->GetEntry(MiiEditId, FileSys::ContentRecordType::Program); - if (!mii_applet_nca) { + auto qlaunch_nca = bis_system->GetEntry(QLaunchId, FileSys::ContentRecordType::Program); + + if (!mii_applet_nca || !qlaunch_nca) { return false; } - return true; + // Also check for essential keys + return Core::Crypto::KeyManager::Instance().IsFirmwareAvailable(); } void GMainWindow::SetFirmwareVersion() { |