summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index da1baa892..e2902a91f 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -145,13 +145,7 @@ struct System::Impl {
145 core_timing.SetMulticore(is_multicore); 145 core_timing.SetMulticore(is_multicore);
146 core_timing.Initialize([&system]() { system.RegisterHostThread(); }); 146 core_timing.Initialize([&system]() { system.RegisterHostThread(); });
147 147
148 const auto posix_time = std::chrono::system_clock::now().time_since_epoch(); 148 RefreshTime();
149 const auto current_time =
150 std::chrono::duration_cast<std::chrono::seconds>(posix_time).count();
151 Settings::values.custom_rtc_differential =
152 (Settings::values.custom_rtc_enabled ? Settings::values.custom_rtc.GetValue()
153 : current_time) -
154 current_time;
155 149
156 // Create a default fs if one doesn't already exist. 150 // Create a default fs if one doesn't already exist.
157 if (virtual_filesystem == nullptr) { 151 if (virtual_filesystem == nullptr) {
@@ -188,6 +182,16 @@ struct System::Impl {
188 Initialize(system); 182 Initialize(system);
189 } 183 }
190 184
185 void RefreshTime() {
186 const auto posix_time = std::chrono::system_clock::now().time_since_epoch();
187 const auto current_time =
188 std::chrono::duration_cast<std::chrono::seconds>(posix_time).count();
189 Settings::values.custom_rtc_differential =
190 (Settings::values.custom_rtc_enabled ? Settings::values.custom_rtc.GetValue()
191 : current_time) -
192 current_time;
193 }
194
191 void Run() { 195 void Run() {
192 std::unique_lock<std::mutex> lk(suspend_guard); 196 std::unique_lock<std::mutex> lk(suspend_guard);
193 197
@@ -1022,6 +1026,8 @@ void System::Exit() {
1022} 1026}
1023 1027
1024void System::ApplySettings() { 1028void System::ApplySettings() {
1029 impl->RefreshTime();
1030
1025 if (IsPoweredOn()) { 1031 if (IsPoweredOn()) {
1026 Renderer().RefreshBaseSettings(); 1032 Renderer().RefreshBaseSettings();
1027 } 1033 }