diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/core/constants.h | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/kernel/synchronization.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/kernel/thread.h | 2 | ||||
-rw-r--r-- | src/core/settings.cpp | 77 |
7 files changed, 43 insertions, 47 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ff941d505..c42f95705 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -185,6 +185,7 @@ add_library(core STATIC hle/kernel/object.h hle/kernel/physical_core.cpp hle/kernel/physical_core.h + hle/kernel/physical_memory.h hle/kernel/process.cpp hle/kernel/process.h hle/kernel/process_capability.cpp diff --git a/src/core/constants.h b/src/core/constants.h index 6d0ec022a..81c5cb279 100644 --- a/src/core/constants.h +++ b/src/core/constants.h @@ -4,6 +4,7 @@ #pragma once +#include <array> #include "common/common_types.h" // This is to consolidate system-wide constants that are used by multiple components of yuzu. diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 4d2a9b35d..df0debe1b 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -24,7 +24,6 @@ namespace Kernel { // Wake up num_to_wake (or all) threads in a vector. void AddressArbiter::WakeThreads(const std::vector<std::shared_ptr<Thread>>& waiting_threads, s32 num_to_wake) { - auto& time_manager = system.Kernel().TimeManager(); // Only process up to 'target' threads, unless 'target' is <= 0, in which case process // them all. std::size_t last = waiting_threads.size(); diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 5db19dcf3..01ae57053 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -458,9 +458,7 @@ static ResultCode WaitSynchronization(Core::System& system, Handle* index, VAddr return ERR_OUT_OF_RANGE; } - auto* const thread = system.CurrentScheduler().GetCurrentThread(); auto& kernel = system.Kernel(); - using ObjectPtr = Thread::ThreadSynchronizationObjects::value_type; Thread::ThreadSynchronizationObjects objects(handle_count); const auto& handle_table = kernel.CurrentProcess()->GetHandleTable(); @@ -1750,9 +1748,9 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_ // Only process up to 'target' threads, unless 'target' is less equal 0, in which case process // them all. std::size_t last = waiting_threads.size(); - if (target > 0) + if (target > 0) { last = std::min(waiting_threads.size(), static_cast<std::size_t>(target)); - auto& time_manager = kernel.TimeManager(); + } for (std::size_t index = 0; index < last; ++index) { auto& thread = waiting_threads[index]; @@ -1763,7 +1761,6 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_ const std::size_t current_core = system.CurrentCoreIndex(); auto& monitor = system.Monitor(); - auto& memory = system.Memory(); // Atomically read the value of the mutex. u32 mutex_val = 0; diff --git a/src/core/hle/kernel/synchronization.cpp b/src/core/hle/kernel/synchronization.cpp index 851b702a5..8b875d853 100644 --- a/src/core/hle/kernel/synchronization.cpp +++ b/src/core/hle/kernel/synchronization.cpp @@ -19,7 +19,6 @@ Synchronization::Synchronization(Core::System& system) : system{system} {} void Synchronization::SignalObject(SynchronizationObject& obj) const { auto& kernel = system.Kernel(); SchedulerLock lock(kernel); - auto& time_manager = kernel.TimeManager(); if (obj.IsSignaled()) { for (auto thread : obj.GetWaitingThreads()) { if (thread->GetSchedulingStatus() == ThreadSchedStatus::Paused) { diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 9808767e5..8daf79fac 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -583,8 +583,6 @@ private: void SetCurrentPriority(u32 new_priority); - void AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core); - Common::SpinLock context_guard{}; ThreadContext32 context_32{}; ThreadContext64 context_64{}; diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 64a3c69d3..e8a6f2a6e 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <string_view> + #include "common/file_util.h" #include "core/core.h" #include "core/gdbstub/gdbstub.h" @@ -65,18 +67,18 @@ Values values = {}; bool configuring_global = true; std::string GetTimeZoneString() { - static constexpr std::array<const char*, 46> timezones{{ + static constexpr std::array timezones{ "auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire", "EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", "Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan", "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT", "Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey", "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", - }}; - - ASSERT(Settings::values.time_zone_index.GetValue() < timezones.size()); + }; - return timezones[Settings::values.time_zone_index.GetValue()]; + const auto time_zone_index = static_cast<std::size_t>(values.time_zone_index.GetValue()); + ASSERT(time_zone_index < timezones.size()); + return timezones[time_zone_index]; } void Apply() { @@ -91,41 +93,40 @@ void Apply() { Service::HID::ReloadInputDevices(); } -template <typename T> -void LogSetting(const std::string& name, const T& value) { - LOG_INFO(Config, "{}: {}", name, value); -} - void LogSettings() { + const auto log_setting = [](std::string_view name, const auto& value) { + LOG_INFO(Config, "{}: {}", name, value); + }; + LOG_INFO(Config, "yuzu Configuration:"); - LogSetting("Controls_UseDockedMode", Settings::values.use_docked_mode); - LogSetting("System_RngSeed", Settings::values.rng_seed.GetValue().value_or(0)); - LogSetting("System_CurrentUser", Settings::values.current_user); - LogSetting("System_LanguageIndex", Settings::values.language_index.GetValue()); - LogSetting("System_RegionIndex", Settings::values.region_index.GetValue()); - LogSetting("System_TimeZoneIndex", Settings::values.time_zone_index.GetValue()); - LogSetting("Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); - LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor.GetValue()); - LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit.GetValue()); - LogSetting("Renderer_FrameLimit", Settings::values.frame_limit.GetValue()); - LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache.GetValue()); - LogSetting("Renderer_GPUAccuracyLevel", Settings::values.gpu_accuracy.GetValue()); - LogSetting("Renderer_UseAsynchronousGpuEmulation", - Settings::values.use_asynchronous_gpu_emulation.GetValue()); - LogSetting("Renderer_UseVsync", Settings::values.use_vsync.GetValue()); - LogSetting("Renderer_UseAssemblyShaders", Settings::values.use_assembly_shaders.GetValue()); - LogSetting("Renderer_AnisotropicFilteringLevel", Settings::values.max_anisotropy.GetValue()); - LogSetting("Audio_OutputEngine", Settings::values.sink_id); - LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching.GetValue()); - LogSetting("Audio_OutputDevice", Settings::values.audio_device_id); - LogSetting("DataStorage_UseVirtualSd", Settings::values.use_virtual_sd); - LogSetting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); - LogSetting("DataStorage_SdmcDir", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)); - LogSetting("Debugging_UseGdbstub", Settings::values.use_gdbstub); - LogSetting("Debugging_GdbstubPort", Settings::values.gdbstub_port); - LogSetting("Debugging_ProgramArgs", Settings::values.program_args); - LogSetting("Services_BCATBackend", Settings::values.bcat_backend); - LogSetting("Services_BCATBoxcatLocal", Settings::values.bcat_boxcat_local); + log_setting("Controls_UseDockedMode", values.use_docked_mode); + log_setting("System_RngSeed", values.rng_seed.GetValue().value_or(0)); + log_setting("System_CurrentUser", values.current_user); + log_setting("System_LanguageIndex", values.language_index.GetValue()); + log_setting("System_RegionIndex", values.region_index.GetValue()); + log_setting("System_TimeZoneIndex", values.time_zone_index.GetValue()); + log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); + log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); + log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue()); + log_setting("Renderer_FrameLimit", values.frame_limit.GetValue()); + log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); + log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); + log_setting("Renderer_UseAsynchronousGpuEmulation", + values.use_asynchronous_gpu_emulation.GetValue()); + log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); + log_setting("Renderer_UseAssemblyShaders", values.use_assembly_shaders.GetValue()); + log_setting("Renderer_AnisotropicFilteringLevel", values.max_anisotropy.GetValue()); + log_setting("Audio_OutputEngine", values.sink_id); + log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue()); + log_setting("Audio_OutputDevice", values.audio_device_id); + log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd); + log_setting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); + log_setting("DataStorage_SdmcDir", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)); + log_setting("Debugging_UseGdbstub", values.use_gdbstub); + log_setting("Debugging_GdbstubPort", values.gdbstub_port); + log_setting("Debugging_ProgramArgs", values.program_args); + log_setting("Services_BCATBackend", values.bcat_backend); + log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); } float Volume() { |