diff options
Diffstat (limited to 'src/yuzu')
-rw-r--r-- | src/yuzu/configuration/config.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/game_list.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 52 |
3 files changed, 45 insertions, 11 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 9d6454bbd..bf469ee73 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -111,6 +111,7 @@ void Config::ReadValues() { qt_config->beginGroup("Miscellaneous"); Settings::values.log_filter = qt_config->value("log_filter", "*:Info").toString().toStdString(); + Settings::values.use_dev_keys = qt_config->value("use_dev_keys", false).toBool(); qt_config->endGroup(); qt_config->beginGroup("Debugging"); @@ -222,6 +223,7 @@ void Config::SaveValues() { qt_config->beginGroup("Miscellaneous"); qt_config->setValue("log_filter", QString::fromStdString(Settings::values.log_filter)); + qt_config->setValue("use_dev_keys", Settings::values.use_dev_keys); qt_config->endGroup(); qt_config->beginGroup("Debugging"); diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 99e6634a1..71e24a9e2 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -365,7 +365,7 @@ void GameList::LoadInterfaceLayout() { item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder()); } -const QStringList GameList::supported_file_extensions = {"nso", "nro", "nca"}; +const QStringList GameList::supported_file_extensions = {"nso", "nro", "nca", "xci"}; static bool HasSupportedFileExtension(const std::string& file_name) { QFileInfo file = QFileInfo(file_name.c_str()); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 341867f7b..eac41553a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -23,6 +23,7 @@ #include "common/scope_exit.h" #include "common/string_util.h" #include "core/core.h" +#include "core/crypto/key_manager.h" #include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "core/settings.h" @@ -424,18 +425,49 @@ bool GMainWindow::LoadROM(const QString& filename) { tr("Could not determine the system mode.")); break; - case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: { + case Core::System::ResultStatus::ErrorLoader_ErrorMissingKeys: { + const auto reg_found = Core::Crypto::KeyManager::KeyFileExists(false); + const auto title_found = Core::Crypto::KeyManager::KeyFileExists(true); + + std::string file_text; + + if (!reg_found && !title_found) { + file_text = "A proper key file (prod.keys, dev.keys, or title.keys) could not be " + "found. You will need to dump your keys from your switch to continue."; + } else if (reg_found && title_found) { + file_text = + "Both key files were found in your config directory, but the correct key could" + "not be found. You may be missing a titlekey or general key, depending on " + "the game."; + } else if (reg_found) { + file_text = + "The regular keys file (prod.keys/dev.keys) was found in your config, but the " + "titlekeys file (title.keys) was not. You are either missing the correct " + "titlekey or missing a general key required to decrypt the game."; + } else { + file_text = "The title keys file (title.keys) was found in your config, but " + "the regular keys file (prod.keys/dev.keys) was not. Unfortunately, " + "having the titlekey is not enough, you need additional general keys " + "to properly decrypt the game. You should double-check to make sure " + "your keys are correct."; + } + + QMessageBox::critical( + this, tr("Error while loading ROM!"), + tr(("The game you are trying to load is encrypted and the required keys to load " + "the game could not be found in your configuration. " + + file_text + " Please refer to the yuzu wiki for help.") + .c_str())); + break; + } + case Core::System::ResultStatus::ErrorLoader_ErrorDecrypting: { QMessageBox::critical( this, tr("Error while loading ROM!"), - tr("The game that you are trying to load must be decrypted before being used with " - "yuzu. A real Switch is required.<br/><br/>" - "For more information on dumping and decrypting games, please see the following " - "wiki pages: <ul>" - "<li><a href='https://yuzu-emu.org/wiki/dumping-game-cartridges/'>Dumping Game " - "Cartridges</a></li>" - "<li><a href='https://yuzu-emu.org/wiki/dumping-installed-titles/'>Dumping " - "Installed Titles</a></li>" - "</ul>")); + tr("There was a general error while decrypting the game. This means that the keys " + "necessary were found, but were either incorrect, the game itself was not a " + "valid game or the game uses an unhandled cryptographic scheme. Please double " + "check that you have the correct " + "keys.")); break; } case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: |