aboutsummaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp40
1 files changed, 6 insertions, 34 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 046ee53346..06543b0833 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -4,7 +4,6 @@
#include <array>
#include <atomic>
#include <memory>
-#include <unordered_map>
#include <utility>
#include "game_settings.h"
@@ -249,30 +248,12 @@ struct System::Impl {
}
}
- void NotifyNVDECChannelOpen(u64 process_id) {
- std::scoped_lock lock{nvdec_active_mutex};
- ++nvdec_active_channels[process_id];
- }
-
- void NotifyNVDECChannelClose(u64 process_id) {
- std::scoped_lock lock{nvdec_active_mutex};
- const auto it = nvdec_active_channels.find(process_id);
- if (it == nvdec_active_channels.end()) {
- return;
- }
- if (--it->second == 0) {
- nvdec_active_channels.erase(it);
- }
+ void SetNVDECActive(bool is_nvdec_active) {
+ nvdec_active = is_nvdec_active;
}
bool GetNVDECActive() {
- std::scoped_lock lock{nvdec_active_mutex};
- return !nvdec_active_channels.empty();
- }
-
- bool IsNVDECActiveForProcess(u64 process_id) {
- std::scoped_lock lock{nvdec_active_mutex};
- return nvdec_active_channels.contains(process_id);
+ return nvdec_active;
}
void InitializeDebugger(System& system, u16 port) {
@@ -528,8 +509,6 @@ struct System::Impl {
mutable std::mutex suspend_guard;
std::mutex general_channel_mutex;
- std::mutex nvdec_active_mutex;
- std::unordered_map<u64, u32> nvdec_active_channels;
std::atomic_bool is_paused{};
std::atomic_bool is_shutting_down{};
std::atomic_bool is_powered_on{};
@@ -537,6 +516,7 @@ struct System::Impl {
bool extended_memory_layout : 1 = false;
bool exit_locked : 1 = false;
bool exit_requested : 1 = false;
+ bool nvdec_active : 1 = false;
void EnsureGeneralChannelInitialized(System& system) {
if (!general_channel_event) {
@@ -600,22 +580,14 @@ void System::UnstallApplication() {
impl->UnstallApplication();
}
-void System::NotifyNVDECChannelOpen(u64 process_id) {
- impl->NotifyNVDECChannelOpen(process_id);
-}
-
-void System::NotifyNVDECChannelClose(u64 process_id) {
- impl->NotifyNVDECChannelClose(process_id);
+void System::SetNVDECActive(bool is_nvdec_active) {
+ impl->SetNVDECActive(is_nvdec_active);
}
bool System::GetNVDECActive() {
return impl->GetNVDECActive();
}
-bool System::IsNVDECActiveForProcess(u64 process_id) {
- return impl->IsNVDECActiveForProcess(process_id);
-}
-
void System::InitializeDebugger() {
impl->InitializeDebugger(*this, Settings::values.gdbstub_port.GetValue());
}