summaryrefslogtreecommitdiffstats
path: root/src/core/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.h')
-rw-r--r--src/core/core.h60
1 files changed, 47 insertions, 13 deletions
diff --git a/src/core/core.h b/src/core/core.h
index c123fe401..c8ca4b247 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -11,7 +11,7 @@
#include "common/common_types.h"
#include "core/arm/exclusive_monitor.h"
#include "core/core_cpu.h"
-#include "core/hle/kernel/kernel.h"
+#include "core/hle/kernel/object.h"
#include "core/hle/kernel/scheduler.h"
#include "core/loader/loader.h"
#include "core/memory.h"
@@ -27,6 +27,10 @@ namespace Service::SM {
class ServiceManager;
}
+namespace VideoCore {
+class RendererBase;
+}
+
namespace Core {
class System {
@@ -43,12 +47,14 @@ public:
/// Enumeration representing the return values of the System Initialize and Load process.
enum class ResultStatus : u32 {
- Success, ///< Succeeded
- ErrorNotInitialized, ///< Error trying to use core prior to initialization
- ErrorGetLoader, ///< Error finding the correct application loader
- ErrorSystemMode, ///< Error determining the system mode
- ErrorLoader, ///< Error loading the specified application
- ErrorLoader_ErrorEncrypted, ///< Error loading the specified application due to encryption
+ Success, ///< Succeeded
+ ErrorNotInitialized, ///< Error trying to use core prior to initialization
+ ErrorGetLoader, ///< Error finding the correct application loader
+ ErrorSystemMode, ///< Error determining the system mode
+ ErrorLoader, ///< Error loading the specified application
+ ErrorLoader_ErrorMissingKeys, ///< Error because the key/keys needed to run could not be
+ ///< found.
+ ErrorLoader_ErrorDecrypting, ///< 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
@@ -76,16 +82,28 @@ public:
*/
ResultStatus SingleStep();
+ /**
+ * Invalidate the CPU instruction caches
+ * This function should only be used by GDB Stub to support breakpoints, memory updates and
+ * step/continue commands.
+ */
+ void InvalidateCpuInstructionCaches() {
+ for (auto& cpu : cpu_cores) {
+ cpu->ArmInterface().ClearInstructionCache();
+ }
+ }
+
/// Shutdown the emulated system.
void Shutdown();
/**
* Load an executable application.
- * @param emu_window Pointer to the host-system window used for video output and keyboard input.
+ * @param emu_window Reference to the host-system window used for video output and keyboard
+ * input.
* @param filepath String path to the executable application to load on the host file system.
* @returns ResultStatus code, indicating if the operation succeeded.
*/
- ResultStatus Load(EmuWindow* emu_window, const std::string& filepath);
+ ResultStatus Load(EmuWindow& emu_window, const std::string& filepath);
/**
* Indicates if the emulated system is powered on (all subsystems initialized and able to run an
@@ -126,11 +144,26 @@ public:
/// Gets a CPU interface to the CPU core with the specified index
Cpu& CpuCore(size_t core_index);
- /// Gets the GPU interface
+ /// Gets a mutable reference to the GPU interface
Tegra::GPU& GPU() {
return *gpu_core;
}
+ /// Gets an immutable reference to the GPU interface.
+ const Tegra::GPU& GPU() const {
+ return *gpu_core;
+ }
+
+ /// Gets a mutable reference to the renderer.
+ VideoCore::RendererBase& Renderer() {
+ return *renderer;
+ }
+
+ /// Gets an immutable reference to the renderer.
+ const VideoCore::RendererBase& Renderer() const {
+ return *renderer;
+ }
+
/// Gets the scheduler for the CPU core that is currently running
Kernel::Scheduler& CurrentScheduler() {
return *CurrentCpuCore().Scheduler();
@@ -186,14 +219,15 @@ private:
/**
* Initialize the emulated system.
- * @param emu_window Pointer to the host-system window used for video output and keyboard input.
- * @param system_mode The system mode.
+ * @param emu_window Reference to the host-system window used for video output and keyboard
+ * input.
* @return ResultStatus code, indicating if the operation succeeded.
*/
- ResultStatus Init(EmuWindow* emu_window, u32 system_mode);
+ ResultStatus Init(EmuWindow& emu_window);
/// AppLoader used to load the current executing application
std::unique_ptr<Loader::AppLoader> app_loader;
+ std::unique_ptr<VideoCore::RendererBase> renderer;
std::unique_ptr<Tegra::GPU> gpu_core;
std::shared_ptr<Tegra::DebugContext> debug_context;
Kernel::SharedPtr<Kernel::Process> current_process;