From 1ecb322daa0e2521fe0e179e87889db9aaaf63b0 Mon Sep 17 00:00:00 2001 From: TheKoopaKingdom Date: Wed, 8 Mar 2017 16:28:30 -0500 Subject: Added system for handling core errors in citra-qt. --- src/core/core.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index 6af772831..0963f273e 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -40,7 +40,11 @@ public: ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an /// invalid format + ErrorSystemFiles, ///< Error in finding system files + ErrorSharedFont, ///< Error in finding shared font ErrorVideoCore, ///< Error in the video core + ErrorOpenGL, ///< Error when initializing OpenGL + ErrorUnknown ///< Any other error }; /** @@ -105,6 +109,14 @@ public: PerfStats perf_stats; FrameLimiter frame_limiter; + ResultStatus GetStatus() { + return status; + } + + void SetStatus(ResultStatus newStatus) { + status = newStatus; + } + private: /** * Initialize the emulated system. @@ -130,6 +142,7 @@ private: std::unique_ptr telemetry_session; static System s_instance; + ResultStatus status; }; inline ARM_Interface& CPU() { -- cgit v1.2.3 From 37bec598ea28662462dcaab65d5abd6db8372dbc Mon Sep 17 00:00:00 2001 From: TheKoopaKingdom Date: Wed, 8 Mar 2017 20:21:31 -0500 Subject: Made some changes from review comments: - Made LoadKernelSystemMode return a pair consisting of a system mode and a result code (Could use review). - Deleted ErrorOpenGL error code in favor of just having ErrorVideoCore. - Made dialog messages more clear. - Compared archive ID in fs_user.cpp to ArchiveIdCode::NCCH as opposed to hex magic. - Cleaned up some other stuff. --- src/core/core.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index 0963f273e..a7b4f8d62 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -43,7 +43,6 @@ public: ErrorSystemFiles, ///< Error in finding system files ErrorSharedFont, ///< Error in finding shared font ErrorVideoCore, ///< Error in the video core - ErrorOpenGL, ///< Error when initializing OpenGL ErrorUnknown ///< Any other error }; -- cgit v1.2.3 From 0409bdfea5ea046e3d040ab494b8a0764fd35424 Mon Sep 17 00:00:00 2001 From: TheKoopaKingdom Date: Thu, 13 Apr 2017 01:15:23 -0400 Subject: Optimized messages that were repetitive and added ability for core errors to specify more details optionally. --- src/core/core.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index a7b4f8d62..bc363ed97 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -6,6 +6,9 @@ #include #include + +#include + #include "common/common_types.h" #include "core/memory.h" #include "core/perf_stats.h" @@ -112,8 +115,16 @@ public: return status; } - void SetStatus(ResultStatus newStatus) { - status = newStatus; + void SetStatus(ResultStatus new_status, std::string details = std::string()) { + status = new_status; + if (details == std::string()) + status_details = boost::none; + else + status_details = details; + } + + boost::optional GetStatusDetails() { + return status_details; } private: @@ -141,7 +152,9 @@ private: std::unique_ptr telemetry_session; static System s_instance; + ResultStatus status; + boost::optional status_details; }; inline ARM_Interface& CPU() { -- cgit v1.2.3 From a8aef599e02e336f9ecb8d5cfc50aa856ea0a1c7 Mon Sep 17 00:00:00 2001 From: TheKoopaKingdom Date: Thu, 13 Apr 2017 01:18:54 -0400 Subject: Created a whitelist of system archives to prevent false positives creating dialogs. --- src/core/core.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index bc363ed97..6e555f954 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -6,9 +6,6 @@ #include #include - -#include - #include "common/common_types.h" #include "core/memory.h" #include "core/perf_stats.h" @@ -117,13 +114,10 @@ public: void SetStatus(ResultStatus new_status, std::string details = std::string()) { status = new_status; - if (details == std::string()) - status_details = boost::none; - else - status_details = details; + status_details = details; } - boost::optional GetStatusDetails() { + std::string GetStatusDetails() { return status_details; } @@ -154,7 +148,7 @@ private: static System s_instance; ResultStatus status; - boost::optional status_details; + std::string status_details; }; inline ARM_Interface& CPU() { -- cgit v1.2.3 From f008b22e3b2baa7720ea65c320fe49929a53bad7 Mon Sep 17 00:00:00 2001 From: TheKoopaKingdom Date: Fri, 2 Jun 2017 17:03:38 -0400 Subject: Addressed Bunnei's review comments, and made some other tweaks: - Deleted GetStatus() because it wasn't used anywhere outside of Core::System. - Fixed design flaw where the message bar status could be set despite the game being stopped. --- src/core/core.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index 6e555f954..4e3b6b409 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -108,16 +108,14 @@ public: PerfStats perf_stats; FrameLimiter frame_limiter; - ResultStatus GetStatus() { - return status; - } - - void SetStatus(ResultStatus new_status, std::string details = std::string()) { + void SetStatus(ResultStatus new_status, const char* details = nullptr) { status = new_status; - status_details = details; + if (details) { + status_details = details; + } } - std::string GetStatusDetails() { + const std::string& GetStatusDetails() const { return status_details; } @@ -147,8 +145,8 @@ private: static System s_instance; - ResultStatus status; - std::string status_details; + ResultStatus status = ResultStatus::Success; + std::string status_details = ""; }; inline ARM_Interface& CPU() { -- cgit v1.2.3