summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/nvdrv_a.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-01-09 03:30:22 +0100
committerbunnei <bunneidev@gmail.com>2018-01-11 05:28:29 +0100
commit34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5 (patch)
treeb3b01b63dd0fa4fdc240a549257b685595f277cf /src/core/hle/service/nvdrv/nvdrv_a.h
parentNV: Determine what buffer to draw for each layer of each display. (diff)
downloadyuzu-34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5.tar
yuzu-34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5.tar.gz
yuzu-34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5.tar.bz2
yuzu-34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5.tar.lz
yuzu-34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5.tar.xz
yuzu-34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5.tar.zst
yuzu-34ae2ec644f49b04d6c6b82742812b6a8a3ef8b5.zip
Diffstat (limited to 'src/core/hle/service/nvdrv/nvdrv_a.h')
-rw-r--r--src/core/hle/service/nvdrv/nvdrv_a.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/hle/service/nvdrv/nvdrv_a.h b/src/core/hle/service/nvdrv/nvdrv_a.h
index 09522a486..af1017881 100644
--- a/src/core/hle/service/nvdrv/nvdrv_a.h
+++ b/src/core/hle/service/nvdrv/nvdrv_a.h
@@ -4,8 +4,9 @@
#pragma once
-#include "core/hle/service/service.h"
#include <memory>
+#include "core/hle/service/service.h"
+#include "core/hle/service/nvdrv/nvdrv.h"
namespace Service {
namespace NVDRV {
@@ -15,6 +16,15 @@ public:
NVDRV_A();
~NVDRV_A() = default;
+ /// Returns a pointer to one of the available devices, identified by its name.
+ template <typename T>
+ std::shared_ptr<T> GetDevice(std::string name) {
+ auto itr = devices.find(name);
+ if (itr == devices.end())
+ return nullptr;
+ return std::static_pointer_cast<T>(itr->second);
+ }
+
private:
void Open(Kernel::HLERequestContext& ctx);
void Ioctl(Kernel::HLERequestContext& ctx);
@@ -26,5 +36,7 @@ private:
std::unordered_map<std::string, std::shared_ptr<nvdevice>> devices;
};
+extern std::weak_ptr<NVDRV_A> nvdrv_a;
+
} // namespace NVDRV
} // namespace Service