summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp18
-rw-r--r--src/core/core.h3
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp4
-rw-r--r--src/core/hle/service/nvnflinger/nvnflinger.cpp4
4 files changed, 27 insertions, 2 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 4406ae30e..7ba704f18 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -216,6 +216,14 @@ struct System::Impl {
216 } 216 }
217 } 217 }
218 218
219 void SetNVDECActive(bool is_nvdec_active) {
220 nvdec_active = is_nvdec_active;
221 }
222
223 bool GetNVDECActive() {
224 return nvdec_active;
225 }
226
219 void InitializeDebugger(System& system, u16 port) { 227 void InitializeDebugger(System& system, u16 port) {
220 debugger = std::make_unique<Debugger>(system, port); 228 debugger = std::make_unique<Debugger>(system, port);
221 } 229 }
@@ -485,6 +493,8 @@ struct System::Impl {
485 std::atomic_bool is_powered_on{}; 493 std::atomic_bool is_powered_on{};
486 bool exit_lock = false; 494 bool exit_lock = false;
487 495
496 bool nvdec_active{};
497
488 Reporter reporter; 498 Reporter reporter;
489 std::unique_ptr<Memory::CheatEngine> cheat_engine; 499 std::unique_ptr<Memory::CheatEngine> cheat_engine;
490 std::unique_ptr<Tools::Freezer> memory_freezer; 500 std::unique_ptr<Tools::Freezer> memory_freezer;
@@ -594,6 +604,14 @@ void System::UnstallApplication() {
594 impl->UnstallApplication(); 604 impl->UnstallApplication();
595} 605}
596 606
607void System::SetNVDECActive(bool is_nvdec_active) {
608 impl->SetNVDECActive(is_nvdec_active);
609}
610
611bool System::GetNVDECActive() {
612 return impl->GetNVDECActive();
613}
614
597void System::InitializeDebugger() { 615void System::InitializeDebugger() {
598 impl->InitializeDebugger(*this, Settings::values.gdbstub_port.GetValue()); 616 impl->InitializeDebugger(*this, Settings::values.gdbstub_port.GetValue());
599} 617}
diff --git a/src/core/core.h b/src/core/core.h
index 4f153154f..ff2e4bd30 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -189,6 +189,9 @@ public:
189 std::unique_lock<std::mutex> StallApplication(); 189 std::unique_lock<std::mutex> StallApplication();
190 void UnstallApplication(); 190 void UnstallApplication();
191 191
192 void SetNVDECActive(bool is_nvdec_active);
193 [[nodiscard]] bool GetNVDECActive();
194
192 /** 195 /**
193 * Initialize the debugger. 196 * Initialize the debugger.
194 */ 197 */
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
index 0c7aee1b8..dc45169ad 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
@@ -69,7 +69,7 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, std::span<const u8> in
69 69
70void nvhost_nvdec::OnOpen(DeviceFD fd) { 70void nvhost_nvdec::OnOpen(DeviceFD fd) {
71 LOG_INFO(Service_NVDRV, "NVDEC video stream started"); 71 LOG_INFO(Service_NVDRV, "NVDEC video stream started");
72 system.AudioCore().SetNVDECActive(true); 72 system.SetNVDECActive(true);
73} 73}
74 74
75void nvhost_nvdec::OnClose(DeviceFD fd) { 75void nvhost_nvdec::OnClose(DeviceFD fd) {
@@ -79,7 +79,7 @@ void nvhost_nvdec::OnClose(DeviceFD fd) {
79 if (iter != host1x_file.fd_to_id.end()) { 79 if (iter != host1x_file.fd_to_id.end()) {
80 system.GPU().ClearCdmaInstance(iter->second); 80 system.GPU().ClearCdmaInstance(iter->second);
81 } 81 }
82 system.AudioCore().SetNVDECActive(false); 82 system.SetNVDECActive(false);
83} 83}
84 84
85} // namespace Service::Nvidia::Devices 85} // namespace Service::Nvidia::Devices
diff --git a/src/core/hle/service/nvnflinger/nvnflinger.cpp b/src/core/hle/service/nvnflinger/nvnflinger.cpp
index 4988e6e17..da2d5890f 100644
--- a/src/core/hle/service/nvnflinger/nvnflinger.cpp
+++ b/src/core/hle/service/nvnflinger/nvnflinger.cpp
@@ -324,6 +324,10 @@ s64 Nvnflinger::GetNextTicks() const {
324 speed_scale = 0.01f; 324 speed_scale = 0.01f;
325 } 325 }
326 } 326 }
327 if (system.GetNVDECActive() && settings.use_video_framerate.GetValue()) {
328 // Run at intended presentation rate during video playback.
329 speed_scale = 1.f;
330 }
327 331
328 // As an extension, treat nonpositive swap interval as framerate multiplier. 332 // As an extension, treat nonpositive swap interval as framerate multiplier.
329 const f32 effective_fps = swap_interval <= 0 ? 120.f * static_cast<f32>(1 - swap_interval) 333 const f32 effective_fps = swap_interval <= 0 ? 120.f * static_cast<f32>(1 - swap_interval)