summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar LittleWhite2016-01-07 20:33:54 +0100
committerGravatar LittleWhite2016-03-08 22:05:25 +0100
commit4be68dddfbdc7065139351e6e39b5fa97844264a (patch)
tree4b020326a58a7a4364b752cb731233cb6c264cd0 /src/core
parentDisplay errors in GUI when loading ROM failed (diff)
downloadyuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar.gz
yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.tar.xz
yuzu-4be68dddfbdc7065139351e6e39b5fa97844264a.zip
Improve error report from Init() functions
Add error popup when citra initialization failed
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.cpp1
-rw-r--r--src/core/system.cpp6
-rw-r--r--src/core/system.h9
5 files changed, 14 insertions, 7 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 99f1183ca..b1907cd55 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -140,7 +140,6 @@ ResultStatus LoadFile(const std::string& filename) {
140 ResultStatus result = app_loader.Load(); 140 ResultStatus result = app_loader.Load();
141 if (ResultStatus::Success == result) { 141 if (ResultStatus::Success == result) {
142 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);
143 return ResultStatus::Success;
144 } 143 }
145 return result; 144 return result;
146 } 145 }
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}