diff options
Diffstat (limited to 'src/core/core.h')
| -rw-r--r-- | src/core/core.h | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/src/core/core.h b/src/core/core.h index a9a035a1b..ade456cfc 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -7,10 +7,14 @@ #include <memory> #include <string> #include "common/common_types.h" +#include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/scheduler.h" #include "core/loader/loader.h" #include "core/memory.h" #include "core/perf_stats.h" #include "core/telemetry_session.h" +#include "video_core/debug_utils/debug_utils.h" +#include "video_core/gpu.h" class EmuWindow; class ARM_Interface; @@ -50,14 +54,14 @@ public: * is not required to do a full dispatch with each instruction. NOTE: the number of instructions * requested is not guaranteed to run, as this will be interrupted preemptively if a hardware * update is requested (e.g. on a thread switch). - * @param tight_loop Number of instructions to execute. - * @return Result status, indicating whethor or not the operation succeeded. + * @param tight_loop If false, the CPU single-steps. + * @return Result status, indicating whether or not the operation succeeded. */ - ResultStatus RunLoop(int tight_loop = 100000); + ResultStatus RunLoop(bool tight_loop = true); /** * Step the CPU one instruction - * @return Result status, indicating whethor or not the operation succeeded. + * @return Result status, indicating whether or not the operation succeeded. */ ResultStatus SingleStep(); @@ -102,6 +106,18 @@ public: return *cpu_core; } + Tegra::GPU& GPU() { + return *gpu_core; + } + + Kernel::Scheduler& Scheduler() { + return *scheduler; + } + + Kernel::SharedPtr<Kernel::Process>& CurrentProcess() { + return current_process; + } + PerfStats perf_stats; FrameLimiter frame_limiter; @@ -120,6 +136,14 @@ public: return *app_loader; } + void SetGPUDebugContext(std::shared_ptr<Tegra::DebugContext> context) { + debug_context = std::move(context); + } + + std::shared_ptr<Tegra::DebugContext> GetGPUDebugContext() const { + return debug_context; + } + private: /** * Initialize the emulated system. @@ -135,8 +159,13 @@ private: /// AppLoader used to load the current executing application std::unique_ptr<Loader::AppLoader> app_loader; - ///< ARM11 CPU core - std::unique_ptr<ARM_Interface> cpu_core; + std::shared_ptr<ARM_Interface> cpu_core; + std::unique_ptr<Kernel::Scheduler> scheduler; + std::unique_ptr<Tegra::GPU> gpu_core; + + std::shared_ptr<Tegra::DebugContext> debug_context; + + Kernel::SharedPtr<Kernel::Process> current_process; /// When true, signals that a reschedule should happen bool reschedule_pending{}; @@ -158,4 +187,8 @@ inline TelemetrySession& Telemetry() { return System::GetInstance().TelemetrySession(); } +inline Kernel::SharedPtr<Kernel::Process>& CurrentProcess() { + return System::GetInstance().CurrentProcess(); +} + } // namespace Core |
