summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2016-03-08 23:12:04 -0500
committerGravatar bunnei2016-03-08 23:12:04 -0500
commit8530a2d7df7f9546e3d4e9be2cec633307a28c23 (patch)
tree9bcf963cc1a7c8c5700afe926fd43c08b2aaff96 /src/core
parentMerge pull request #1441 from MerryMage/dsp-pipes (diff)
parentImprove error report from Init() functions (diff)
downloadyuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar.gz
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.tar.xz
yuzu-8530a2d7df7f9546e3d4e9be2cec633307a28c23.zip
Merge pull request #1344 from LittleWhite-tb/error-output
Output errors in GUI
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() {
73} 73}
74 74
75/// Initialize the core 75/// Initialize the core
76int Init() { 76void Init() {
77 g_sys_core = Common::make_unique<ARM_DynCom>(USER32MODE); 77 g_sys_core = Common::make_unique<ARM_DynCom>(USER32MODE);
78 g_app_core = Common::make_unique<ARM_DynCom>(USER32MODE); 78 g_app_core = Common::make_unique<ARM_DynCom>(USER32MODE);
79 79
80 LOG_DEBUG(Core, "Initialized OK"); 80 LOG_DEBUG(Core, "Initialized OK");
81 return 0;
82} 81}
83 82
84void Shutdown() { 83void 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);
52void Stop(); 52void Stop();
53 53
54/// Initialize the core 54/// Initialize the core
55int Init(); 55void Init();
56 56
57/// Shutdown the core 57/// Shutdown the core
58void Shutdown(); 58void 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) {
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 } 143 }
144 break; 144 return result;
145 } 145 }
146 146
147 // CIA file format... 147 // 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 @@
17 17
18namespace System { 18namespace System {
19 19
20void Init(EmuWindow* emu_window) { 20Result Init(EmuWindow* emu_window) {
21 Core::Init(); 21 Core::Init();
22 CoreTiming::Init(); 22 CoreTiming::Init();
23 Memory::Init(); 23 Memory::Init();
24 HW::Init(); 24 HW::Init();
25 Kernel::Init(); 25 Kernel::Init();
26 HLE::Init(); 26 HLE::Init();
27 VideoCore::Init(emu_window); 27 if (!VideoCore::Init(emu_window)) {
28 return Result::ErrorInitVideoCore;
29 }
28 AudioCore::Init(); 30 AudioCore::Init();
29 GDBStub::Init(); 31 GDBStub::Init();
30} 32}
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;
8 8
9namespace System { 9namespace System {
10 10
11void Init(EmuWindow* emu_window); 11enum class Result {
12 Success, ///< Everything is fine
13 Error, ///< Something went wrong (no module specified)
14 ErrorInitCore, ///< Something went wrong during core init
15 ErrorInitVideoCore, ///< Something went wrong during video core init
16};
17
18Result Init(EmuWindow* emu_window);
12void Shutdown(); 19void Shutdown();
13 20
14} 21}