summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-12-29 00:35:55 +0100
committerZach Hilman <zachhilman@gmail.com>2019-01-08 01:18:45 +0100
commitc6016856d878c8f68bc5518f3ef0270ea018bc3d (patch)
treecd1dafa296f01781617e895bc6ce7538e51b2cd9
parentMerge pull request #1999 from ReinUsesLisp/dirty-shader (diff)
downloadyuzu-c6016856d878c8f68bc5518f3ef0270ea018bc3d.tar
yuzu-c6016856d878c8f68bc5518f3ef0270ea018bc3d.tar.gz
yuzu-c6016856d878c8f68bc5518f3ef0270ea018bc3d.tar.bz2
yuzu-c6016856d878c8f68bc5518f3ef0270ea018bc3d.tar.lz
yuzu-c6016856d878c8f68bc5518f3ef0270ea018bc3d.tar.xz
yuzu-c6016856d878c8f68bc5518f3ef0270ea018bc3d.tar.zst
yuzu-c6016856d878c8f68bc5518f3ef0270ea018bc3d.zip
-rw-r--r--src/core/settings.h3
-rw-r--r--src/yuzu/configuration/config.cpp14
-rw-r--r--src/yuzu_cmd/config.cpp11
-rw-r--r--src/yuzu_cmd/default_ini.h6
4 files changed, 30 insertions, 4 deletions
diff --git a/src/core/settings.h b/src/core/settings.h
index de01b05c0..5b211a716 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -350,6 +350,9 @@ struct Values {
bool use_docked_mode;
bool enable_nfc;
std::optional<u32> rng_seed;
+ std::optional<s64> custom_rtc; // Measured in seconds since epoch
+ s64 custom_rtc_differential; // Set on game boot, reset on stop. Seconds difference between
+ // current time and `custom_rtc`
s32 current_user;
s32 language_index;
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 165d70e9c..6e034ef19 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -419,13 +419,20 @@ void Config::ReadValues() {
Settings::values.language_index = qt_config->value("language_index", 1).toInt();
- const auto enabled = qt_config->value("rng_seed_enabled", false).toBool();
- if (enabled) {
+ const auto rng_seed_enabled = qt_config->value("rng_seed_enabled", false).toBool();
+ if (rng_seed_enabled) {
Settings::values.rng_seed = qt_config->value("rng_seed", 0).toULongLong();
} else {
Settings::values.rng_seed = std::nullopt;
}
+ const auto custom_rtc_enabled = qt_config->value("custom_rtc_enabled", false).toBool();
+ if (custom_rtc_enabled) {
+ Settings::values.custom_rtc = qt_config->value("custom_rtc", 0).toULongLong();
+ } else {
+ Settings::values.custom_rtc = std::nullopt;
+ }
+
qt_config->endGroup();
qt_config->beginGroup("Miscellaneous");
@@ -653,6 +660,9 @@ void Config::SaveValues() {
qt_config->setValue("rng_seed_enabled", Settings::values.rng_seed.has_value());
qt_config->setValue("rng_seed", Settings::values.rng_seed.value_or(0));
+ qt_config->setValue("custom_rtc_enabled", Settings::values.custom_rtc.has_value());
+ qt_config->setValue("custom_rtc", Settings::values.custom_rtc.value_or(0));
+
qt_config->endGroup();
qt_config->beginGroup("Miscellaneous");
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index fe0d1eebf..8f3b74cdf 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -325,13 +325,20 @@ void Config::ReadValues() {
Settings::values.current_user = std::clamp<int>(
sdl2_config->GetInteger("System", "current_user", 0), 0, Service::Account::MAX_USERS - 1);
- const auto enabled = sdl2_config->GetBoolean("System", "rng_seed_enabled", false);
- if (enabled) {
+ const auto rng_seed_enabled = sdl2_config->GetBoolean("System", "rng_seed_enabled", false);
+ if (rng_seed_enabled) {
Settings::values.rng_seed = sdl2_config->GetInteger("System", "rng_seed", 0);
} else {
Settings::values.rng_seed = std::nullopt;
}
+ const auto custom_rtc_enabled = sdl2_config->GetBoolean("System", "custom_rtc_enabled", false);
+ if (custom_rtc_enabled) {
+ Settings::values.custom_rtc = sdl2_config->GetInteger("System", "custom_rtc", 0);
+ } else {
+ Settings::values.custom_rtc = std::nullopt;
+ }
+
// Core
Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true);
Settings::values.use_multi_core = sdl2_config->GetBoolean("Core", "use_multi_core", false);
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index 0f3f8da50..0a3ea2619 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -183,6 +183,12 @@ enable_nfc =
rng_seed_enabled =
rng_seed =
+# Sets the current time (in seconds since 12:00 AM Jan 1, 1970) that will be used by the time service
+# This will auto-increment, with the time set being the time the game is started
+# This override will only occur if custom_rtc_enabled is true, otherwise the current time is used
+custom_rtc_enabled =
+custom_rtc =
+
# Sets the account username, max length is 32 characters
# yuzu (default)
username = yuzu