summaryrefslogtreecommitdiffstats
path: root/src/citra
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra/citra.cpp8
-rw-r--r--src/citra_qt/main.cpp10
2 files changed, 16 insertions, 2 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index b4501eb2e..aa3bf94ca 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -114,7 +114,13 @@ int main(int argc, char **argv) {
System::Init(emu_window.get());
SCOPE_EXIT({ System::Shutdown(); });
- Loader::ResultStatus load_result = Loader::LoadFile(boot_filename);
+ std::unique_ptr<Loader::AppLoader> loader = Loader::GetFileLoader(boot_filename);
+ if (!loader) {
+ LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", boot_filename.c_str());
+ return -1;
+ }
+
+ Loader::ResultStatus load_result = loader->Load();
if (Loader::ResultStatus::Success != load_result) {
LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result);
return -1;
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index a85c94a4b..9d47014aa 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -272,7 +272,15 @@ bool GMainWindow::InitializeSystem() {
}
bool GMainWindow::LoadROM(const std::string& filename) {
- Loader::ResultStatus result = Loader::LoadFile(filename);
+ std::unique_ptr<Loader::AppLoader> app_loader = Loader::GetFileLoader(filename);
+ if (!app_loader) {
+ LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str());
+ QMessageBox::critical(this, tr("Error while loading ROM!"),
+ tr("The ROM format is not supported."));
+ return false;
+ }
+
+ Loader::ResultStatus result = app_loader->Load();
if (Loader::ResultStatus::Success != result) {
LOG_CRITICAL(Frontend, "Failed to load ROM!");
System::Shutdown();