[frontend] Firmware setup & requirement (#222)

Currently Android only, will need to be added to desktop.

Android incorrectly records firmware as 19.0.1 if on a higher version...

TODO:
- [x] desktop
- [x] fix android

Signed-off-by: crueter <swurl@swurl.xyz>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/222
Co-authored-by: crueter <swurl@swurl.xyz>
Co-committed-by: crueter <swurl@swurl.xyz>
This commit is contained in:
crueter 2025-06-27 23:23:25 +00:00 committed by crueter
parent 20bf141faa
commit f121df0aa3
22 changed files with 379 additions and 74 deletions

View file

@ -462,6 +462,9 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
// Gen keys if necessary
OnCheckFirmwareDecryption();
// Check firmware
OnCheckFirmware();
game_list->LoadCompatibilityList();
// force reload on first load to ensure add-ons get updated
game_list->PopulateAsync(UISettings::values.game_dirs, false);
@ -4326,6 +4329,7 @@ void GMainWindow::OnInstallFirmware() {
progress.close();
OnCheckFirmwareDecryption();
OnCheckFirmware();
}
void GMainWindow::OnInstallDecryptionKeys() {
@ -4404,6 +4408,7 @@ void GMainWindow::OnInstallDecryptionKeys() {
}
OnCheckFirmwareDecryption();
OnCheckFirmware();
}
void GMainWindow::OnAbout() {
@ -5067,6 +5072,34 @@ void GMainWindow::OnCheckFirmwareDecryption() {
UpdateMenuState();
}
void GMainWindow::OnCheckFirmware()
{
if (!CheckFirmwarePresence()) {
QMessageBox::warning(
this, tr("Firmware Missing"),
tr("Firmware missing. Firmware is required to run certain games and use the Home Menu.\n"
"Eden only works with firmware 19.0.1 and earlier."));
} else {
Service::Set::FirmwareVersionFormat firmware_data{};
const auto result = Service::Set::GetFirmwareVersionImpl(
firmware_data, *system, Service::Set::GetFirmwareVersionType::Version2);
if (result.IsError()) {
LOG_INFO(Frontend, "Unable to read firmware");
QMessageBox::warning(
this, tr("Firmware Corrupted"),
tr("Firmware reported as present, but was unable to be read. Check for decryption keys and redump firmware if necessary."));
return;
}
if (firmware_data.major > 19) {
QMessageBox::warning(
this, tr("Firmware Too New"),
tr("Firmware is too new. Eden only works with firmware 19.0.1 and earlier."));
}
}
}
bool GMainWindow::CheckFirmwarePresence() {
constexpr u64 MiiEditId = static_cast<u64>(Service::AM::AppletProgramId::MiiEdit);