diff options
| -rw-r--r-- | src/citra_qt/main.cpp | 27 | ||||
| -rw-r--r-- | src/core/loader/loader.cpp | 5 |
2 files changed, 29 insertions, 3 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index da9ea6c91..d2ba3f9db 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -259,9 +259,34 @@ void GMainWindow::BootGame(const std::string& filename) { | |||
| 259 | System::Init(render_window); | 259 | System::Init(render_window); |
| 260 | 260 | ||
| 261 | // Load the game | 261 | // Load the game |
| 262 | if (Loader::ResultStatus::Success != Loader::LoadFile(filename)) { | 262 | Loader::ResultStatus result = Loader::LoadFile(filename); |
| 263 | if (Loader::ResultStatus::Success != result) { | ||
| 263 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); | 264 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); |
| 264 | System::Shutdown(); | 265 | System::Shutdown(); |
| 266 | |||
| 267 | switch (result) { | ||
| 268 | case Loader::ResultStatus::ErrorEncrypted: { | ||
| 269 | // Build the MessageBox ourselves to have clickable link | ||
| 270 | QMessageBox popup_error; | ||
| 271 | popup_error.setTextFormat(Qt::RichText); | ||
| 272 | popup_error.setWindowTitle(tr("Error while loading ROM !")); | ||
| 273 | popup_error.setText(tr("The ROM is probably encrypted !<br/><br/>" | ||
| 274 | "Please check: <a href='https://github.com/citra-emu/citra/wiki/Dumping-Game-Cartridges'>https://github.com/citra-emu/citra/wiki/Dumping-Game-Cartridges</a>")); | ||
| 275 | popup_error.setIcon(QMessageBox::Critical); | ||
| 276 | popup_error.exec(); | ||
| 277 | break; | ||
| 278 | } | ||
| 279 | case Loader::ResultStatus::ErrorInvalidFormat: | ||
| 280 | QMessageBox::critical(this, tr("Error while loading ROM !"), | ||
| 281 | tr("The ROM format is not supported.")); | ||
| 282 | break; | ||
| 283 | case Loader::ResultStatus::Error: | ||
| 284 | |||
| 285 | default: | ||
| 286 | QMessageBox::critical(this, tr("Error while loading ROM !"), | ||
| 287 | tr("Unknown error !")); | ||
| 288 | break; | ||
| 289 | } | ||
| 265 | return; | 290 | return; |
| 266 | } | 291 | } |
| 267 | 292 | ||
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index 6b88169e1..99f1183ca 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp | |||
| @@ -137,11 +137,12 @@ ResultStatus LoadFile(const std::string& filename) { | |||
| 137 | AppLoader_NCCH app_loader(std::move(file), filename); | 137 | AppLoader_NCCH app_loader(std::move(file), filename); |
| 138 | 138 | ||
| 139 | // Load application and RomFS | 139 | // Load application and RomFS |
| 140 | if (ResultStatus::Success == app_loader.Load()) { | 140 | ResultStatus result = app_loader.Load(); |
| 141 | if (ResultStatus::Success == result) { | ||
| 141 | Service::FS::RegisterArchiveType(Common::make_unique<FileSys::ArchiveFactory_RomFS>(app_loader), Service::FS::ArchiveIdCode::RomFS); | 142 | Service::FS::RegisterArchiveType(Common::make_unique<FileSys::ArchiveFactory_RomFS>(app_loader), Service::FS::ArchiveIdCode::RomFS); |
| 142 | return ResultStatus::Success; | 143 | return ResultStatus::Success; |
| 143 | } | 144 | } |
| 144 | break; | 145 | return result; |
| 145 | } | 146 | } |
| 146 | 147 | ||
| 147 | // CIA file format... | 148 | // CIA file format... |