summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2023-05-10 23:57:25 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2023-07-21 16:56:07 +0200
commit8e151460265f04c7bf4a981b5f97f252a0444c27 (patch)
treedc02219effed841c9a2c20b013db9390ed3981c6 /src/core/core.cpp
parentper_game: Remove general tab (diff)
downloadyuzu-8e151460265f04c7bf4a981b5f97f252a0444c27.tar
yuzu-8e151460265f04c7bf4a981b5f97f252a0444c27.tar.gz
yuzu-8e151460265f04c7bf4a981b5f97f252a0444c27.tar.bz2
yuzu-8e151460265f04c7bf4a981b5f97f252a0444c27.tar.lz
yuzu-8e151460265f04c7bf4a981b5f97f252a0444c27.tar.xz
yuzu-8e151460265f04c7bf4a981b5f97f252a0444c27.tar.zst
yuzu-8e151460265f04c7bf4a981b5f97f252a0444c27.zip
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 {
core_timing.SetMulticore(is_multicore);
core_timing.Initialize([&system]() { system.RegisterHostThread(); });
- const auto posix_time = std::chrono::system_clock::now().time_since_epoch();
- const auto current_time =
- std::chrono::duration_cast<std::chrono::seconds>(posix_time).count();
- Settings::values.custom_rtc_differential =
- (Settings::values.custom_rtc_enabled ? Settings::values.custom_rtc.GetValue()
- : current_time) -
- current_time;
+ RefreshTime();
// Create a default fs if one doesn't already exist.
if (virtual_filesystem == nullptr) {
@@ -188,6 +182,16 @@ struct System::Impl {
Initialize(system);
}
+ void RefreshTime() {
+ const auto posix_time = std::chrono::system_clock::now().time_since_epoch();
+ const auto current_time =
+ std::chrono::duration_cast<std::chrono::seconds>(posix_time).count();
+ Settings::values.custom_rtc_differential =
+ (Settings::values.custom_rtc_enabled ? Settings::values.custom_rtc.GetValue()
+ : current_time) -
+ current_time;
+ }
+
void Run() {
std::unique_lock<std::mutex> lk(suspend_guard);
@@ -1022,6 +1026,8 @@ void System::Exit() {
}
void System::ApplySettings() {
+ impl->RefreshTime();
+
if (IsPoweredOn()) {
Renderer().RefreshBaseSettings();
}