summaryrefslogtreecommitdiff
path: root/src/core/system.h
diff options
context:
space:
mode:
authorGravatar bunnei2016-12-15 19:01:48 -0500
committerGravatar bunnei2016-12-21 23:29:13 -0500
commit232ef55c1a13552e5ba8b72d61d1d072f5851598 (patch)
tree729ee82ded58202888a2c27bdc3beec6ab926768 /src/core/system.h
parentfile_util: Remove unused paths. (diff)
downloadyuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar.gz
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.tar.xz
yuzu-232ef55c1a13552e5ba8b72d61d1d072f5851598.zip
core: Consolidate core and system state, remove system module & cleanups.
Diffstat (limited to 'src/core/system.h')
-rw-r--r--src/core/system.h83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/core/system.h b/src/core/system.h
deleted file mode 100644
index 192a9c447..000000000
--- a/src/core/system.h
+++ /dev/null
@@ -1,83 +0,0 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <string>
8
9#include "core/loader/loader.h"
10
11class EmuWindow;
12
13namespace Core {
14
15class System {
16public:
17 struct State {
18 std::unique_ptr<Loader::AppLoader> app_loader;
19 };
20
21 /**
22 * Gets the instance of the System singleton class.
23 * @returns Reference to the instance of the System singleton class.
24 */
25 static System& GetInstance() {
26 return s_instance;
27 }
28
29 /// Enumeration representing the return values of the System Initialize and Load process.
30 enum class ResultStatus : u32 {
31 Success, ///< Succeeded
32 ErrorGetLoader, ///< Error finding the correct application loader
33 ErrorSystemMode, ///< Error determining the system mode
34 ErrorLoader, ///< Error loading the specified application
35 ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption
36 ErrorLoader_ErrorInvalidFormat, ///< Error loading the specified application due to an invalid format
37 ErrorVideoCore, ///< Error in the video core
38 };
39
40 /**
41 * Initialize the emulated system.
42 * @param emu_window Pointer to the host-system window used for video output and keyboard input.
43 * @param system_mode The system mode.
44 * @returns ResultStatus code, indicating if the operation succeeded.
45 */
46 ResultStatus Init(EmuWindow* emu_window, u32 system_mode);
47
48 /// Shutdown the emulated system.
49 void Shutdown();
50
51 /**
52 * Load an executable application.
53 * @param emu_window Pointer to the host-system window used for video output and keyboard input.
54 * @param filepath String path to the executable application to load on the host file system.
55 * @returns ResultStatus code, indicating if the operation succeeded.
56 */
57 ResultStatus Load(EmuWindow* emu_window, const std::string& filepath);
58
59 /**
60 * Indicates if the emulated system is powered on (all subsystems initialized and able to run an
61 * application).
62 * @returns True if the emulated system is powered on, otherwise false.
63 */
64 bool IsPoweredOn() const {
65 return is_powered_on;
66 }
67
68 /**
69 * Gets the internal state of the emulated system.
70 * @returns The internal state of the emulated system
71 */
72 State& GetState() {
73 return state;
74 }
75
76private:
77 bool is_powered_on{};
78 State state;
79
80 static System s_instance;
81};
82
83} // namespace Core