diff options
| author | 2023-08-02 14:25:52 -0400 | |
|---|---|---|
| committer | 2023-08-02 14:25:52 -0400 | |
| commit | fca7d975fdbeb1c63677b80efc03920affee4b12 (patch) | |
| tree | bbded6cf80886c6def87bae92cf6784340165de9 /src/core/core.cpp | |
| parent | Merge pull request #11204 from liamwhite/eds3-blend-amd (diff) | |
| parent | config(qt): Fix name of network category (diff) | |
| download | yuzu-fca7d975fdbeb1c63677b80efc03920affee4b12.tar.gz yuzu-fca7d975fdbeb1c63677b80efc03920affee4b12.tar.xz yuzu-fca7d975fdbeb1c63677b80efc03920affee4b12.zip | |
Merge pull request #10839 from lat9nq/pgc-plus
general: Reimplement per-game configurations
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 48233d7c8..2f67e60a9 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/microprofile.h" | 13 | #include "common/microprofile.h" |
| 14 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 15 | #include "common/settings_enums.h" | ||
| 15 | #include "common/string_util.h" | 16 | #include "common/string_util.h" |
| 16 | #include "core/arm/exclusive_monitor.h" | 17 | #include "core/arm/exclusive_monitor.h" |
| 17 | #include "core/core.h" | 18 | #include "core/core.h" |
| @@ -140,16 +141,13 @@ struct System::Impl { | |||
| 140 | device_memory = std::make_unique<Core::DeviceMemory>(); | 141 | device_memory = std::make_unique<Core::DeviceMemory>(); |
| 141 | 142 | ||
| 142 | is_multicore = Settings::values.use_multi_core.GetValue(); | 143 | is_multicore = Settings::values.use_multi_core.GetValue(); |
| 143 | extended_memory_layout = Settings::values.use_unsafe_extended_memory_layout.GetValue(); | 144 | extended_memory_layout = |
| 145 | Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb; | ||
| 144 | 146 | ||
| 145 | core_timing.SetMulticore(is_multicore); | 147 | core_timing.SetMulticore(is_multicore); |
| 146 | core_timing.Initialize([&system]() { system.RegisterHostThread(); }); | 148 | core_timing.Initialize([&system]() { system.RegisterHostThread(); }); |
| 147 | 149 | ||
| 148 | const auto posix_time = std::chrono::system_clock::now().time_since_epoch(); | 150 | RefreshTime(); |
| 149 | const auto current_time = | ||
| 150 | std::chrono::duration_cast<std::chrono::seconds>(posix_time).count(); | ||
| 151 | Settings::values.custom_rtc_differential = | ||
| 152 | Settings::values.custom_rtc.value_or(current_time) - current_time; | ||
| 153 | 151 | ||
| 154 | // Create a default fs if one doesn't already exist. | 152 | // Create a default fs if one doesn't already exist. |
| 155 | if (virtual_filesystem == nullptr) { | 153 | if (virtual_filesystem == nullptr) { |
| @@ -172,7 +170,8 @@ struct System::Impl { | |||
| 172 | void ReinitializeIfNecessary(System& system) { | 170 | void ReinitializeIfNecessary(System& system) { |
| 173 | const bool must_reinitialize = | 171 | const bool must_reinitialize = |
| 174 | is_multicore != Settings::values.use_multi_core.GetValue() || | 172 | is_multicore != Settings::values.use_multi_core.GetValue() || |
| 175 | extended_memory_layout != Settings::values.use_unsafe_extended_memory_layout.GetValue(); | 173 | extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() != |
| 174 | Settings::MemoryLayout::Memory_4Gb); | ||
| 176 | 175 | ||
| 177 | if (!must_reinitialize) { | 176 | if (!must_reinitialize) { |
| 178 | return; | 177 | return; |
| @@ -181,11 +180,22 @@ struct System::Impl { | |||
| 181 | LOG_DEBUG(Kernel, "Re-initializing"); | 180 | LOG_DEBUG(Kernel, "Re-initializing"); |
| 182 | 181 | ||
| 183 | is_multicore = Settings::values.use_multi_core.GetValue(); | 182 | is_multicore = Settings::values.use_multi_core.GetValue(); |
| 184 | extended_memory_layout = Settings::values.use_unsafe_extended_memory_layout.GetValue(); | 183 | extended_memory_layout = |
| 184 | Settings::values.memory_layout_mode.GetValue() != Settings::MemoryLayout::Memory_4Gb; | ||
| 185 | 185 | ||
| 186 | Initialize(system); | 186 | Initialize(system); |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | void RefreshTime() { | ||
| 190 | const auto posix_time = std::chrono::system_clock::now().time_since_epoch(); | ||
| 191 | const auto current_time = | ||
| 192 | std::chrono::duration_cast<std::chrono::seconds>(posix_time).count(); | ||
| 193 | Settings::values.custom_rtc_differential = | ||
| 194 | (Settings::values.custom_rtc_enabled ? Settings::values.custom_rtc.GetValue() | ||
| 195 | : current_time) - | ||
| 196 | current_time; | ||
| 197 | } | ||
| 198 | |||
| 189 | void Run() { | 199 | void Run() { |
| 190 | std::unique_lock<std::mutex> lk(suspend_guard); | 200 | std::unique_lock<std::mutex> lk(suspend_guard); |
| 191 | 201 | ||
| @@ -1028,6 +1038,8 @@ void System::Exit() { | |||
| 1028 | } | 1038 | } |
| 1029 | 1039 | ||
| 1030 | void System::ApplySettings() { | 1040 | void System::ApplySettings() { |
| 1041 | impl->RefreshTime(); | ||
| 1042 | |||
| 1031 | if (IsPoweredOn()) { | 1043 | if (IsPoweredOn()) { |
| 1032 | Renderer().RefreshBaseSettings(); | 1044 | Renderer().RefreshBaseSettings(); |
| 1033 | } | 1045 | } |