diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.cpp | 3 | ||||
-rw-r--r-- | src/core/core.h | 2 | ||||
-rw-r--r-- | src/core/loader/loader.cpp | 6 | ||||
-rw-r--r-- | src/core/system.cpp | 6 | ||||
-rw-r--r-- | src/core/system.h | 9 |
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(); } |