diff options
author | bunnei <bunneidev@gmail.com> | 2019-01-10 17:05:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 17:05:21 -0500 |
commit | c9ef8b0af1a5908822ca0f3bb3b2238018a555e8 (patch) | |
tree | 157da486e44b5f7083607159e1bb8bb3e4f20842 /src/core/core.cpp | |
parent | 83e8ad23310937bb72f4412c15f45231a19202f7 (diff) | |
parent | ac7d8983ebc75b1b5e150ea7e03ff54267faf670 (diff) |
Merge pull request #1959 from DarkLordZach/custom-rtc
settings: Add support for setting the RTC manually
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r-- | src/core/core.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 715172771..31c590866 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -30,6 +30,7 @@ #include "core/hle/service/sm/sm.h" #include "core/loader/loader.h" #include "core/perf_stats.h" +#include "core/settings.h" #include "core/telemetry_session.h" #include "frontend/applets/profile_select.h" #include "frontend/applets/software_keyboard.h" @@ -96,6 +97,11 @@ struct System::Impl { CoreTiming::Init(); kernel.Initialize(); + const auto current_time = std::chrono::duration_cast<std::chrono::seconds>( + std::chrono::system_clock::now().time_since_epoch()); + Settings::values.custom_rtc_differential = + Settings::values.custom_rtc.value_or(current_time) - current_time; + // Create a default fs if one doesn't already exist. if (virtual_filesystem == nullptr) virtual_filesystem = std::make_shared<FileSys::RealVfsFilesystem>(); |