diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-13 03:46:21 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-13 03:46:21 +0100 |
commit | cb1e63ef09a5cd775e916f6f4482cde3ea256f44 (patch) | |
tree | 602da495ef586abd466d5a06cd28270337b38e75 | |
parent | settings: Add config option to set RNG seed (diff) | |
download | yuzu-cb1e63ef09a5cd775e916f6f4482cde3ea256f44.tar yuzu-cb1e63ef09a5cd775e916f6f4482cde3ea256f44.tar.gz yuzu-cb1e63ef09a5cd775e916f6f4482cde3ea256f44.tar.bz2 yuzu-cb1e63ef09a5cd775e916f6f4482cde3ea256f44.tar.lz yuzu-cb1e63ef09a5cd775e916f6f4482cde3ea256f44.tar.xz yuzu-cb1e63ef09a5cd775e916f6f4482cde3ea256f44.tar.zst yuzu-cb1e63ef09a5cd775e916f6f4482cde3ea256f44.zip |
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 3 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 7e8e87c33..0bfe1e3be 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -34,6 +34,7 @@ #include "core/hle/lock.h" #include "core/hle/result.h" #include "core/hle/service/service.h" +#include "core/settings.h" namespace Kernel { namespace { @@ -558,7 +559,7 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) *result = 0; break; case GetInfoType::RandomEntropy: - *result = 0; + *result = Settings::values.rng_seed.value_or(0); break; case GetInfoType::ASLRRegionBaseAddr: *result = vm_manager.GetASLRRegionBaseAddress(); diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index b001266f6..67f07ecb1 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -140,7 +140,7 @@ ConfigureSystem::ConfigureSystem(QWidget* parent) connect(ui->rng_seed_checkbox, &QCheckBox::stateChanged, this, [this](bool checked) { ui->rng_seed_edit->setEnabled(checked); if (!checked) - ui->rng_seed_edit->setText("0000000000000000"); + ui->rng_seed_edit->setText(QStringLiteral("0000000000000000")); }); scene = new QGraphicsScene; @@ -164,8 +164,11 @@ void ConfigureSystem::setConfiguration() { ui->rng_seed_checkbox->setChecked(Settings::values.rng_seed.has_value()); ui->rng_seed_edit->setEnabled(Settings::values.rng_seed.has_value()); - ui->rng_seed_edit->setText( - QString::fromStdString(fmt::format("{:016X}", Settings::values.rng_seed.value_or(0)))); + + const auto rng_seed = QString("%1") + .arg(Settings::values.rng_seed.value_or(0), 16, 16, QLatin1Char{'0'}) + .toUpper(); + ui->rng_seed_edit->setText(rng_seed); } void ConfigureSystem::PopulateUserList() { |