diff options
133 files changed, 262 insertions, 231 deletions
diff --git a/src/audio_core/audio_out.cpp b/src/audio_core/audio_out.cpp index fe3a898ad..20a756dce 100644 --- a/src/audio_core/audio_out.cpp +++ b/src/audio_core/audio_out.cpp @@ -7,7 +7,7 @@ #include "audio_core/sink_details.h" #include "common/assert.h" #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" namespace AudioCore { diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index d2ce8c814..ae2201c36 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -11,8 +11,8 @@ #include "audio_core/info_updater.h" #include "audio_core/voice_context.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/memory.h" -#include "core/settings.h" namespace { [[nodiscard]] static constexpr s16 ClampToS16(s32 value) { diff --git a/src/audio_core/cubeb_sink.cpp b/src/audio_core/cubeb_sink.cpp index 043447eaa..93c35e785 100644 --- a/src/audio_core/cubeb_sink.cpp +++ b/src/audio_core/cubeb_sink.cpp @@ -11,7 +11,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/ring_buffer.h" -#include "core/settings.h" +#include "common/settings.h" #ifdef _WIN32 #include <objbase.h> diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index b0f6f0c34..ad6c587c2 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp @@ -11,8 +11,8 @@ #include "audio_core/stream.h" #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" -#include "core/settings.h" namespace AudioCore { diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 9f8dafa3b..88644eeb6 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -152,6 +152,10 @@ add_library(common STATIC scm_rev.cpp scm_rev.h scope_exit.h + settings.cpp + settings.h + settings_input.cpp + settings_input.h spin_lock.cpp spin_lock.h stream.cpp diff --git a/src/common/assert.cpp b/src/common/assert.cpp index d7d91b96b..72f1121aa 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp @@ -3,9 +3,12 @@ // Refer to the license.txt file included. #include "common/assert.h" - #include "common/common_funcs.h" +#include "common/settings.h" + void assert_handle_failure() { - Crash(); + if (Settings::values.use_debug_asserts) { + Crash(); + } } diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 2e0467ef4..bc82905c0 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -21,9 +21,9 @@ #include "common/logging/backend.h" #include "common/logging/log.h" #include "common/logging/text_formatter.h" +#include "common/settings.h" #include "common/string_util.h" #include "common/threadsafe_queue.h" -#include "core/settings.h" namespace Common::Log { diff --git a/src/common/nvidia_flags.h b/src/common/nvidia_flags.h index 75a0233ac..8930efcec 100644 --- a/src/common/nvidia_flags.h +++ b/src/common/nvidia_flags.h @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#pragma once + namespace Common { /// Configure platform specific flags for Nvidia's driver diff --git a/src/core/settings.cpp b/src/common/settings.cpp index 2ae5196e0..702b6598d 100644 --- a/src/core/settings.cpp +++ b/src/common/settings.cpp @@ -1,4 +1,4 @@ -// Copyright 2014 Citra Emulator Project +// Copyright 2021 yuzu Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -7,10 +7,7 @@ #include "common/assert.h" #include "common/file_util.h" #include "common/logging/log.h" -#include "core/core.h" -#include "core/hle/service/hid/hid.h" -#include "core/settings.h" -#include "video_core/renderer_base.h" +#include "common/settings.h" namespace Settings { @@ -32,14 +29,6 @@ std::string GetTimeZoneString() { return timezones[time_zone_index]; } -void Apply(Core::System& system) { - if (system.IsPoweredOn()) { - system.Renderer().RefreshBaseSettings(); - } - - Service::HID::ReloadInputDevices(); -} - void LogSettings() { const auto log_setting = [](std::string_view name, const auto& value) { LOG_INFO(Config, "{}: {}", name, value); diff --git a/src/core/settings.h b/src/common/settings.h index 6c03a6ea9..d39b4aa45 100644 --- a/src/core/settings.h +++ b/src/common/settings.h @@ -1,4 +1,4 @@ -// Copyright 2014 Citra Emulator Project +// Copyright 2021 yuzu Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -11,16 +11,13 @@ #include <optional> #include <string> #include <vector> -#include "common/common_types.h" -#include "input_common/settings.h" -namespace Core { -class System; -} +#include "common/common_types.h" +#include "common/settings_input.h" namespace Settings { -enum class RendererBackend { +enum class RendererBackend : u32 { OpenGL = 0, Vulkan = 1, }; @@ -31,7 +28,7 @@ enum class GPUAccuracy : u32 { Extreme = 2, }; -enum class CPUAccuracy { +enum class CPUAccuracy : u32 { Accurate = 0, Unsafe = 1, DebugMode = 2, @@ -223,6 +220,7 @@ struct Values { bool quest_flag; bool disable_macro_jit; bool extended_logging; + bool use_debug_asserts; bool use_auto_stub; // Miscellaneous @@ -255,7 +253,6 @@ float Volume(); std::string GetTimeZoneString(); -void Apply(Core::System& system); void LogSettings(); // Restore the global state of all applicable settings in the Values struct diff --git a/src/input_common/settings.cpp b/src/common/settings_input.cpp index 557e7a9a0..bea2b837b 100644 --- a/src/input_common/settings.cpp +++ b/src/common/settings_input.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "input_common/settings.h" +#include "common/settings_input.h" namespace Settings { namespace NativeButton { diff --git a/src/input_common/settings.h b/src/common/settings_input.h index a59f5d461..609600582 100644 --- a/src/input_common/settings.h +++ b/src/common/settings_input.h @@ -6,6 +6,7 @@ #include <array> #include <string> + #include "common/common_types.h" namespace Settings { diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 167ee13f3..286e912e3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -621,8 +621,6 @@ add_library(core STATIC perf_stats.h reporter.cpp reporter.h - settings.cpp - settings.h telemetry_session.cpp telemetry_session.h tools/freezer.cpp diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 08d889135..7aeb2a658 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp @@ -10,6 +10,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/page_table.h" +#include "common/settings.h" #include "core/arm/cpu_interrupt_handler.h" #include "core/arm/dynarmic/arm_dynarmic_32.h" #include "core/arm/dynarmic/arm_dynarmic_cp15.h" @@ -18,7 +19,6 @@ #include "core/core_timing.h" #include "core/hle/kernel/svc.h" #include "core/memory.h" -#include "core/settings.h" namespace Core { diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index e12e50658..040529f4d 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -9,6 +9,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/page_table.h" +#include "common/settings.h" #include "core/arm/cpu_interrupt_handler.h" #include "core/arm/dynarmic/arm_dynarmic_64.h" #include "core/arm/dynarmic/arm_exclusive_monitor.h" @@ -19,7 +20,6 @@ #include "core/hle/kernel/process.h" #include "core/hle/kernel/svc.h" #include "core/memory.h" -#include "core/settings.h" namespace Core { diff --git a/src/core/core.cpp b/src/core/core.cpp index 56b47e671..d459d6c34 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -9,6 +9,7 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/microprofile.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/arm/exclusive_monitor.h" #include "core/core.h" @@ -36,6 +37,7 @@ #include "core/hle/service/apm/controller.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/glue/manager.h" +#include "core/hle/service/hid/hid.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" #include "core/hle/service/time/time_manager.h" @@ -45,7 +47,6 @@ #include "core/network/network.h" #include "core/perf_stats.h" #include "core/reporter.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "core/tools/freezer.h" #include "video_core/renderer_base.h" @@ -774,4 +775,12 @@ void System::ExecuteProgram(std::size_t program_index) { } } +void System::ApplySettings() { + if (IsPoweredOn()) { + Renderer().RefreshBaseSettings(); + } + + Service::HID::ReloadInputDevices(); +} + } // namespace Core diff --git a/src/core/core.h b/src/core/core.h index 3a8e040c1..f1068d23f 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -388,6 +388,9 @@ public: */ void ExecuteProgram(std::size_t program_index); + /// Applies any changes to settings to this core instance. + void ApplySettings(); + private: System(); diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index ad116dcc0..070ed439e 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -22,6 +22,7 @@ #include "common/file_util.h" #include "common/hex_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/crypto/aes_util.h" #include "core/crypto/key_manager.h" @@ -32,7 +33,6 @@ #include "core/file_sys/registered_cache.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" -#include "core/settings.h" namespace Core::Crypto { namespace { diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 7c3284df8..cc9b4b637 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -10,6 +10,7 @@ #include "common/file_util.h" #include "common/hex_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/file_sys/common_funcs.h" @@ -25,7 +26,6 @@ #include "core/loader/loader.h" #include "core/loader/nso.h" #include "core/memory/cheat_engine.h" -#include "core/settings.h" namespace FileSys { namespace { diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp index 4df3574d2..8d960d1ca 100644 --- a/src/core/frontend/applets/profile_select.cpp +++ b/src/core/frontend/applets/profile_select.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/frontend/applets/profile_select.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" namespace Core::Frontend { diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index ee7a58b1c..474de9206 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -4,9 +4,9 @@ #include <cmath> #include <mutex> +#include "common/settings.h" #include "core/frontend/emu_window.h" #include "core/frontend/input.h" -#include "core/settings.h" namespace Core::Frontend { diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index b9a270a55..0832463d6 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp @@ -5,8 +5,8 @@ #include <cmath> #include "common/assert.h" +#include "common/settings.h" #include "core/frontend/framebuffer_layout.h" -#include "core/settings.h" namespace Layout { diff --git a/src/core/hle/kernel/k_resource_limit.cpp b/src/core/hle/kernel/k_resource_limit.cpp index d7a4a38e6..d05b34ea3 100644 --- a/src/core/hle/kernel/k_resource_limit.cpp +++ b/src/core/hle/kernel/k_resource_limit.cpp @@ -2,21 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -// This file references various implementation details from Atmosphere, an open-source firmware for -// the Nintendo Switch. Copyright 2018-2020 Atmosphere-NX. - #include "common/assert.h" -#include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" #include "core/hle/kernel/k_resource_limit.h" #include "core/hle/kernel/svc_results.h" namespace Kernel { constexpr s64 DefaultTimeout = 10000000000; // 10 seconds -KResourceLimit::KResourceLimit(KernelCore& kernel, Core::System& system) - : Object{kernel}, lock{kernel}, cond_var{kernel}, kernel{kernel}, system(system) {} +KResourceLimit::KResourceLimit(KernelCore& kernel, const Core::Timing::CoreTiming& core_timing_) + : Object{kernel}, lock{kernel}, cond_var{kernel}, core_timing(core_timing_) {} KResourceLimit::~KResourceLimit() = default; s64 KResourceLimit::GetLimitValue(LimitableResource which) const { @@ -83,7 +78,7 @@ ResultCode KResourceLimit::SetLimitValue(LimitableResource which, s64 value) { } bool KResourceLimit::Reserve(LimitableResource which, s64 value) { - return Reserve(which, value, system.CoreTiming().GetGlobalTimeNs().count() + DefaultTimeout); + return Reserve(which, value, core_timing.GetGlobalTimeNs().count() + DefaultTimeout); } bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { @@ -114,7 +109,7 @@ bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { } if (current_hints[index] + value <= limit_values[index] && - (timeout < 0 || system.CoreTiming().GetGlobalTimeNs().count() < timeout)) { + (timeout < 0 || core_timing.GetGlobalTimeNs().count() < timeout)) { waiter_count++; cond_var.Wait(&lock, timeout); waiter_count--; diff --git a/src/core/hle/kernel/k_resource_limit.h b/src/core/hle/kernel/k_resource_limit.h index 58ae456f1..4542317d0 100644 --- a/src/core/hle/kernel/k_resource_limit.h +++ b/src/core/hle/kernel/k_resource_limit.h @@ -2,9 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -// This file references various implementation details from Atmosphere, an open-source firmware for -// the Nintendo Switch. Copyright 2018-2020 Atmosphere-NX. - #pragma once #include <array> @@ -15,8 +12,8 @@ union ResultCode; -namespace Core { -class System; +namespace Core::Timing { +class CoreTiming; } namespace Kernel { @@ -37,7 +34,7 @@ constexpr bool IsValidResourceType(LimitableResource type) { class KResourceLimit final : public Object { public: - explicit KResourceLimit(KernelCore& kernel, Core::System& system); + explicit KResourceLimit(KernelCore& kernel, const Core::Timing::CoreTiming& core_timing_); ~KResourceLimit(); s64 GetLimitValue(LimitableResource which) const; @@ -75,7 +72,6 @@ private: mutable KLightLock lock; s32 waiter_count{}; KLightConditionVariable cond_var; - KernelCore& kernel; - Core::System& system; + const Core::Timing::CoreTiming& core_timing; }; } // namespace Kernel diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 8fd990577..5c4f45ab4 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -67,8 +67,13 @@ struct KernelCore::Impl { is_phantom_mode_for_singlecore = false; InitializePhysicalCores(); - InitializeSystemResourceLimit(kernel, system); - InitializeMemoryLayout(); + + // Derive the initial memory layout from the emulated board + KMemoryLayout memory_layout; + DeriveInitialMemoryLayout(memory_layout); + InitializeMemoryLayout(memory_layout); + InitializeSystemResourceLimit(kernel, system.CoreTiming(), memory_layout); + InitializeSlabHeaps(); InitializeSchedulers(); InitializeSuspendThreads(); InitializePreemption(kernel); @@ -137,27 +142,33 @@ struct KernelCore::Impl { } // Creates the default system resource limit - void InitializeSystemResourceLimit(KernelCore& kernel, Core::System& system) { - system_resource_limit = std::make_shared<KResourceLimit>(kernel, system); + void InitializeSystemResourceLimit(KernelCore& kernel, + const Core::Timing::CoreTiming& core_timing, + const KMemoryLayout& memory_layout) { + system_resource_limit = std::make_shared<KResourceLimit>(kernel, core_timing); + const auto [total_size, kernel_size] = memory_layout.GetTotalAndKernelMemorySizes(); // If setting the default system values fails, then something seriously wrong has occurred. - ASSERT(system_resource_limit->SetLimitValue(LimitableResource::PhysicalMemory, 0x100000000) + ASSERT(system_resource_limit->SetLimitValue(LimitableResource::PhysicalMemory, total_size) .IsSuccess()); ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Threads, 800).IsSuccess()); ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Events, 900).IsSuccess()); ASSERT(system_resource_limit->SetLimitValue(LimitableResource::TransferMemory, 200) .IsSuccess()); ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Sessions, 1133).IsSuccess()); + system_resource_limit->Reserve(LimitableResource::PhysicalMemory, kernel_size); - // Derived from recent software updates. The kernel reserves 27MB - constexpr u64 kernel_size{0x1b00000}; - if (!system_resource_limit->Reserve(LimitableResource::PhysicalMemory, kernel_size)) { - UNREACHABLE(); - } // Reserve secure applet memory, introduced in firmware 5.0.0 - constexpr u64 secure_applet_memory_size{0x400000}; + constexpr u64 secure_applet_memory_size{Common::Size_4_MB}; ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemory, secure_applet_memory_size)); + + // This memory seems to be reserved on hardware, but is not reserved/used by yuzu. + // Likely Horizon OS reserved memory + // TODO(ameerj): Derive the memory rather than hardcode it. + constexpr u64 unknown_reserved_memory{0x2f896000}; + ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemory, + unknown_reserved_memory)); } void InitializePreemption(KernelCore& kernel) { @@ -531,11 +542,7 @@ struct KernelCore::Impl { linear_region_start); } - void InitializeMemoryLayout() { - // Derive the initial memory layout from the emulated board - KMemoryLayout memory_layout; - DeriveInitialMemoryLayout(memory_layout); - + void InitializeMemoryLayout(const KMemoryLayout& memory_layout) { const auto system_pool = memory_layout.GetKernelSystemPoolRegionPhysicalExtents(); const auto applet_pool = memory_layout.GetKernelAppletPoolRegionPhysicalExtents(); const auto application_pool = memory_layout.GetKernelApplicationPoolRegionPhysicalExtents(); @@ -578,11 +585,14 @@ struct KernelCore::Impl { system.Kernel(), system.DeviceMemory(), nullptr, {time_phys_addr, time_size / PageSize}, KMemoryPermission::None, KMemoryPermission::Read, time_phys_addr, time_size, "Time:SharedMemory"); + } + void InitializeSlabHeaps() { // Allocate slab heaps user_slab_heap_pages = std::make_unique<KSlabHeap<Page>>(); - constexpr u64 user_slab_heap_size{0x1ef000}; + // TODO(ameerj): This should be derived, not hardcoded within the kernel + constexpr u64 user_slab_heap_size{0x3de000}; // Reserve slab heaps ASSERT( system_resource_limit->Reserve(LimitableResource::PhysicalMemory, user_slab_heap_size)); diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 9d5956ead..e35deb8e2 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -10,6 +10,7 @@ #include "common/alignment.h" #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/device_memory.h" #include "core/file_sys/program_metadata.h" @@ -26,7 +27,6 @@ #include "core/hle/kernel/svc_results.h" #include "core/hle/lock.h" #include "core/memory.h" -#include "core/settings.h" namespace Kernel { namespace { @@ -120,9 +120,7 @@ std::shared_ptr<Process> Process::Create(Core::System& system, std::string name, std::shared_ptr<Process> process = std::make_shared<Process>(system); process->name = std::move(name); - // TODO: This is inaccurate - // The process should hold a reference to the kernel-wide resource limit. - process->resource_limit = std::make_shared<KResourceLimit>(kernel, system); + process->resource_limit = kernel.GetSystemResourceLimit(); process->status = ProcessStatus::Created; process->program_id = 0; process->process_id = type == ProcessType::KernelInternal ? kernel.CreateNewKernelProcessID() @@ -160,17 +158,13 @@ void Process::DecrementThreadCount() { } u64 Process::GetTotalPhysicalMemoryAvailable() const { - // TODO: This is expected to always return the application memory pool size after accurately - // reserving kernel resources. The current workaround uses a process-local resource limit of - // application memory pool size, which is inaccurate. const u64 capacity{resource_limit->GetFreeValue(LimitableResource::PhysicalMemory) + page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + main_thread_stack_size}; - + ASSERT(capacity == kernel.MemoryManager().GetSize(KMemoryManager::Pool::Application)); if (capacity < memory_usage_capacity) { return capacity; } - return memory_usage_capacity; } @@ -272,10 +266,6 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, system_resource_size = metadata.GetSystemResourceSize(); image_size = code_size; - // Set initial resource limits - resource_limit->SetLimitValue( - LimitableResource::PhysicalMemory, - kernel.MemoryManager().GetSize(KMemoryManager::Pool::Application)); KScopedResourceReservation memory_reservation(resource_limit, LimitableResource::PhysicalMemory, code_size + system_resource_size); if (!memory_reservation.Succeeded()) { @@ -324,16 +314,6 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, UNREACHABLE(); } - // Set initial resource limits - resource_limit->SetLimitValue( - LimitableResource::PhysicalMemory, - kernel.MemoryManager().GetSize(KMemoryManager::Pool::Application)); - - resource_limit->SetLimitValue(LimitableResource::Threads, 608); - resource_limit->SetLimitValue(LimitableResource::Events, 700); - resource_limit->SetLimitValue(LimitableResource::TransferMemory, 128); - resource_limit->SetLimitValue(LimitableResource::Sessions, 894); - // Create TLS region tls_region_address = CreateTLSRegion(); memory_reservation.Commit(); diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index fcffc746d..bebb86154 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -2156,7 +2156,7 @@ static ResultCode CreateResourceLimit(Core::System& system, Handle* out_handle) LOG_DEBUG(Kernel_SVC, "called"); auto& kernel = system.Kernel(); - auto resource_limit = std::make_shared<KResourceLimit>(kernel, system); + auto resource_limit = std::make_shared<KResourceLimit>(kernel, system.CoreTiming()); auto* const current_process = kernel.CurrentProcess(); ASSERT(current_process != nullptr); diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 50b2c58e2..de83d82a4 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp @@ -8,8 +8,8 @@ #include <fmt/format.h> #include "common/file_util.h" +#include "common/settings.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" namespace Service::Account { diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 4374487a3..416c5239a 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -7,6 +7,7 @@ #include <cinttypes> #include <cstring> #include "audio_core/audio_renderer.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" @@ -41,7 +42,6 @@ #include "core/hle/service/set/set.h" #include "core/hle/service/sm/sm.h" #include "core/hle/service/vi/vi.h" -#include "core/settings.h" namespace Service::AM { diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 0f51e5871..75867e349 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp @@ -7,6 +7,7 @@ #include <vector> #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/common_funcs.h" #include "core/file_sys/content_archive.h" @@ -21,7 +22,6 @@ #include "core/hle/kernel/process.h" #include "core/hle/service/aoc/aoc_u.h" #include "core/loader/loader.h" -#include "core/settings.h" namespace Service::AOC { diff --git a/src/core/hle/service/apm/controller.cpp b/src/core/hle/service/apm/controller.cpp index 03636642b..00c174bb0 100644 --- a/src/core/hle/service/apm/controller.cpp +++ b/src/core/hle/service/apm/controller.cpp @@ -7,9 +7,9 @@ #include <utility> #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/hle/service/apm/controller.h" -#include "core/settings.h" namespace Service::APM { diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index e43f3f47f..78c047bd2 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp @@ -9,6 +9,7 @@ #include "common/hex_util.h" #include "common/logging/backend.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/vfs.h" #include "core/file_sys/vfs_libzip.h" @@ -16,7 +17,6 @@ #include "core/frontend/applets/error.h" #include "core/hle/service/am/applets/applets.h" #include "core/hle/service/bcat/backend/boxcat.h" -#include "core/settings.h" namespace Service::BCAT { namespace { diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp index b68e2c345..c7dd04a6e 100644 --- a/src/core/hle/service/bcat/module.cpp +++ b/src/core/hle/service/bcat/module.cpp @@ -7,6 +7,7 @@ #include "backend/boxcat.h" #include "common/hex_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/file_sys/vfs.h" @@ -18,7 +19,6 @@ #include "core/hle/service/bcat/bcat.h" #include "core/hle/service/bcat/module.h" #include "core/hle/service/filesystem/filesystem.h" -#include "core/settings.h" namespace Service::BCAT { diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index b15c737e1..72ad273b2 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -6,6 +6,7 @@ #include "common/assert.h" #include "common/file_util.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/bis_factory.h" #include "core/file_sys/card_image.h" @@ -26,7 +27,6 @@ #include "core/hle/service/filesystem/fsp_pr.h" #include "core/hle/service/filesystem/fsp_srv.h" #include "core/loader/loader.h" -#include "core/settings.h" namespace Service::FileSystem { diff --git a/src/core/hle/service/hid/controllers/debug_pad.cpp b/src/core/hle/service/hid/controllers/debug_pad.cpp index ad251ed4a..a460f2f79 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.cpp +++ b/src/core/hle/service/hid/controllers/debug_pad.cpp @@ -4,9 +4,9 @@ #include <cstring> #include "common/common_types.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/hle/service/hid/controllers/debug_pad.h" -#include "core/settings.h" namespace Service::HID { diff --git a/src/core/hle/service/hid/controllers/debug_pad.h b/src/core/hle/service/hid/controllers/debug_pad.h index 555b29d76..0593d7d39 100644 --- a/src/core/hle/service/hid/controllers/debug_pad.h +++ b/src/core/hle/service/hid/controllers/debug_pad.h @@ -8,10 +8,10 @@ #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" +#include "common/settings.h" #include "common/swap.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Service::HID { class Controller_DebugPad final : public ControllerBase { diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index 93c43a203..155808f6a 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp @@ -5,10 +5,10 @@ #include <cstring> #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" #include "core/hle/service/hid/controllers/gesture.h" -#include "core/settings.h" namespace Service::HID { constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3BA00; diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp index c4a59147d..18b76038f 100644 --- a/src/core/hle/service/hid/controllers/keyboard.cpp +++ b/src/core/hle/service/hid/controllers/keyboard.cpp @@ -4,9 +4,9 @@ #include <cstring> #include "common/common_types.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/hle/service/hid/controllers/keyboard.h" -#include "core/settings.h" namespace Service::HID { constexpr std::size_t SHARED_MEMORY_OFFSET = 0x3800; diff --git a/src/core/hle/service/hid/controllers/keyboard.h b/src/core/hle/service/hid/controllers/keyboard.h index b5b281752..e72948591 100644 --- a/src/core/hle/service/hid/controllers/keyboard.h +++ b/src/core/hle/service/hid/controllers/keyboard.h @@ -8,10 +8,10 @@ #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" +#include "common/settings.h" #include "common/swap.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Service::HID { class Controller_Keyboard final : public ControllerBase { diff --git a/src/core/hle/service/hid/controllers/mouse.h b/src/core/hle/service/hid/controllers/mouse.h index 3b432a36e..0ec0c2b94 100644 --- a/src/core/hle/service/hid/controllers/mouse.h +++ b/src/core/hle/service/hid/controllers/mouse.h @@ -7,10 +7,10 @@ #include <array> #include "common/bit_field.h" #include "common/common_types.h" +#include "common/settings.h" #include "common/swap.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Service::HID { class Controller_Mouse final : public ControllerBase { diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 673db68c7..783386fcf 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -9,6 +9,7 @@ #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/input.h" @@ -17,7 +18,6 @@ #include "core/hle/kernel/k_writable_event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/service/hid/controllers/npad.h" -#include "core/settings.h" namespace Service::HID { constexpr s32 HID_JOYSTICK_MAX = 0x7fff; diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 873a0a1e2..14d0ac067 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -8,10 +8,10 @@ #include <atomic> #include "common/bit_field.h" #include "common/common_types.h" +#include "common/settings.h" #include "core/frontend/input.h" #include "core/hle/kernel/object.h" #include "core/hle/service/hid/controllers/controller_base.h" -#include "core/settings.h" namespace Kernel { class KEvent; diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index be60492a4..b5f8077be 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -6,11 +6,11 @@ #include <cstring> #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" #include "core/frontend/input.h" #include "core/hle/service/hid/controllers/touchscreen.h" -#include "core/settings.h" namespace Service::HID { constexpr std::size_t SHARED_MEMORY_OFFSET = 0x400; diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index a1a779cc0..4c1c0ac68 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -5,6 +5,7 @@ #include <array> #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/core_timing.h" #include "core/core_timing_util.h" @@ -23,7 +24,6 @@ #include "core/hle/service/hid/irs.h" #include "core/hle/service/hid/xcd.h" #include "core/hle/service/service.h" -#include "core/settings.h" #include "core/hle/service/hid/controllers/controller_base.h" #include "core/hle/service/hid/controllers/debug_pad.h" diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index 6ab35de47..44a5d5789 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp @@ -5,12 +5,12 @@ #include <memory> #include "common/logging/log.h" +#include "common/settings.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/hle_ipc.h" #include "core/hle/service/nfc/nfc.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" -#include "core/settings.h" namespace Service::NFC { diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index afb3342d6..9f110df8e 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" @@ -10,7 +11,6 @@ #include "core/hle/service/nifm/nifm.h" #include "core/hle/service/service.h" #include "core/network/network.h" -#include "core/settings.h" namespace Service::NIFM { diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 5fe7a9189..e373609a1 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" @@ -14,7 +15,6 @@ #include "core/hle/service/ns/ns.h" #include "core/hle/service/ns/pl_u.h" #include "core/hle/service/set/set.h" -#include "core/settings.h" namespace Service::NS { diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index ac2906e5b..539b02bc4 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -9,6 +9,7 @@ #include "common/logging/log.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "common/thread.h" #include "core/core.h" #include "core/core_timing.h" @@ -23,7 +24,6 @@ #include "core/hle/service/vi/display/vi_display.h" #include "core/hle/service/vi/layer/vi_layer.h" #include "core/perf_stats.h" -#include "core/settings.h" #include "video_core/renderer_base.h" namespace Service::NVFlinger { diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index aec399076..41a502d8d 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -6,6 +6,7 @@ #include <fmt/format.h> #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/hle/ipc.h" @@ -70,7 +71,6 @@ #include "core/hle/service/vi/vi.h" #include "core/hle/service/wlan/wlan.h" #include "core/reporter.h" -#include "core/settings.h" namespace Service { diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index d953b4303..bc7dc776f 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp @@ -6,9 +6,9 @@ #include <array> #include <chrono> #include "common/logging/log.h" +#include "common/settings.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/set/set.h" -#include "core/settings.h" namespace Service::Set { namespace { diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp index 6903dd534..b1552c3f0 100644 --- a/src/core/hle/service/spl/module.cpp +++ b/src/core/hle/service/spl/module.cpp @@ -9,11 +9,11 @@ #include <functional> #include <vector> #include "common/logging/log.h" +#include "common/settings.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/spl/csrng.h" #include "core/hle/service/spl/module.h" #include "core/hle/service/spl/spl.h" -#include "core/settings.h" namespace Service::SPL { diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index 51becd074..f89c5aaad 100644 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp @@ -5,12 +5,12 @@ #include <chrono> #include <ctime> +#include "common/settings.h" #include "common/time_zone.h" #include "core/hle/service/time/ephemeral_network_system_clock_context_writer.h" #include "core/hle/service/time/local_system_clock_context_writer.h" #include "core/hle/service/time/network_system_clock_context_writer.h" #include "core/hle/service/time/time_manager.h" -#include "core/settings.h" namespace Service::Time { diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp index 4177d0a41..3c8e71a3c 100644 --- a/src/core/hle/service/time/time_zone_content_manager.cpp +++ b/src/core/hle/service/time/time_zone_content_manager.cpp @@ -5,6 +5,7 @@ #include <sstream> #include "common/logging/log.h" +#include "common/settings.h" #include "common/time_zone.h" #include "core/core.h" #include "core/file_sys/content_archive.h" @@ -15,7 +16,6 @@ #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/time/time_manager.h" #include "core/hle/service/time/time_zone_content_manager.h" -#include "core/settings.h" namespace Service::Time::TimeZone { diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index a1a7ac987..348360b51 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -15,6 +15,7 @@ #include "common/common_funcs.h" #include "common/logging/log.h" #include "common/math_util.h" +#include "common/settings.h" #include "common/swap.h" #include "core/core_timing.h" #include "core/hle/ipc_helpers.h" @@ -30,7 +31,6 @@ #include "core/hle/service/vi/vi_m.h" #include "core/hle/service/vi/vi_s.h" #include "core/hle/service/vi/vi_u.h" -#include "core/settings.h" namespace Service::VI { diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 14618cb40..0115ed0c4 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp @@ -9,6 +9,7 @@ #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "common/swap.h" #include "core/core.h" #include "core/file_sys/control_metadata.h" @@ -22,7 +23,6 @@ #include "core/loader/nro.h" #include "core/loader/nso.h" #include "core/memory.h" -#include "core/settings.h" namespace Loader { diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index cbd048695..0c83dd666 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -11,6 +11,7 @@ #include "common/hex_util.h" #include "common/logging/log.h" #include "common/lz4_compression.h" +#include "common/settings.h" #include "common/swap.h" #include "core/core.h" #include "core/file_sys/patch_manager.h" @@ -20,7 +21,6 @@ #include "core/hle/kernel/process.h" #include "core/loader/nso.h" #include "core/memory.h" -#include "core/settings.h" namespace Loader { namespace { diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index b93396a80..c92337079 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp @@ -13,8 +13,8 @@ #include <fmt/format.h> #include "common/file_util.h" #include "common/math_util.h" +#include "common/settings.h" #include "core/perf_stats.h" -#include "core/settings.h" using namespace std::chrono_literals; using DoubleSecs = std::chrono::duration<double, std::chrono::seconds::period>; diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp index 74fb32814..311d4dda8 100644 --- a/src/core/reporter.cpp +++ b/src/core/reporter.cpp @@ -14,6 +14,7 @@ #include "common/file_util.h" #include "common/hex_util.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "core/arm/arm_interface.h" #include "core/core.h" #include "core/hle/kernel/hle_ipc.h" @@ -22,7 +23,6 @@ #include "core/hle/result.h" #include "core/memory.h" #include "core/reporter.h" -#include "core/settings.h" namespace { diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index d11b15f38..6dcff5400 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -12,10 +12,10 @@ #include "common/file_util.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" #include "core/loader/loader.h" -#include "core/settings.h" #include "core/telemetry_session.h" #ifdef ENABLE_WEB_SERVICE diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index 38ab31898..c3cfe7efc 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt @@ -9,8 +9,6 @@ add_library(input_common STATIC motion_from_button.h motion_input.cpp motion_input.h - settings.cpp - settings.h touch_from_button.cpp touch_from_button.h gcadapter/gc_adapter.cpp diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp index 770893687..f8ec179d0 100755 --- a/src/input_common/analog_from_button.cpp +++ b/src/input_common/analog_from_button.cpp @@ -7,7 +7,7 @@ #include <cmath> #include <thread> #include "common/math_util.h" -#include "core/settings.h" +#include "common/settings.h" #include "input_common/analog_from_button.h" namespace InputCommon { diff --git a/src/input_common/gcadapter/gc_adapter.cpp b/src/input_common/gcadapter/gc_adapter.cpp index d80195c82..ec3167bea 100644 --- a/src/input_common/gcadapter/gc_adapter.cpp +++ b/src/input_common/gcadapter/gc_adapter.cpp @@ -16,8 +16,8 @@ #include "common/logging/log.h" #include "common/param_package.h" +#include "common/settings_input.h" #include "input_common/gcadapter/gc_adapter.h" -#include "input_common/settings.h" namespace GCAdapter { diff --git a/src/input_common/mouse/mouse_input.cpp b/src/input_common/mouse/mouse_input.cpp index 329e416c7..fff1c6b45 100644 --- a/src/input_common/mouse/mouse_input.cpp +++ b/src/input_common/mouse/mouse_input.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "core/settings.h" +#include "common/settings.h" #include "input_common/mouse/mouse_input.h" namespace MouseInput { diff --git a/src/input_common/mouse/mouse_poller.cpp b/src/input_common/mouse/mouse_poller.cpp index 0e1db54fb..d96104a4e 100644 --- a/src/input_common/mouse/mouse_poller.cpp +++ b/src/input_common/mouse/mouse_poller.cpp @@ -5,8 +5,8 @@ #include <mutex> #include <utility> +#include "common/settings.h" #include "common/threadsafe_queue.h" -#include "core/settings.h" #include "input_common/mouse/mouse_input.h" #include "input_common/mouse/mouse_poller.h" diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index f67de37e3..8bca71731 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -20,11 +20,11 @@ #include <SDL.h> #include "common/logging/log.h" #include "common/param_package.h" +#include "common/settings_input.h" #include "common/threadsafe_queue.h" #include "core/frontend/input.h" #include "input_common/motion_input.h" #include "input_common/sdl/sdl_impl.h" -#include "input_common/settings.h" namespace InputCommon::SDL { diff --git a/src/input_common/touch_from_button.cpp b/src/input_common/touch_from_button.cpp index ffbe4f2ed..e94ba197b 100644 --- a/src/input_common/touch_from_button.cpp +++ b/src/input_common/touch_from_button.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/frontend/framebuffer_layout.h" -#include "core/settings.h" #include "input_common/touch_from_button.h" namespace InputCommon { diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index e72df924b..8a38a380d 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp @@ -9,7 +9,7 @@ #include <thread> #include <boost/asio.hpp> #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" #include "input_common/udp/client.h" #include "input_common/udp/protocol.h" diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 4de1e37e5..32dcbd693 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -20,8 +20,8 @@ #include "common/div_ceil.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/memory.h" -#include "core/settings.h" #include "video_core/buffer_cache/buffer_base.h" #include "video_core/delayed_destruction_ring.h" #include "video_core/dirty_flags.h" diff --git a/src/video_core/engines/engine_interface.h b/src/video_core/engines/engine_interface.h index 18a9db7e6..c7ffd68c5 100644 --- a/src/video_core/engines/engine_interface.h +++ b/src/video_core/engines/engine_interface.h @@ -4,13 +4,14 @@ #pragma once -#include <type_traits> #include "common/common_types.h" namespace Tegra::Engines { class EngineInterface { public: + virtual ~EngineInterface() = default; + /// Write the value to the register identified by method. virtual void CallMethod(u32 method, u32 method_argument, bool is_last_call) = 0; diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h index c808a577d..a4170ffff 100644 --- a/src/video_core/engines/fermi_2d.h +++ b/src/video_core/engines/fermi_2d.h @@ -35,7 +35,7 @@ namespace Tegra::Engines { class Fermi2D final : public EngineInterface { public: explicit Fermi2D(); - ~Fermi2D(); + ~Fermi2D() override; /// Binds a rasterizer to this engine. void BindRasterizer(VideoCore::RasterizerInterface* rasterizer); diff --git a/src/video_core/engines/kepler_memory.h b/src/video_core/engines/kepler_memory.h index 19808a5c6..0d8ea09a9 100644 --- a/src/video_core/engines/kepler_memory.h +++ b/src/video_core/engines/kepler_memory.h @@ -36,7 +36,7 @@ namespace Tegra::Engines { class KeplerMemory final : public EngineInterface { public: explicit KeplerMemory(Core::System& system_, MemoryManager& memory_manager); - ~KeplerMemory(); + ~KeplerMemory() override; /// Write the value to the register identified by method. void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index a2f19559f..2ee980bab 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -4,8 +4,8 @@ #include "common/assert.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_dma.h" #include "video_core/memory_manager.h" diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h index 3c59eeb13..c77f02a22 100644 --- a/src/video_core/engines/maxwell_dma.h +++ b/src/video_core/engines/maxwell_dma.h @@ -188,7 +188,7 @@ public: static_assert(sizeof(RemapConst) == 12); explicit MaxwellDMA(Core::System& system_, MemoryManager& memory_manager_); - ~MaxwellDMA(); + ~MaxwellDMA() override; /// Write the value to the register identified by method. void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 009c6f574..9bdb282d2 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -6,13 +6,13 @@ #include "common/assert.h" #include "common/microprofile.h" +#include "common/settings.h" #include "core/core.h" #include "core/core_timing.h" #include "core/core_timing_util.h" #include "core/frontend/emu_window.h" #include "core/hardware_interrupt_manager.h" #include "core/memory.h" -#include "core/settings.h" #include "video_core/engines/fermi_2d.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/kepler_memory.h" diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 7addfbc7b..cd1fbb9bf 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -5,10 +5,10 @@ #include "common/assert.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "common/thread.h" #include "core/core.h" #include "core/frontend/emu_window.h" -#include "core/settings.h" #include "video_core/dma_pusher.h" #include "video_core/gpu.h" #include "video_core/gpu_thread.h" diff --git a/src/video_core/macro/macro.cpp b/src/video_core/macro/macro.cpp index cd21a2112..d7fabe605 100644 --- a/src/video_core/macro/macro.cpp +++ b/src/video_core/macro/macro.cpp @@ -6,7 +6,7 @@ #include <boost/container_hash/hash.hpp> #include "common/assert.h" #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/macro/macro.h" #include "video_core/macro/macro_hle.h" diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index 203f2af05..aac851253 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h @@ -16,8 +16,8 @@ #include <vector> #include "common/assert.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/gpu.h" #include "video_core/memory_manager.h" @@ -208,9 +208,9 @@ public: private: /// Flushes a memory range to guest memory and removes it from the cache. void FlushAndRemoveRegion(VAddr addr, std::size_t size) { - const u64 addr_begin = static_cast<u64>(addr); - const u64 addr_end = addr_begin + static_cast<u64>(size); - const auto in_range = [addr_begin, addr_end](CachedQuery& query) { + const u64 addr_begin = addr; + const u64 addr_end = addr_begin + size; + const auto in_range = [addr_begin, addr_end](const CachedQuery& query) { const u64 cache_begin = query.GetCpuAddr(); const u64 cache_end = cache_begin + query.SizeInBytes(); return cache_begin < addr_end && addr_begin < cache_end; @@ -230,8 +230,7 @@ private: rasterizer.UpdatePagesCachedCount(query.GetCpuAddr(), query.SizeInBytes(), -1); query.Flush(); } - contents.erase(std::remove_if(std::begin(contents), std::end(contents), in_range), - std::end(contents)); + std::erase_if(contents, in_range); } } diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index a93a1732c..c9a360aaf 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -3,8 +3,8 @@ // Refer to the license.txt file included. #include "common/logging/log.h" +#include "common/settings.h" #include "core/frontend/emu_window.h" -#include "core/settings.h" #include "video_core/renderer_base.h" namespace VideoCore { diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 5776fccdc..b113f54db 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -16,7 +16,7 @@ #include "common/logging/log.h" #include "common/scope_exit.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/renderer_opengl/gl_device.h" #include "video_core/renderer_opengl/gl_resource_manager.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 4610fd160..0863904e9 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -17,10 +17,10 @@ #include "common/math_util.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" #include "core/hle/kernel/process.h" #include "core/memory.h" -#include "core/settings.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/engines/shader_type.h" diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 955b2abc4..97fb11ac6 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -12,10 +12,10 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "common/zstd_compression.h" #include "core/core.h" #include "core/hle/kernel/process.h" -#include "core/settings.h" #include "video_core/engines/shader_type.h" #include "video_core/renderer_opengl/gl_shader_cache.h" #include "video_core/renderer_opengl/gl_shader_disk_cache.h" diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 9d2acd4d9..cc2e499f9 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -13,13 +13,13 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/microprofile.h" +#include "common/settings.h" #include "common/telemetry.h" #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" #include "core/memory.h" #include "core/perf_stats.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "video_core/host_shaders/opengl_present_frag.h" #include "video_core/host_shaders/opengl_present_vert.h" diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index 14e5f36e2..2e0cf4232 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -13,11 +13,11 @@ #include <fmt/format.h> #include "common/logging/log.h" +#include "common/settings.h" #include "common/telemetry.h" #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/emu_window.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "video_core/gpu.h" #include "video_core/renderer_vulkan/renderer_vulkan.h" diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp index 56ec5e380..db78ce3d9 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.cpp +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.cpp @@ -5,7 +5,7 @@ #include <atomic> #include <chrono> -#include "core/settings.h" +#include "common/settings.h" #include "video_core/renderer_vulkan/vk_master_semaphore.h" #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h index 2c7ed654d..4b6d64daa 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h @@ -35,8 +35,8 @@ public: } /// Returns true when a tick has been hit by the GPU. - [[nodiscard]] bool IsFree(u64 tick) { - return gpu_tick.load(std::memory_order_relaxed) >= tick; + [[nodiscard]] bool IsFree(u64 tick) const noexcept { + return KnownGpuTick() >= tick; } /// Advance to the logical tick. diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index df5b7b172..e9a0e7811 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -13,8 +13,8 @@ #include "common/logging/log.h" #include "common/microprofile.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/engines/kepler_compute.h" #include "video_core/engines/maxwell_3d.h" #include "video_core/renderer_vulkan/blit_image.h" diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 18155e449..bc2a53841 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -7,6 +7,8 @@ #include <span> #include <vector> +#include "common/bit_cast.h" + #include "video_core/engines/fermi_2d.h" #include "video_core/renderer_vulkan/blit_image.h" #include "video_core/renderer_vulkan/maxwell_to_vk.h" @@ -1062,14 +1064,13 @@ vk::ImageView ImageView::MakeDepthStencilView(VkImageAspectFlags aspect_mask) { Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& tsc) { const auto& device = runtime.device; const bool arbitrary_borders = runtime.device.IsExtCustomBorderColorSupported(); - const std::array<float, 4> color = tsc.BorderColor(); - // C++20 bit_cast - VkClearColorValue border_color; - std::memcpy(&border_color, &color, sizeof(color)); + const auto color = tsc.BorderColor(); + const VkSamplerCustomBorderColorCreateInfoEXT border_ci{ .sType = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT, .pNext = nullptr, - .customBorderColor = border_color, + // TODO: Make use of std::bit_cast once libc++ supports it. + .customBorderColor = Common::BitCast<VkClearColorValue>(color), .format = VK_FORMAT_UNDEFINED, }; const void* pnext = nullptr; diff --git a/src/video_core/texture_cache/image_view_base.cpp b/src/video_core/texture_cache/image_view_base.cpp index f89a40b4c..e8d632f9e 100644 --- a/src/video_core/texture_cache/image_view_base.cpp +++ b/src/video_core/texture_cache/image_view_base.cpp @@ -5,7 +5,7 @@ #include <algorithm> #include "common/assert.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/compatible_formats.h" #include "video_core/surface.h" #include "video_core/texture_cache/formatter.h" diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index c22dd0148..0ab297413 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp @@ -268,16 +268,19 @@ template <u32 GOB_EXTENT> return num_tiles << shift; } -[[nodiscard]] constexpr std::array<u32, MAX_MIP_LEVELS> CalculateLevelSizes(const LevelInfo& info, - u32 num_levels) { +[[nodiscard]] constexpr LevelArray CalculateLevelSizes(const LevelInfo& info, u32 num_levels) { ASSERT(num_levels <= MAX_MIP_LEVELS); - std::array<u32, MAX_MIP_LEVELS> sizes{}; + LevelArray sizes{}; for (u32 level = 0; level < num_levels; ++level) { sizes[level] = CalculateLevelSize(info, level); } return sizes; } +[[nodiscard]] u32 CalculateLevelBytes(const LevelArray& sizes, u32 num_levels) { + return std::reduce(sizes.begin(), sizes.begin() + num_levels, 0U); +} + [[nodiscard]] constexpr LevelInfo MakeLevelInfo(PixelFormat format, Extent3D size, Extent3D block, u32 num_samples, u32 tile_width_spacing) { const auto [samples_x, samples_y] = Samples(num_samples); @@ -566,10 +569,10 @@ void SwizzleBlockLinearImage(Tegra::MemoryManager& gpu_memory, GPUVAddr gpu_addr const u32 num_levels = info.resources.levels; const std::array sizes = CalculateLevelSizes(level_info, num_levels); - size_t guest_offset = std::reduce(sizes.begin(), sizes.begin() + level, 0); + size_t guest_offset = CalculateLevelBytes(sizes, level); const size_t layer_stride = - AlignLayerSize(std::reduce(sizes.begin(), sizes.begin() + num_levels, 0), size, - level_info.block, tile_size.height, info.tile_width_spacing); + AlignLayerSize(CalculateLevelBytes(sizes, num_levels), size, level_info.block, + tile_size.height, info.tile_width_spacing); const size_t subresource_size = sizes[level]; const auto dst_data = std::make_unique<u8[]>(subresource_size); @@ -643,10 +646,10 @@ u32 CalculateLayerSize(const ImageInfo& info) noexcept { info.tile_width_spacing, info.resources.levels); } -std::array<u32, MAX_MIP_LEVELS> CalculateMipLevelOffsets(const ImageInfo& info) noexcept { +LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept { ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS)); const LevelInfo level_info = MakeLevelInfo(info); - std::array<u32, MAX_MIP_LEVELS> offsets{}; + LevelArray offsets{}; u32 offset = 0; for (s32 level = 0; level < info.resources.levels; ++level) { offsets[level] = offset; @@ -812,7 +815,7 @@ std::vector<BufferImageCopy> UnswizzleImage(Tegra::MemoryManager& gpu_memory, GP const Extent2D tile_size = DefaultBlockSize(info.format); const std::array level_sizes = CalculateLevelSizes(level_info, num_levels); const Extent2D gob = GobSize(bpp_log2, info.block.height, info.tile_width_spacing); - const u32 layer_size = std::reduce(level_sizes.begin(), level_sizes.begin() + num_levels, 0); + const u32 layer_size = CalculateLevelBytes(level_sizes, num_levels); const u32 layer_stride = AlignLayerSize(layer_size, size, level_info.block, tile_size.height, info.tile_width_spacing); size_t guest_offset = 0; diff --git a/src/video_core/texture_cache/util.h b/src/video_core/texture_cache/util.h index 4d0072867..cdc5cbc75 100644 --- a/src/video_core/texture_cache/util.h +++ b/src/video_core/texture_cache/util.h @@ -20,6 +20,8 @@ namespace VideoCommon { using Tegra::Texture::TICEntry; +using LevelArray = std::array<u32, MAX_MIP_LEVELS>; + struct OverlapResult { GPUVAddr gpu_addr; VAddr cpu_addr; @@ -36,8 +38,7 @@ struct OverlapResult { [[nodiscard]] u32 CalculateLayerSize(const ImageInfo& info) noexcept; -[[nodiscard]] std::array<u32, MAX_MIP_LEVELS> CalculateMipLevelOffsets( - const ImageInfo& info) noexcept; +[[nodiscard]] LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept; [[nodiscard]] std::vector<u32> CalculateSliceOffsets(const ImageInfo& info); diff --git a/src/video_core/textures/texture.cpp b/src/video_core/textures/texture.cpp index ae5621a7d..a552543ed 100644 --- a/src/video_core/textures/texture.cpp +++ b/src/video_core/textures/texture.cpp @@ -6,7 +6,7 @@ #include <array> #include "common/cityhash.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/textures/texture.h" using Tegra::Texture::TICEntry; diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index e1b38c6ac..3b575db4d 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -5,8 +5,8 @@ #include <memory> #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "video_core/renderer_base.h" #include "video_core/renderer_opengl/renderer_opengl.h" #include "video_core/renderer_vulkan/renderer_vulkan.h" diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 230b8717b..64206b3d2 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -12,7 +12,7 @@ #include <vector> #include "common/assert.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/vulkan_common/nsight_aftermath_tracker.h" #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" diff --git a/src/yuzu/applets/controller.cpp b/src/yuzu/applets/controller.cpp index b92cd6886..836d90fda 100644 --- a/src/yuzu/applets/controller.cpp +++ b/src/yuzu/applets/controller.cpp @@ -16,6 +16,7 @@ #include "yuzu/applets/controller.h" #include "yuzu/configuration/configure_input.h" #include "yuzu/configuration/configure_input_profile_dialog.h" +#include "yuzu/configuration/configure_motion_touch.h" #include "yuzu/configuration/configure_vibration.h" #include "yuzu/configuration/input_profiles.h" #include "yuzu/main.h" @@ -206,6 +207,9 @@ QtControllerSelectorDialog::QtControllerSelectorDialog( connect(ui->vibrationButton, &QPushButton::clicked, this, &QtControllerSelectorDialog::CallConfigureVibrationDialog); + connect(ui->motionButton, &QPushButton::clicked, this, + &QtControllerSelectorDialog::CallConfigureMotionTouchDialog); + connect(ui->inputConfigButton, &QPushButton::clicked, this, &QtControllerSelectorDialog::CallConfigureInputProfileDialog); @@ -276,6 +280,18 @@ void QtControllerSelectorDialog::CallConfigureVibrationDialog() { } } +void QtControllerSelectorDialog::CallConfigureMotionTouchDialog() { + ConfigureMotionTouch dialog(this, input_subsystem); + + dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | + Qt::WindowSystemMenuHint); + dialog.setWindowModality(Qt::WindowModal); + + if (dialog.exec() == QDialog::Accepted) { + dialog.ApplyConfiguration(); + } +} + void QtControllerSelectorDialog::CallConfigureInputProfileDialog() { ConfigureInputProfileDialog dialog(this, input_subsystem, input_profiles.get()); diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h index 3518eed56..9b57aea1a 100644 --- a/src/yuzu/applets/controller.h +++ b/src/yuzu/applets/controller.h @@ -51,6 +51,9 @@ private: // Initializes the "Configure Vibration" Dialog. void CallConfigureVibrationDialog(); + // Initializes the "Configure Motion / Touch" Dialog. + void CallConfigureMotionTouchDialog(); + // Initializes the "Create Input Profile" Dialog. void CallConfigureInputProfileDialog(); diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 15c09e0ad..9c7daeac7 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -29,10 +29,10 @@ #include "common/microprofile.h" #include "common/scm_rev.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "core/core.h" #include "core/frontend/framebuffer_layout.h" #include "core/hle/kernel/process.h" -#include "core/settings.h" #include "input_common/keyboard.h" #include "input_common/main.h" #include "input_common/mouse/mouse_input.h" diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 50ea15e2a..851246233 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -641,6 +641,8 @@ void Config::ReadDebuggingValues() { ReadSetting(QStringLiteral("disable_macro_jit"), false).toBool(); Settings::values.extended_logging = ReadSetting(QStringLiteral("extended_logging"), false).toBool(); + Settings::values.use_debug_asserts = + ReadSetting(QStringLiteral("use_debug_asserts"), false).toBool(); Settings::values.use_auto_stub = ReadSetting(QStringLiteral("use_auto_stub"), false).toBool(); qt_config->endGroup(); @@ -1238,6 +1240,7 @@ void Config::SaveDebuggingValues() { WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false); WriteSetting(QStringLiteral("dump_nso"), Settings::values.dump_nso, false); WriteSetting(QStringLiteral("quest_flag"), Settings::values.quest_flag, false); + WriteSetting(QStringLiteral("use_debug_asserts"), Settings::values.use_debug_asserts, false); WriteSetting(QStringLiteral("disable_macro_jit"), Settings::values.disable_macro_jit, false); qt_config->endGroup(); @@ -1599,7 +1602,7 @@ void Config::Reload() { ReadValues(); // To apply default value changes SaveValues(); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } void Config::Save() { diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 949c4eb13..5a2c026b3 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h @@ -9,7 +9,7 @@ #include <string> #include <QMetaType> #include <QVariant> -#include "core/settings.h" +#include "common/settings.h" #include "yuzu/uisettings.h" class QSettings; @@ -131,6 +131,6 @@ private: bool global; }; -// These metatype declarations cannot be in core/settings.h because core is devoid of QT +// These metatype declarations cannot be in common/settings.h because core is devoid of QT Q_DECLARE_METATYPE(Settings::RendererBackend); Q_DECLARE_METATYPE(Settings::GPUAccuracy); diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index 18482795c..89be4a62d 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp @@ -6,7 +6,7 @@ #include <QComboBox> #include <QObject> #include <QString> -#include "core/settings.h" +#include "common/settings.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_per_game.h" diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index 312b9e549..5b344cdbd 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h @@ -7,7 +7,7 @@ #include <QCheckBox> #include <QComboBox> #include <QString> -#include "core/settings.h" +#include "common/settings.h" namespace ConfigurationShared { diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index db9518798..f9507e228 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp @@ -8,8 +8,8 @@ #include "audio_core/sink.h" #include "audio_core/sink_details.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_audio.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_audio.h" diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index d055cbd60..4f99bc80f 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp @@ -7,8 +7,8 @@ #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_cpu.h" #include "yuzu/configuration/configure_cpu.h" diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h index 3c5683d81..ef77b2e7e 100644 --- a/src/yuzu/configuration/configure_cpu.h +++ b/src/yuzu/configuration/configure_cpu.h @@ -6,7 +6,7 @@ #include <memory> #include <QWidget> -#include "core/settings.h" +#include "common/settings.h" namespace Ui { class ConfigureCpu; diff --git a/src/yuzu/configuration/configure_cpu_debug.cpp b/src/yuzu/configuration/configure_cpu_debug.cpp index 3385b2cf6..c925c023c 100644 --- a/src/yuzu/configuration/configure_cpu_debug.cpp +++ b/src/yuzu/configuration/configure_cpu_debug.cpp @@ -6,8 +6,8 @@ #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_cpu_debug.h" #include "yuzu/configuration/configure_cpu_debug.h" diff --git a/src/yuzu/configuration/configure_cpu_debug.h b/src/yuzu/configuration/configure_cpu_debug.h index c9941ef3b..10de55099 100644 --- a/src/yuzu/configuration/configure_cpu_debug.h +++ b/src/yuzu/configuration/configure_cpu_debug.h @@ -6,7 +6,7 @@ #include <memory> #include <QWidget> -#include "core/settings.h" +#include "common/settings.h" namespace Ui { class ConfigureCpuDebug; diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 3a09f74ff..6730eb356 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -7,8 +7,8 @@ #include "common/file_util.h" #include "common/logging/backend.h" #include "common/logging/filter.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_debug.h" #include "yuzu/configuration/configure_debug.h" #include "yuzu/debugger/console.h" @@ -34,6 +34,7 @@ void ConfigureDebug::SetConfiguration() { ui->homebrew_args_edit->setText(QString::fromStdString(Settings::values.program_args)); ui->reporting_services->setChecked(Settings::values.reporting_services); ui->quest_flag->setChecked(Settings::values.quest_flag); + ui->use_debug_asserts->setChecked(Settings::values.use_debug_asserts); ui->use_auto_stub->setChecked(Settings::values.use_auto_stub); ui->enable_graphics_debugging->setEnabled(!Core::System::GetInstance().IsPoweredOn()); ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug); @@ -48,6 +49,7 @@ void ConfigureDebug::ApplyConfiguration() { Settings::values.program_args = ui->homebrew_args_edit->text().toStdString(); Settings::values.reporting_services = ui->reporting_services->isChecked(); Settings::values.quest_flag = ui->quest_flag->isChecked(); + Settings::values.use_debug_asserts = ui->use_debug_asserts->isChecked(); Settings::values.use_auto_stub = ui->use_auto_stub->isChecked(); Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); Settings::values.disable_macro_jit = ui->disable_macro_jit->isChecked(); diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index ae48b728c..d812858b6 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui @@ -186,6 +186,13 @@ </widget> </item> <item> + <widget class="QCheckBox" name="use_debug_asserts"> + <property name="text"> + <string>Enable Debug Asserts</string> + </property> + </widget> + </item> + <item> <widget class="QCheckBox" name="use_auto_stub"> <property name="text"> <string>Enable Auto-Stub</string> diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index d6b17a28d..3ad40d2b3 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp @@ -5,8 +5,8 @@ #include <QHash> #include <QListWidgetItem> #include <QSignalBlocker> +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure.h" #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_dialog.h" @@ -55,7 +55,7 @@ void ConfigureDialog::ApplyConfiguration() { ui->debugTab->ApplyConfiguration(); ui->webTab->ApplyConfiguration(); ui->serviceTab->ApplyConfiguration(); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); Settings::LogSettings(); } diff --git a/src/yuzu/configuration/configure_filesystem.cpp b/src/yuzu/configuration/configure_filesystem.cpp index 58f644af4..006eda4b0 100644 --- a/src/yuzu/configuration/configure_filesystem.cpp +++ b/src/yuzu/configuration/configure_filesystem.cpp @@ -6,7 +6,7 @@ #include <QMessageBox> #include "common/common_paths.h" #include "common/file_util.h" -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_filesystem.h" #include "yuzu/configuration/configure_filesystem.h" #include "yuzu/uisettings.h" diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index d4d29d422..2fa88dcec 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -4,8 +4,8 @@ #include <QCheckBox> #include <QSpinBox> +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_general.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_general.h" diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 8a2008b2a..0a7536617 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -11,8 +11,8 @@ #include "common/common_types.h" #include "common/logging/log.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_graphics.h" #include "video_core/vulkan_common/vulkan_instance.h" #include "video_core/vulkan_common/vulkan_library.h" diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index 1fefc88eb..c162048a2 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h @@ -8,7 +8,7 @@ #include <vector> #include <QString> #include <QWidget> -#include "core/settings.h" +#include "common/settings.h" namespace ConfigurationShared { enum class CheckState; diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index 383c7bac8..c67609b0e 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_graphics_advanced.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_graphics_advanced.h" diff --git a/src/yuzu/configuration/configure_hotkeys.cpp b/src/yuzu/configuration/configure_hotkeys.cpp index cbee51a5e..ed76fe18e 100644 --- a/src/yuzu/configuration/configure_hotkeys.cpp +++ b/src/yuzu/configuration/configure_hotkeys.cpp @@ -5,7 +5,7 @@ #include <QMenu> #include <QMessageBox> #include <QStandardItemModel> -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_hotkeys.h" #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_hotkeys.h" diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index a1a0eb676..d8d3b83dc 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp @@ -3,8 +3,8 @@ // Refer to the license.txt file included. #include <QColorDialog> +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_input_advanced.h" #include "yuzu/configuration/configure_input_advanced.h" diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index efe953fbc..c7d101682 100644 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h @@ -14,7 +14,7 @@ #include <QWidget> #include "common/param_package.h" -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_input.h" class QCheckBox; diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index 91c3343f1..51bb84eb6 100644 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h @@ -7,8 +7,8 @@ #include <array> #include <QFrame> #include <QPointer> +#include "common/settings.h" #include "core/frontend/input.h" -#include "core/settings.h" class QLabel; diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp index 083d1ea43..6a5d625df 100644 --- a/src/yuzu/configuration/configure_motion_touch.cpp +++ b/src/yuzu/configuration/configure_motion_touch.cpp @@ -14,7 +14,7 @@ #include <QVBoxLayout> #include "common/logging/log.h" -#include "core/settings.h" +#include "common/settings.h" #include "input_common/main.h" #include "input_common/udp/client.h" #include "input_common/udp/udp.h" diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index f598513df..bd91ebc42 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -57,7 +57,7 @@ void ConfigurePerGame::ApplyConfiguration() { ui->graphicsAdvancedTab->ApplyConfiguration(); ui->audioTab->ApplyConfiguration(); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); Settings::LogSettings(); game_config->Save(); diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp index 51647a028..d61b5e29b 100644 --- a/src/yuzu/configuration/configure_profile_manager.cpp +++ b/src/yuzu/configuration/configure_profile_manager.cpp @@ -13,10 +13,10 @@ #include <QVBoxLayout> #include "common/assert.h" #include "common/file_util.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" #include "ui_configure_profile_manager.h" #include "yuzu/configuration/configure_profile_manager.h" #include "yuzu/util/limitable_input_dialog.h" @@ -180,7 +180,7 @@ void ConfigureProfileManager::ApplyConfiguration() { return; } - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } void ConfigureProfileManager::SelectUser(const QModelIndex& index) { diff --git a/src/yuzu/configuration/configure_service.cpp b/src/yuzu/configuration/configure_service.cpp index b580cfff2..6d954a67f 100644 --- a/src/yuzu/configuration/configure_service.cpp +++ b/src/yuzu/configuration/configure_service.cpp @@ -4,8 +4,8 @@ #include <QGraphicsItem> #include <QtConcurrent/QtConcurrent> +#include "common/settings.h" #include "core/hle/service/bcat/backend/boxcat.h" -#include "core/settings.h" #include "ui_configure_service.h" #include "yuzu/configuration/configure_service.h" diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 6cf2032da..268ed44c3 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -11,9 +11,9 @@ #include <QMessageBox> #include "common/assert.h" #include "common/file_util.h" +#include "common/settings.h" #include "core/core.h" #include "core/hle/service/time/time.h" -#include "core/settings.h" #include "ui_configure_system.h" #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_system.h" @@ -199,7 +199,7 @@ void ConfigureSystem::ApplyConfiguration() { } } - Settings::Apply(system); + system.ApplySettings(); } void ConfigureSystem::RefreshConsoleID() { diff --git a/src/yuzu/configuration/configure_touch_from_button.cpp b/src/yuzu/configuration/configure_touch_from_button.cpp index 15557e4b8..40129f228 100644 --- a/src/yuzu/configuration/configure_touch_from_button.cpp +++ b/src/yuzu/configuration/configure_touch_from_button.cpp @@ -10,8 +10,8 @@ #include <QStandardItemModel> #include <QTimer> #include "common/param_package.h" +#include "common/settings.h" #include "core/frontend/framebuffer_layout.h" -#include "core/settings.h" #include "input_common/main.h" #include "ui_configure_touch_from_button.h" #include "yuzu/configuration/configure_touch_from_button.h" diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp index aed876008..f35c89e04 100644 --- a/src/yuzu/configuration/configure_ui.cpp +++ b/src/yuzu/configuration/configure_ui.cpp @@ -9,8 +9,8 @@ #include <QDirIterator> #include "common/common_types.h" #include "common/file_util.h" +#include "common/settings.h" #include "core/core.h" -#include "core/settings.h" #include "ui_configure_ui.h" #include "yuzu/configuration/configure_ui.h" #include "yuzu/uisettings.h" @@ -85,7 +85,7 @@ void ConfigureUi::ApplyConfiguration() { UISettings::values.enable_screenshot_save_as = ui->enable_screenshot_save_as->isChecked(); Common::FS::GetUserPath(Common::FS::UserPath::ScreenshotsDir, ui->screenshot_path_edit->text().toStdString()); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } void ConfigureUi::RequestGameListUpdate() { diff --git a/src/yuzu/configuration/configure_vibration.cpp b/src/yuzu/configuration/configure_vibration.cpp index 7dcb2c5b9..9d92c4949 100644 --- a/src/yuzu/configuration/configure_vibration.cpp +++ b/src/yuzu/configuration/configure_vibration.cpp @@ -8,7 +8,7 @@ #include <fmt/format.h> #include "common/param_package.h" -#include "core/settings.h" +#include "common/settings.h" #include "ui_configure_vibration.h" #include "yuzu/configuration/configure_vibration.h" diff --git a/src/yuzu/configuration/configure_web.cpp b/src/yuzu/configuration/configure_web.cpp index 8637f5b3c..f3f3b54d6 100644 --- a/src/yuzu/configuration/configure_web.cpp +++ b/src/yuzu/configuration/configure_web.cpp @@ -5,7 +5,7 @@ #include <QIcon> #include <QMessageBox> #include <QtConcurrent/QtConcurrentRun> -#include "core/settings.h" +#include "common/settings.h" #include "core/telemetry_session.h" #include "ui_configure_web.h" #include "yuzu/configuration/configure_web.h" diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp index 2731d948d..7186eac76 100644 --- a/src/yuzu/debugger/controller.cpp +++ b/src/yuzu/debugger/controller.cpp @@ -5,7 +5,7 @@ #include <QAction> #include <QLayout> #include <QString> -#include "core/settings.h" +#include "common/settings.h" #include "yuzu/configuration/configure_input_player_widget.h" #include "yuzu/debugger/controller.h" diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1dfa111e2..fbf96be03 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -79,6 +79,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #ifdef ARCHITECTURE_x86_64 #include "common/x64/cpu_detect.h" #endif +#include "common/settings.h" #include "common/telemetry.h" #include "core/core.h" #include "core/crypto/key_manager.h" @@ -98,7 +99,6 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "core/hle/service/sm/sm.h" #include "core/loader/loader.h" #include "core/perf_stats.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "input_common/main.h" #include "video_core/gpu.h" @@ -164,7 +164,7 @@ void GMainWindow::ShowTelemetryCallout() { "<br/><br/>Would you like to share your usage data with us?"); if (QMessageBox::question(this, tr("Telemetry"), telemetry_message) != QMessageBox::Yes) { Settings::values.enable_telemetry = false; - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); } } @@ -387,7 +387,7 @@ void GMainWindow::ControllerSelectorReconfigureControllers( emit ControllerSelectorReconfigureFinished(); // Don't forget to apply settings. - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); config->Save(); UpdateStatusButtons(); @@ -652,7 +652,7 @@ void GMainWindow::InitializeWidgets() { Settings::values.use_asynchronous_gpu_emulation.SetValue( !Settings::values.use_asynchronous_gpu_emulation.GetValue()); async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); }); async_status_button->setText(tr("ASYNC")); async_status_button->setCheckable(true); @@ -668,7 +668,7 @@ void GMainWindow::InitializeWidgets() { } Settings::values.use_multi_core.SetValue(!Settings::values.use_multi_core.GetValue()); multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); }); multicore_status_button->setText(tr("MULTICORE")); multicore_status_button->setCheckable(true); @@ -699,7 +699,7 @@ void GMainWindow::InitializeWidgets() { Settings::values.renderer_backend.SetValue(Settings::RendererBackend::OpenGL); } - Settings::Apply(Core::System::GetInstance()); + Core::System::GetInstance().ApplySettings(); }); statusBar()->insertPermanentWidget(0, renderer_status_button); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 43877fc98..2f984d1b8 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -9,8 +9,8 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/param_package.h" +#include "common/settings.h" #include "core/hle/service/acc/profile_manager.h" -#include "core/settings.h" #include "input_common/main.h" #include "input_common/udp/client.h" #include "yuzu_cmd/config.h" @@ -428,6 +428,10 @@ void Config::ReadValues() { Settings::values.reporting_services = sdl2_config->GetBoolean("Debugging", "reporting_services", false); Settings::values.quest_flag = sdl2_config->GetBoolean("Debugging", "quest_flag", false); + Settings::values.use_debug_asserts = + sdl2_config->GetBoolean("Debugging", "use_debug_asserts", false); + Settings::values.use_auto_stub = sdl2_config->GetBoolean("Debugging", "use_auto_stub", false); + Settings::values.disable_macro_jit = sdl2_config->GetBoolean("Debugging", "disable_macro_jit", false); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 3ee0e037d..4ce8e08e4 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -325,6 +325,12 @@ dump_nso=false # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode # false: Retail/Normal Mode (default), true: Kiosk Mode quest_flag = +# Determines whether debug asserts should be enabled, which will throw an exception on asserts. +# false: Disabled (default), true: Enabled +use_debug_asserts = +# Determines whether unimplemented HLE service calls should be automatically stubbed. +# false: Disabled (default), true: Enabled +use_auto_stub = # Enables/Disables the macro JIT compiler disable_macro_jit=false diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index a02485c14..a765fa7b3 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -12,9 +12,9 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/scm_rev.h" +#include "common/settings.h" #include "common/string_util.h" #include "core/core.h" -#include "core/settings.h" #include "input_common/keyboard.h" #include "input_common/main.h" #include "video_core/renderer_base.h" diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index 6f9b00461..dfd53e285 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp @@ -11,7 +11,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "common/scm_rev.h" -#include "core/settings.h" +#include "common/settings.h" #include "video_core/renderer_vulkan/renderer_vulkan.h" #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 73a025364..4871ac3bb 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -20,6 +20,7 @@ #include "common/nvidia_flags.h" #include "common/scm_rev.h" #include "common/scope_exit.h" +#include "common/settings.h" #include "common/string_util.h" #include "common/telemetry.h" #include "core/core.h" @@ -29,7 +30,6 @@ #include "core/hle/kernel/process.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" -#include "core/settings.h" #include "core/telemetry_session.h" #include "input_common/main.h" #include "video_core/renderer_base.h" @@ -166,7 +166,7 @@ int main(int argc, char** argv) { InputCommon::InputSubsystem input_subsystem; // Apply the command line arguments - Settings::Apply(system); + system.ApplySettings(); std::unique_ptr<EmuWindow_SDL2> emu_window; switch (Settings::values.renderer_backend.GetValue()) { |