summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorTheKoopaKingdom <thekoopakingdom@gmail.com>2017-03-08 22:28:30 +0100
committerTheKoopaKingdom <thekoopakingdom@gmail.com>2017-06-03 00:27:56 +0200
commit1ecb322daa0e2521fe0e179e87889db9aaaf63b0 (patch)
tree6f8cc571b41a76c7ab93843472809bfc9121abb7 /src/core/core.cpp
parentFixed encrypted ROM error messages. (diff)
downloadyuzu-1ecb322daa0e2521fe0e179e87889db9aaaf63b0.tar
yuzu-1ecb322daa0e2521fe0e179e87889db9aaaf63b0.tar.gz
yuzu-1ecb322daa0e2521fe0e179e87889db9aaaf63b0.tar.bz2
yuzu-1ecb322daa0e2521fe0e179e87889db9aaaf63b0.tar.lz
yuzu-1ecb322daa0e2521fe0e179e87889db9aaaf63b0.tar.xz
yuzu-1ecb322daa0e2521fe0e179e87889db9aaaf63b0.tar.zst
yuzu-1ecb322daa0e2521fe0e179e87889db9aaaf63b0.zip
Diffstat (limited to '')
-rw-r--r--src/core/core.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 450e7566d..1861bfa9b 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -59,7 +59,7 @@ System::ResultStatus System::RunLoop(int tight_loop) {
HW::Update();
Reschedule();
- return ResultStatus::Success;
+ return GetStatus();
}
System::ResultStatus System::SingleStep() {
@@ -73,11 +73,21 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
LOG_CRITICAL(Core, "Failed to obtain loader for %s!", filepath.c_str());
return ResultStatus::ErrorGetLoader;
}
+ boost::optional<u32> system_mode = boost::none;
- boost::optional<u32> system_mode{app_loader->LoadKernelSystemMode()};
+ Loader::ResultStatus load_result{app_loader->LoadKernelSystemMode(system_mode)};
if (!system_mode) {
- LOG_CRITICAL(Core, "Failed to determine system mode!");
- return ResultStatus::ErrorSystemMode;
+ LOG_CRITICAL(Core, "Failed to determine system mode (Error %i)!", load_result);
+ System::Shutdown();
+
+ switch (load_result) {
+ case Loader::ResultStatus::ErrorEncrypted:
+ return ResultStatus::ErrorLoader_ErrorEncrypted;
+ case Loader::ResultStatus::ErrorInvalidFormat:
+ return ResultStatus::ErrorLoader_ErrorInvalidFormat;
+ default:
+ return ResultStatus::ErrorSystemMode;
+ }
}
ResultStatus init_result{Init(emu_window, system_mode.get())};
@@ -87,7 +97,7 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
return init_result;
}
- const Loader::ResultStatus load_result{app_loader->Load()};
+ load_result = app_loader->Load();
if (Loader::ResultStatus::Success != load_result) {
LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", load_result);
System::Shutdown();
@@ -101,6 +111,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file
return ResultStatus::ErrorLoader;
}
}
+ // this->status will be used for errors while actually running the game
+ status = ResultStatus::Success;
return ResultStatus::Success;
}
@@ -142,7 +154,7 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
GDBStub::Init();
if (!VideoCore::Init(emu_window)) {
- return ResultStatus::ErrorVideoCore;
+ return ResultStatus::ErrorOpenGL;
}
LOG_DEBUG(Core, "Initialized OK");