diff options
| -rw-r--r-- | src/core/hle/kernel/k_resource_limit.cpp | 13 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_resource_limit.h | 12 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 44 | ||||
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 24 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/engines/engine_interface.h | 3 | ||||
| -rw-r--r-- | src/video_core/engines/fermi_2d.h | 2 | ||||
| -rw-r--r-- | src/video_core/engines/kepler_memory.h | 2 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_dma.h | 2 | ||||
| -rw-r--r-- | src/yuzu/applets/controller.cpp | 16 | ||||
| -rw-r--r-- | src/yuzu/applets/controller.h | 3 |
11 files changed, 62 insertions, 61 deletions
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 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | // This file references various implementation details from Atmosphere, an open-source firmware for | ||
| 6 | // the Nintendo Switch. Copyright 2018-2020 Atmosphere-NX. | ||
| 7 | |||
| 8 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 9 | #include "core/core.h" | ||
| 10 | #include "core/core_timing.h" | 6 | #include "core/core_timing.h" |
| 11 | #include "core/core_timing_util.h" | ||
| 12 | #include "core/hle/kernel/k_resource_limit.h" | 7 | #include "core/hle/kernel/k_resource_limit.h" |
| 13 | #include "core/hle/kernel/svc_results.h" | 8 | #include "core/hle/kernel/svc_results.h" |
| 14 | 9 | ||
| 15 | namespace Kernel { | 10 | namespace Kernel { |
| 16 | constexpr s64 DefaultTimeout = 10000000000; // 10 seconds | 11 | constexpr s64 DefaultTimeout = 10000000000; // 10 seconds |
| 17 | 12 | ||
| 18 | KResourceLimit::KResourceLimit(KernelCore& kernel, Core::System& system) | 13 | KResourceLimit::KResourceLimit(KernelCore& kernel, const Core::Timing::CoreTiming& core_timing_) |
| 19 | : Object{kernel}, lock{kernel}, cond_var{kernel}, kernel{kernel}, system(system) {} | 14 | : Object{kernel}, lock{kernel}, cond_var{kernel}, core_timing(core_timing_) {} |
| 20 | KResourceLimit::~KResourceLimit() = default; | 15 | KResourceLimit::~KResourceLimit() = default; |
| 21 | 16 | ||
| 22 | s64 KResourceLimit::GetLimitValue(LimitableResource which) const { | 17 | s64 KResourceLimit::GetLimitValue(LimitableResource which) const { |
| @@ -83,7 +78,7 @@ ResultCode KResourceLimit::SetLimitValue(LimitableResource which, s64 value) { | |||
| 83 | } | 78 | } |
| 84 | 79 | ||
| 85 | bool KResourceLimit::Reserve(LimitableResource which, s64 value) { | 80 | bool KResourceLimit::Reserve(LimitableResource which, s64 value) { |
| 86 | return Reserve(which, value, system.CoreTiming().GetGlobalTimeNs().count() + DefaultTimeout); | 81 | return Reserve(which, value, core_timing.GetGlobalTimeNs().count() + DefaultTimeout); |
| 87 | } | 82 | } |
| 88 | 83 | ||
| 89 | bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { | 84 | bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { |
| @@ -114,7 +109,7 @@ bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { | |||
| 114 | } | 109 | } |
| 115 | 110 | ||
| 116 | if (current_hints[index] + value <= limit_values[index] && | 111 | if (current_hints[index] + value <= limit_values[index] && |
| 117 | (timeout < 0 || system.CoreTiming().GetGlobalTimeNs().count() < timeout)) { | 112 | (timeout < 0 || core_timing.GetGlobalTimeNs().count() < timeout)) { |
| 118 | waiter_count++; | 113 | waiter_count++; |
| 119 | cond_var.Wait(&lock, timeout); | 114 | cond_var.Wait(&lock, timeout); |
| 120 | waiter_count--; | 115 | 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 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | // This file references various implementation details from Atmosphere, an open-source firmware for | ||
| 6 | // the Nintendo Switch. Copyright 2018-2020 Atmosphere-NX. | ||
| 7 | |||
| 8 | #pragma once | 5 | #pragma once |
| 9 | 6 | ||
| 10 | #include <array> | 7 | #include <array> |
| @@ -15,8 +12,8 @@ | |||
| 15 | 12 | ||
| 16 | union ResultCode; | 13 | union ResultCode; |
| 17 | 14 | ||
| 18 | namespace Core { | 15 | namespace Core::Timing { |
| 19 | class System; | 16 | class CoreTiming; |
| 20 | } | 17 | } |
| 21 | 18 | ||
| 22 | namespace Kernel { | 19 | namespace Kernel { |
| @@ -37,7 +34,7 @@ constexpr bool IsValidResourceType(LimitableResource type) { | |||
| 37 | 34 | ||
| 38 | class KResourceLimit final : public Object { | 35 | class KResourceLimit final : public Object { |
| 39 | public: | 36 | public: |
| 40 | explicit KResourceLimit(KernelCore& kernel, Core::System& system); | 37 | explicit KResourceLimit(KernelCore& kernel, const Core::Timing::CoreTiming& core_timing_); |
| 41 | ~KResourceLimit(); | 38 | ~KResourceLimit(); |
| 42 | 39 | ||
| 43 | s64 GetLimitValue(LimitableResource which) const; | 40 | s64 GetLimitValue(LimitableResource which) const; |
| @@ -75,7 +72,6 @@ private: | |||
| 75 | mutable KLightLock lock; | 72 | mutable KLightLock lock; |
| 76 | s32 waiter_count{}; | 73 | s32 waiter_count{}; |
| 77 | KLightConditionVariable cond_var; | 74 | KLightConditionVariable cond_var; |
| 78 | KernelCore& kernel; | 75 | const Core::Timing::CoreTiming& core_timing; |
| 79 | Core::System& system; | ||
| 80 | }; | 76 | }; |
| 81 | } // namespace Kernel | 77 | } // 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 { | |||
| 67 | is_phantom_mode_for_singlecore = false; | 67 | is_phantom_mode_for_singlecore = false; |
| 68 | 68 | ||
| 69 | InitializePhysicalCores(); | 69 | InitializePhysicalCores(); |
| 70 | InitializeSystemResourceLimit(kernel, system); | 70 | |
| 71 | InitializeMemoryLayout(); | 71 | // Derive the initial memory layout from the emulated board |
| 72 | KMemoryLayout memory_layout; | ||
| 73 | DeriveInitialMemoryLayout(memory_layout); | ||
| 74 | InitializeMemoryLayout(memory_layout); | ||
| 75 | InitializeSystemResourceLimit(kernel, system.CoreTiming(), memory_layout); | ||
| 76 | InitializeSlabHeaps(); | ||
| 72 | InitializeSchedulers(); | 77 | InitializeSchedulers(); |
| 73 | InitializeSuspendThreads(); | 78 | InitializeSuspendThreads(); |
| 74 | InitializePreemption(kernel); | 79 | InitializePreemption(kernel); |
| @@ -137,27 +142,33 @@ struct KernelCore::Impl { | |||
| 137 | } | 142 | } |
| 138 | 143 | ||
| 139 | // Creates the default system resource limit | 144 | // Creates the default system resource limit |
| 140 | void InitializeSystemResourceLimit(KernelCore& kernel, Core::System& system) { | 145 | void InitializeSystemResourceLimit(KernelCore& kernel, |
| 141 | system_resource_limit = std::make_shared<KResourceLimit>(kernel, system); | 146 | const Core::Timing::CoreTiming& core_timing, |
| 147 | const KMemoryLayout& memory_layout) { | ||
| 148 | system_resource_limit = std::make_shared<KResourceLimit>(kernel, core_timing); | ||
| 149 | const auto [total_size, kernel_size] = memory_layout.GetTotalAndKernelMemorySizes(); | ||
| 142 | 150 | ||
| 143 | // If setting the default system values fails, then something seriously wrong has occurred. | 151 | // If setting the default system values fails, then something seriously wrong has occurred. |
| 144 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::PhysicalMemory, 0x100000000) | 152 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::PhysicalMemory, total_size) |
| 145 | .IsSuccess()); | 153 | .IsSuccess()); |
| 146 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Threads, 800).IsSuccess()); | 154 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Threads, 800).IsSuccess()); |
| 147 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Events, 900).IsSuccess()); | 155 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Events, 900).IsSuccess()); |
| 148 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::TransferMemory, 200) | 156 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::TransferMemory, 200) |
| 149 | .IsSuccess()); | 157 | .IsSuccess()); |
| 150 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Sessions, 1133).IsSuccess()); | 158 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Sessions, 1133).IsSuccess()); |
| 159 | system_resource_limit->Reserve(LimitableResource::PhysicalMemory, kernel_size); | ||
| 151 | 160 | ||
| 152 | // Derived from recent software updates. The kernel reserves 27MB | ||
| 153 | constexpr u64 kernel_size{0x1b00000}; | ||
| 154 | if (!system_resource_limit->Reserve(LimitableResource::PhysicalMemory, kernel_size)) { | ||
| 155 | UNREACHABLE(); | ||
| 156 | } | ||
| 157 | // Reserve secure applet memory, introduced in firmware 5.0.0 | 161 | // Reserve secure applet memory, introduced in firmware 5.0.0 |
| 158 | constexpr u64 secure_applet_memory_size{0x400000}; | 162 | constexpr u64 secure_applet_memory_size{Common::Size_4_MB}; |
| 159 | ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemory, | 163 | ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemory, |
| 160 | secure_applet_memory_size)); | 164 | secure_applet_memory_size)); |
| 165 | |||
| 166 | // This memory seems to be reserved on hardware, but is not reserved/used by yuzu. | ||
| 167 | // Likely Horizon OS reserved memory | ||
| 168 | // TODO(ameerj): Derive the memory rather than hardcode it. | ||
| 169 | constexpr u64 unknown_reserved_memory{0x2f896000}; | ||
| 170 | ASSERT(system_resource_limit->Reserve(LimitableResource::PhysicalMemory, | ||
| 171 | unknown_reserved_memory)); | ||
| 161 | } | 172 | } |
| 162 | 173 | ||
| 163 | void InitializePreemption(KernelCore& kernel) { | 174 | void InitializePreemption(KernelCore& kernel) { |
| @@ -531,11 +542,7 @@ struct KernelCore::Impl { | |||
| 531 | linear_region_start); | 542 | linear_region_start); |
| 532 | } | 543 | } |
| 533 | 544 | ||
| 534 | void InitializeMemoryLayout() { | 545 | void InitializeMemoryLayout(const KMemoryLayout& memory_layout) { |
| 535 | // Derive the initial memory layout from the emulated board | ||
| 536 | KMemoryLayout memory_layout; | ||
| 537 | DeriveInitialMemoryLayout(memory_layout); | ||
| 538 | |||
| 539 | const auto system_pool = memory_layout.GetKernelSystemPoolRegionPhysicalExtents(); | 546 | const auto system_pool = memory_layout.GetKernelSystemPoolRegionPhysicalExtents(); |
| 540 | const auto applet_pool = memory_layout.GetKernelAppletPoolRegionPhysicalExtents(); | 547 | const auto applet_pool = memory_layout.GetKernelAppletPoolRegionPhysicalExtents(); |
| 541 | const auto application_pool = memory_layout.GetKernelApplicationPoolRegionPhysicalExtents(); | 548 | const auto application_pool = memory_layout.GetKernelApplicationPoolRegionPhysicalExtents(); |
| @@ -578,11 +585,14 @@ struct KernelCore::Impl { | |||
| 578 | system.Kernel(), system.DeviceMemory(), nullptr, {time_phys_addr, time_size / PageSize}, | 585 | system.Kernel(), system.DeviceMemory(), nullptr, {time_phys_addr, time_size / PageSize}, |
| 579 | KMemoryPermission::None, KMemoryPermission::Read, time_phys_addr, time_size, | 586 | KMemoryPermission::None, KMemoryPermission::Read, time_phys_addr, time_size, |
| 580 | "Time:SharedMemory"); | 587 | "Time:SharedMemory"); |
| 588 | } | ||
| 581 | 589 | ||
| 590 | void InitializeSlabHeaps() { | ||
| 582 | // Allocate slab heaps | 591 | // Allocate slab heaps |
| 583 | user_slab_heap_pages = std::make_unique<KSlabHeap<Page>>(); | 592 | user_slab_heap_pages = std::make_unique<KSlabHeap<Page>>(); |
| 584 | 593 | ||
| 585 | constexpr u64 user_slab_heap_size{0x1ef000}; | 594 | // TODO(ameerj): This should be derived, not hardcoded within the kernel |
| 595 | constexpr u64 user_slab_heap_size{0x3de000}; | ||
| 586 | // Reserve slab heaps | 596 | // Reserve slab heaps |
| 587 | ASSERT( | 597 | ASSERT( |
| 588 | system_resource_limit->Reserve(LimitableResource::PhysicalMemory, user_slab_heap_size)); | 598 | 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 420888439..e35deb8e2 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -120,9 +120,7 @@ std::shared_ptr<Process> Process::Create(Core::System& system, std::string name, | |||
| 120 | std::shared_ptr<Process> process = std::make_shared<Process>(system); | 120 | std::shared_ptr<Process> process = std::make_shared<Process>(system); |
| 121 | process->name = std::move(name); | 121 | process->name = std::move(name); |
| 122 | 122 | ||
| 123 | // TODO: This is inaccurate | 123 | process->resource_limit = kernel.GetSystemResourceLimit(); |
| 124 | // The process should hold a reference to the kernel-wide resource limit. | ||
| 125 | process->resource_limit = std::make_shared<KResourceLimit>(kernel, system); | ||
| 126 | process->status = ProcessStatus::Created; | 124 | process->status = ProcessStatus::Created; |
| 127 | process->program_id = 0; | 125 | process->program_id = 0; |
| 128 | process->process_id = type == ProcessType::KernelInternal ? kernel.CreateNewKernelProcessID() | 126 | process->process_id = type == ProcessType::KernelInternal ? kernel.CreateNewKernelProcessID() |
| @@ -160,17 +158,13 @@ void Process::DecrementThreadCount() { | |||
| 160 | } | 158 | } |
| 161 | 159 | ||
| 162 | u64 Process::GetTotalPhysicalMemoryAvailable() const { | 160 | u64 Process::GetTotalPhysicalMemoryAvailable() const { |
| 163 | // TODO: This is expected to always return the application memory pool size after accurately | ||
| 164 | // reserving kernel resources. The current workaround uses a process-local resource limit of | ||
| 165 | // application memory pool size, which is inaccurate. | ||
| 166 | const u64 capacity{resource_limit->GetFreeValue(LimitableResource::PhysicalMemory) + | 161 | const u64 capacity{resource_limit->GetFreeValue(LimitableResource::PhysicalMemory) + |
| 167 | page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + | 162 | page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + |
| 168 | main_thread_stack_size}; | 163 | main_thread_stack_size}; |
| 169 | 164 | ASSERT(capacity == kernel.MemoryManager().GetSize(KMemoryManager::Pool::Application)); | |
| 170 | if (capacity < memory_usage_capacity) { | 165 | if (capacity < memory_usage_capacity) { |
| 171 | return capacity; | 166 | return capacity; |
| 172 | } | 167 | } |
| 173 | |||
| 174 | return memory_usage_capacity; | 168 | return memory_usage_capacity; |
| 175 | } | 169 | } |
| 176 | 170 | ||
| @@ -272,10 +266,6 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, | |||
| 272 | system_resource_size = metadata.GetSystemResourceSize(); | 266 | system_resource_size = metadata.GetSystemResourceSize(); |
| 273 | image_size = code_size; | 267 | image_size = code_size; |
| 274 | 268 | ||
| 275 | // Set initial resource limits | ||
| 276 | resource_limit->SetLimitValue( | ||
| 277 | LimitableResource::PhysicalMemory, | ||
| 278 | kernel.MemoryManager().GetSize(KMemoryManager::Pool::Application)); | ||
| 279 | KScopedResourceReservation memory_reservation(resource_limit, LimitableResource::PhysicalMemory, | 269 | KScopedResourceReservation memory_reservation(resource_limit, LimitableResource::PhysicalMemory, |
| 280 | code_size + system_resource_size); | 270 | code_size + system_resource_size); |
| 281 | if (!memory_reservation.Succeeded()) { | 271 | if (!memory_reservation.Succeeded()) { |
| @@ -324,16 +314,6 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, | |||
| 324 | UNREACHABLE(); | 314 | UNREACHABLE(); |
| 325 | } | 315 | } |
| 326 | 316 | ||
| 327 | // Set initial resource limits | ||
| 328 | resource_limit->SetLimitValue( | ||
| 329 | LimitableResource::PhysicalMemory, | ||
| 330 | kernel.MemoryManager().GetSize(KMemoryManager::Pool::Application)); | ||
| 331 | |||
| 332 | resource_limit->SetLimitValue(LimitableResource::Threads, 608); | ||
| 333 | resource_limit->SetLimitValue(LimitableResource::Events, 700); | ||
| 334 | resource_limit->SetLimitValue(LimitableResource::TransferMemory, 128); | ||
| 335 | resource_limit->SetLimitValue(LimitableResource::Sessions, 894); | ||
| 336 | |||
| 337 | // Create TLS region | 317 | // Create TLS region |
| 338 | tls_region_address = CreateTLSRegion(); | 318 | tls_region_address = CreateTLSRegion(); |
| 339 | memory_reservation.Commit(); | 319 | 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) | |||
| 2156 | LOG_DEBUG(Kernel_SVC, "called"); | 2156 | LOG_DEBUG(Kernel_SVC, "called"); |
| 2157 | 2157 | ||
| 2158 | auto& kernel = system.Kernel(); | 2158 | auto& kernel = system.Kernel(); |
| 2159 | auto resource_limit = std::make_shared<KResourceLimit>(kernel, system); | 2159 | auto resource_limit = std::make_shared<KResourceLimit>(kernel, system.CoreTiming()); |
| 2160 | 2160 | ||
| 2161 | auto* const current_process = kernel.CurrentProcess(); | 2161 | auto* const current_process = kernel.CurrentProcess(); |
| 2162 | ASSERT(current_process != nullptr); | 2162 | ASSERT(current_process != nullptr); |
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 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <type_traits> | ||
| 8 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 9 | 8 | ||
| 10 | namespace Tegra::Engines { | 9 | namespace Tegra::Engines { |
| 11 | 10 | ||
| 12 | class EngineInterface { | 11 | class EngineInterface { |
| 13 | public: | 12 | public: |
| 13 | virtual ~EngineInterface() = default; | ||
| 14 | |||
| 14 | /// Write the value to the register identified by method. | 15 | /// Write the value to the register identified by method. |
| 15 | virtual void CallMethod(u32 method, u32 method_argument, bool is_last_call) = 0; | 16 | virtual void CallMethod(u32 method, u32 method_argument, bool is_last_call) = 0; |
| 16 | 17 | ||
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 { | |||
| 35 | class Fermi2D final : public EngineInterface { | 35 | class Fermi2D final : public EngineInterface { |
| 36 | public: | 36 | public: |
| 37 | explicit Fermi2D(); | 37 | explicit Fermi2D(); |
| 38 | ~Fermi2D(); | 38 | ~Fermi2D() override; |
| 39 | 39 | ||
| 40 | /// Binds a rasterizer to this engine. | 40 | /// Binds a rasterizer to this engine. |
| 41 | void BindRasterizer(VideoCore::RasterizerInterface* rasterizer); | 41 | 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 { | |||
| 36 | class KeplerMemory final : public EngineInterface { | 36 | class KeplerMemory final : public EngineInterface { |
| 37 | public: | 37 | public: |
| 38 | explicit KeplerMemory(Core::System& system_, MemoryManager& memory_manager); | 38 | explicit KeplerMemory(Core::System& system_, MemoryManager& memory_manager); |
| 39 | ~KeplerMemory(); | 39 | ~KeplerMemory() override; |
| 40 | 40 | ||
| 41 | /// Write the value to the register identified by method. | 41 | /// Write the value to the register identified by method. |
| 42 | void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; | 42 | void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; |
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: | |||
| 188 | static_assert(sizeof(RemapConst) == 12); | 188 | static_assert(sizeof(RemapConst) == 12); |
| 189 | 189 | ||
| 190 | explicit MaxwellDMA(Core::System& system_, MemoryManager& memory_manager_); | 190 | explicit MaxwellDMA(Core::System& system_, MemoryManager& memory_manager_); |
| 191 | ~MaxwellDMA(); | 191 | ~MaxwellDMA() override; |
| 192 | 192 | ||
| 193 | /// Write the value to the register identified by method. | 193 | /// Write the value to the register identified by method. |
| 194 | void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; | 194 | void CallMethod(u32 method, u32 method_argument, bool is_last_call) override; |
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 @@ | |||
| 16 | #include "yuzu/applets/controller.h" | 16 | #include "yuzu/applets/controller.h" |
| 17 | #include "yuzu/configuration/configure_input.h" | 17 | #include "yuzu/configuration/configure_input.h" |
| 18 | #include "yuzu/configuration/configure_input_profile_dialog.h" | 18 | #include "yuzu/configuration/configure_input_profile_dialog.h" |
| 19 | #include "yuzu/configuration/configure_motion_touch.h" | ||
| 19 | #include "yuzu/configuration/configure_vibration.h" | 20 | #include "yuzu/configuration/configure_vibration.h" |
| 20 | #include "yuzu/configuration/input_profiles.h" | 21 | #include "yuzu/configuration/input_profiles.h" |
| 21 | #include "yuzu/main.h" | 22 | #include "yuzu/main.h" |
| @@ -206,6 +207,9 @@ QtControllerSelectorDialog::QtControllerSelectorDialog( | |||
| 206 | connect(ui->vibrationButton, &QPushButton::clicked, this, | 207 | connect(ui->vibrationButton, &QPushButton::clicked, this, |
| 207 | &QtControllerSelectorDialog::CallConfigureVibrationDialog); | 208 | &QtControllerSelectorDialog::CallConfigureVibrationDialog); |
| 208 | 209 | ||
| 210 | connect(ui->motionButton, &QPushButton::clicked, this, | ||
| 211 | &QtControllerSelectorDialog::CallConfigureMotionTouchDialog); | ||
| 212 | |||
| 209 | connect(ui->inputConfigButton, &QPushButton::clicked, this, | 213 | connect(ui->inputConfigButton, &QPushButton::clicked, this, |
| 210 | &QtControllerSelectorDialog::CallConfigureInputProfileDialog); | 214 | &QtControllerSelectorDialog::CallConfigureInputProfileDialog); |
| 211 | 215 | ||
| @@ -276,6 +280,18 @@ void QtControllerSelectorDialog::CallConfigureVibrationDialog() { | |||
| 276 | } | 280 | } |
| 277 | } | 281 | } |
| 278 | 282 | ||
| 283 | void QtControllerSelectorDialog::CallConfigureMotionTouchDialog() { | ||
| 284 | ConfigureMotionTouch dialog(this, input_subsystem); | ||
| 285 | |||
| 286 | dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | | ||
| 287 | Qt::WindowSystemMenuHint); | ||
| 288 | dialog.setWindowModality(Qt::WindowModal); | ||
| 289 | |||
| 290 | if (dialog.exec() == QDialog::Accepted) { | ||
| 291 | dialog.ApplyConfiguration(); | ||
| 292 | } | ||
| 293 | } | ||
| 294 | |||
| 279 | void QtControllerSelectorDialog::CallConfigureInputProfileDialog() { | 295 | void QtControllerSelectorDialog::CallConfigureInputProfileDialog() { |
| 280 | ConfigureInputProfileDialog dialog(this, input_subsystem, input_profiles.get()); | 296 | ConfigureInputProfileDialog dialog(this, input_subsystem, input_profiles.get()); |
| 281 | 297 | ||
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: | |||
| 51 | // Initializes the "Configure Vibration" Dialog. | 51 | // Initializes the "Configure Vibration" Dialog. |
| 52 | void CallConfigureVibrationDialog(); | 52 | void CallConfigureVibrationDialog(); |
| 53 | 53 | ||
| 54 | // Initializes the "Configure Motion / Touch" Dialog. | ||
| 55 | void CallConfigureMotionTouchDialog(); | ||
| 56 | |||
| 54 | // Initializes the "Create Input Profile" Dialog. | 57 | // Initializes the "Create Input Profile" Dialog. |
| 55 | void CallConfigureInputProfileDialog(); | 58 | void CallConfigureInputProfileDialog(); |
| 56 | 59 | ||