summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-09 03:01:40 +0100
committerbunnei <bunneidev@gmail.com>2021-02-19 01:16:24 +0100
commit24e1e17a8ae3f2b2962b702d383abd19b57c7b05 (patch)
treec5c37e8e3f4887a0791e7c57aa9699aeb9cce85c /src
parentcommon: alignment: Add DivideUp utility method. (diff)
downloadyuzu-24e1e17a8ae3f2b2962b702d383abd19b57c7b05.tar
yuzu-24e1e17a8ae3f2b2962b702d383abd19b57c7b05.tar.gz
yuzu-24e1e17a8ae3f2b2962b702d383abd19b57c7b05.tar.bz2
yuzu-24e1e17a8ae3f2b2962b702d383abd19b57c7b05.tar.lz
yuzu-24e1e17a8ae3f2b2962b702d383abd19b57c7b05.tar.xz
yuzu-24e1e17a8ae3f2b2962b702d383abd19b57c7b05.tar.zst
yuzu-24e1e17a8ae3f2b2962b702d383abd19b57c7b05.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/memory.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index 705ebb23d..6d34fcfe2 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -116,6 +116,11 @@ public:
*/
u8* GetPointer(VAddr vaddr);
+ template <typename T>
+ T* GetPointer(VAddr vaddr) {
+ return reinterpret_cast<T*>(GetPointer(vaddr));
+ }
+
/**
* Gets a pointer to the given address.
*
@@ -126,6 +131,11 @@ public:
*/
const u8* GetPointer(VAddr vaddr) const;
+ template <typename T>
+ const T* GetPointer(VAddr vaddr) const {
+ return reinterpret_cast<T*>(GetPointer(vaddr));
+ }
+
/**
* Reads an 8-bit unsigned value from the current process' address space
* at the given virtual address.