feat: add system time offset setting (#6139)

* Add setting for system time offset

Add a setting to displace citra system time by days, hours, minutes
or seconds
Add UI for the setting which is only visible when clock is set to
system time
Change core/settings.h to include the setting

* Add system time offset to kernel

Actually makes use of the time offset.

* Fix time offset calculatioon in core/movie.cpp

* Replace C++20 chrono::days with seconds

Hopefully fixes the build.
This commit is contained in:
DaemonTsun 2022-11-20 16:34:53 +01:00 committed by GitHub
parent 3b6ffd9c27
commit 64062162c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 138 additions and 11 deletions

View file

@ -547,6 +547,8 @@ void Config::ReadSystemValues() {
.toInt());
Settings::values.init_time =
ReadSetting(QStringLiteral("init_time"), 946681277ULL).toULongLong();
Settings::values.init_time_offset =
ReadSetting(QStringLiteral("init_time_offset"), 0LL).toLongLong();
qt_config->endGroup();
}
@ -1057,6 +1059,8 @@ void Config::SaveSystemValues() {
static_cast<u32>(Settings::InitClock::SystemTime));
WriteSetting(QStringLiteral("init_time"),
static_cast<unsigned long long>(Settings::values.init_time), 946681277ULL);
WriteSetting(QStringLiteral("init_time_offset"),
static_cast<long long>(Settings::values.init_time_offset), 0LL);
qt_config->endGroup();
}