summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 202cd332b..140ff6451 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -67,10 +67,6 @@ System::ResultStatus System::SingleStep() {
}
System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& filepath) {
- if (app_loader) {
- app_loader.reset();
- }
-
app_loader = Loader::GetLoader(filepath);
if (!app_loader) {
@@ -113,6 +109,10 @@ void System::PrepareReschedule() {
reschedule_pending = true;
}
+PerfStats::Results System::GetAndResetPerfStats() {
+ return perf_stats.GetAndResetStats(CoreTiming::GetGlobalTimeUs());
+}
+
void System::Reschedule() {
if (!reschedule_pending) {
return;
@@ -123,10 +123,6 @@ void System::Reschedule() {
}
System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
- if (cpu_core) {
- cpu_core.reset();
- }
-
Memory::Init();
if (Settings::values.use_cpu_jit) {
@@ -148,6 +144,10 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
LOG_DEBUG(Core, "Initialized OK");
+ // Reset counters and set time origin to current frame
+ GetAndResetPerfStats();
+ perf_stats.BeginSystemFrame();
+
return ResultStatus::Success;
}
@@ -159,7 +159,8 @@ void System::Shutdown() {
Kernel::Shutdown();
HW::Shutdown();
CoreTiming::Shutdown();
- cpu_core.reset();
+ cpu_core = nullptr;
+ app_loader = nullptr;
LOG_DEBUG(Core, "Shutdown OK");
}