summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLittleWhite <lw.demoscene@googlemail.com>2016-01-07 18:36:10 +0100
committerLittleWhite <lw.demoscene@googlemail.com>2016-03-03 22:52:29 +0100
commit7ad669a9115dfaf3271487269d8d8bcdf2c51e03 (patch)
tree2d8de106475388e6fb9fdd6f42f51a829ef9a5c0 /src
parentMerge pull request #1446 from vitorsilverio/patch-2 (diff)
downloadyuzu-7ad669a9115dfaf3271487269d8d8bcdf2c51e03.tar
yuzu-7ad669a9115dfaf3271487269d8d8bcdf2c51e03.tar.gz
yuzu-7ad669a9115dfaf3271487269d8d8bcdf2c51e03.tar.bz2
yuzu-7ad669a9115dfaf3271487269d8d8bcdf2c51e03.tar.lz
yuzu-7ad669a9115dfaf3271487269d8d8bcdf2c51e03.tar.xz
yuzu-7ad669a9115dfaf3271487269d8d8bcdf2c51e03.tar.zst
yuzu-7ad669a9115dfaf3271487269d8d8bcdf2c51e03.zip
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/main.cpp27
-rw-r--r--src/core/loader/loader.cpp5
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) {
System::Init(render_window);
// Load the game
- if (Loader::ResultStatus::Success != Loader::LoadFile(filename)) {
+ Loader::ResultStatus result = Loader::LoadFile(filename);
+ if (Loader::ResultStatus::Success != result) {
LOG_CRITICAL(Frontend, "Failed to load ROM!");
System::Shutdown();
+
+ switch (result) {
+ case Loader::ResultStatus::ErrorEncrypted: {
+ // Build the MessageBox ourselves to have clickable link
+ QMessageBox popup_error;
+ popup_error.setTextFormat(Qt::RichText);
+ popup_error.setWindowTitle(tr("Error while loading ROM !"));
+ popup_error.setText(tr("The ROM is probably encrypted !<br/><br/>"
+ "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>"));
+ popup_error.setIcon(QMessageBox::Critical);
+ popup_error.exec();
+ break;
+ }
+ case Loader::ResultStatus::ErrorInvalidFormat:
+ QMessageBox::critical(this, tr("Error while loading ROM !"),
+ tr("The ROM format is not supported."));
+ break;
+ case Loader::ResultStatus::Error:
+
+ default:
+ QMessageBox::critical(this, tr("Error while loading ROM !"),
+ tr("Unknown error !"));
+ break;
+ }
return;
}
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) {
AppLoader_NCCH app_loader(std::move(file), filename);
// Load application and RomFS
- if (ResultStatus::Success == app_loader.Load()) {
+ ResultStatus result = app_loader.Load();
+ if (ResultStatus::Success == result) {
Service::FS::RegisterArchiveType(Common::make_unique<FileSys::ArchiveFactory_RomFS>(app_loader), Service::FS::ArchiveIdCode::RomFS);
return ResultStatus::Success;
}
- break;
+ return result;
}
// CIA file format...