summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-03-09 05:12:04 +0100
committerbunnei <bunneidev@gmail.com>2016-03-09 05:12:04 +0100
commit8530a2d7df7f9546e3d4e9be2cec633307a28c23 (patch)
tree9bcf963cc1a7c8c5700afe926fd43c08b2aaff96 /src/core
parentMerge pull request #1441 from MerryMage/dsp-pipes (diff)
parentImprove error report from Init() functions (diff)
downloadyuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar.gz
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar.bz2
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar.lz
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar.xz
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar.zst
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp3
-rw-r--r--src/core/core.h2
-rw-r--r--src/core/loader/loader.cpp6
-rw-r--r--src/core/system.cpp6
-rw-r--r--src/core/system.h9
5 files changed, 17 insertions, 9 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 453c7162d..84d6c392e 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -73,12 +73,11 @@ void Stop() {
}
/// Initialize the core
-int Init() {
+void Init() {
g_sys_core = Common::make_unique<ARM_DynCom>(USER32MODE);
g_app_core = Common::make_unique<ARM_DynCom>(USER32MODE);
LOG_DEBUG(Core, "Initialized OK");
- return 0;
}
void Shutdown() {
diff --git a/src/core/core.h b/src/core/core.h
index 453e0a5f0..ad26dca3f 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -52,7 +52,7 @@ void Halt(const char *msg);
void Stop();
/// Initialize the core
-int Init();
+void Init();
/// Shutdown the core
void Shutdown();
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 6b88169e1..b1907cd55 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -137,11 +137,11 @@ 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...
diff --git a/src/core/system.cpp b/src/core/system.cpp
index b62ebf69e..1e3b2783c 100644
--- a/src/core/system.cpp
+++ b/src/core/system.cpp
@@ -17,14 +17,16 @@
namespace System {
-void Init(EmuWindow* emu_window) {
+Result Init(EmuWindow* emu_window) {
Core::Init();
CoreTiming::Init();
Memory::Init();
HW::Init();
Kernel::Init();
HLE::Init();
- VideoCore::Init(emu_window);
+ if (!VideoCore::Init(emu_window)) {
+ return Result::ErrorInitVideoCore;
+ }
AudioCore::Init();
GDBStub::Init();
}
diff --git a/src/core/system.h b/src/core/system.h
index 59a75ca12..a4a627ea9 100644
--- a/src/core/system.h
+++ b/src/core/system.h
@@ -8,7 +8,14 @@ class EmuWindow;
namespace System {
-void Init(EmuWindow* emu_window);
+enum class Result {
+ Success, ///< Everything is fine
+ Error, ///< Something went wrong (no module specified)
+ ErrorInitCore, ///< Something went wrong during core init
+ ErrorInitVideoCore, ///< Something went wrong during video core init
+};
+
+Result Init(EmuWindow* emu_window);
void Shutdown();
}