diff options
| author | 2021-10-14 18:14:40 -0400 | |
|---|---|---|
| committer | 2021-10-15 17:34:49 -0400 | |
| commit | 17763a44d5426f7a3e52d6d4aebc26afb1d0ce65 (patch) | |
| tree | 71f31a3363f0412514277890275c973801583fec /src/core/core.h | |
| parent | yuzu_cmd: Remove remaining static system instances (diff) | |
| download | yuzu-17763a44d5426f7a3e52d6d4aebc26afb1d0ce65.tar.gz yuzu-17763a44d5426f7a3e52d6d4aebc26afb1d0ce65.tar.xz yuzu-17763a44d5426f7a3e52d6d4aebc26afb1d0ce65.zip | |
core: Move ResultStatus outside of System
Allows it to be a forward declaration in other header files.
Diffstat (limited to 'src/core/core.h')
| -rw-r--r-- | src/core/core.h | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/core/core.h b/src/core/core.h index cae578c69..c1234ef77 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -104,6 +104,18 @@ struct PerfStatsResults; | |||
| 104 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, | 104 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, |
| 105 | const std::string& path); | 105 | const std::string& path); |
| 106 | 106 | ||
| 107 | /// Enumeration representing the return values of the System Initialize and Load process. | ||
| 108 | enum class SystemResultStatus : u32 { | ||
| 109 | Success, ///< Succeeded | ||
| 110 | ErrorNotInitialized, ///< Error trying to use core prior to initialization | ||
| 111 | ErrorGetLoader, ///< Error finding the correct application loader | ||
| 112 | ErrorSystemFiles, ///< Error in finding system files | ||
| 113 | ErrorSharedFont, ///< Error in finding shared font | ||
| 114 | ErrorVideoCore, ///< Error in the video core | ||
| 115 | ErrorUnknown, ///< Any other error | ||
| 116 | ErrorLoader, ///< The base for loader errors (too many to repeat) | ||
| 117 | }; | ||
| 118 | |||
| 107 | class System { | 119 | class System { |
| 108 | public: | 120 | public: |
| 109 | using CurrentBuildProcessID = std::array<u8, 0x20>; | 121 | using CurrentBuildProcessID = std::array<u8, 0x20>; |
| @@ -118,35 +130,23 @@ public: | |||
| 118 | System(System&&) = delete; | 130 | System(System&&) = delete; |
| 119 | System& operator=(System&&) = delete; | 131 | System& operator=(System&&) = delete; |
| 120 | 132 | ||
| 121 | /// Enumeration representing the return values of the System Initialize and Load process. | ||
| 122 | enum class ResultStatus : u32 { | ||
| 123 | Success, ///< Succeeded | ||
| 124 | ErrorNotInitialized, ///< Error trying to use core prior to initialization | ||
| 125 | ErrorGetLoader, ///< Error finding the correct application loader | ||
| 126 | ErrorSystemFiles, ///< Error in finding system files | ||
| 127 | ErrorSharedFont, ///< Error in finding shared font | ||
| 128 | ErrorVideoCore, ///< Error in the video core | ||
| 129 | ErrorUnknown, ///< Any other error | ||
| 130 | ErrorLoader, ///< The base for loader errors (too many to repeat) | ||
| 131 | }; | ||
| 132 | |||
| 133 | /** | 133 | /** |
| 134 | * Run the OS and Application | 134 | * Run the OS and Application |
| 135 | * This function will start emulation and run the relevant devices | 135 | * This function will start emulation and run the relevant devices |
| 136 | */ | 136 | */ |
| 137 | [[nodiscard]] ResultStatus Run(); | 137 | [[nodiscard]] SystemResultStatus Run(); |
| 138 | 138 | ||
| 139 | /** | 139 | /** |
| 140 | * Pause the OS and Application | 140 | * Pause the OS and Application |
| 141 | * This function will pause emulation and stop the relevant devices | 141 | * This function will pause emulation and stop the relevant devices |
| 142 | */ | 142 | */ |
| 143 | [[nodiscard]] ResultStatus Pause(); | 143 | [[nodiscard]] SystemResultStatus Pause(); |
| 144 | 144 | ||
| 145 | /** | 145 | /** |
| 146 | * Step the CPU one instruction | 146 | * Step the CPU one instruction |
| 147 | * @return Result status, indicating whether or not the operation succeeded. | 147 | * @return Result status, indicating whether or not the operation succeeded. |
| 148 | */ | 148 | */ |
| 149 | [[nodiscard]] ResultStatus SingleStep(); | 149 | [[nodiscard]] SystemResultStatus SingleStep(); |
| 150 | 150 | ||
| 151 | /** | 151 | /** |
| 152 | * Invalidate the CPU instruction caches | 152 | * Invalidate the CPU instruction caches |
| @@ -166,10 +166,11 @@ public: | |||
| 166 | * input. | 166 | * input. |
| 167 | * @param filepath String path to the executable application to load on the host file system. | 167 | * @param filepath String path to the executable application to load on the host file system. |
| 168 | * @param program_index Specifies the index within the container of the program to launch. | 168 | * @param program_index Specifies the index within the container of the program to launch. |
| 169 | * @returns ResultStatus code, indicating if the operation succeeded. | 169 | * @returns SystemResultStatus code, indicating if the operation succeeded. |
| 170 | */ | 170 | */ |
| 171 | [[nodiscard]] ResultStatus Load(Frontend::EmuWindow& emu_window, const std::string& filepath, | 171 | [[nodiscard]] SystemResultStatus Load(Frontend::EmuWindow& emu_window, |
| 172 | u64 program_id = 0, std::size_t program_index = 0); | 172 | const std::string& filepath, u64 program_id = 0, |
| 173 | std::size_t program_index = 0); | ||
| 173 | 174 | ||
| 174 | /** | 175 | /** |
| 175 | * Indicates if the emulated system is powered on (all subsystems initialized and able to run an | 176 | * Indicates if the emulated system is powered on (all subsystems initialized and able to run an |
| @@ -295,7 +296,7 @@ public: | |||
| 295 | /// Gets the name of the current game | 296 | /// Gets the name of the current game |
| 296 | [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const; | 297 | [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const; |
| 297 | 298 | ||
| 298 | void SetStatus(ResultStatus new_status, const char* details); | 299 | void SetStatus(SystemResultStatus new_status, const char* details); |
| 299 | 300 | ||
| 300 | [[nodiscard]] const std::string& GetStatusDetails() const; | 301 | [[nodiscard]] const std::string& GetStatusDetails() const; |
| 301 | 302 | ||