diff options
| author | 2022-09-05 17:42:24 -0700 | |
|---|---|---|
| committer | 2022-10-18 19:13:34 -0700 | |
| commit | 47b8160666da8dcb679bb7cabe35a615a1786155 (patch) | |
| tree | c22fd04d12cc19f0155feb98157dc90874e6456b /src/core/device_memory.h | |
| parent | core: hle: result: Add GetInnerValue and Includes methods. (diff) | |
| download | yuzu-47b8160666da8dcb679bb7cabe35a615a1786155.tar.gz yuzu-47b8160666da8dcb679bb7cabe35a615a1786155.tar.xz yuzu-47b8160666da8dcb679bb7cabe35a615a1786155.zip | |
core: device_memory: Templatize GetPointer(..).
Diffstat (limited to 'src/core/device_memory.h')
| -rw-r--r-- | src/core/device_memory.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/device_memory.h b/src/core/device_memory.h index df61b0c0b..90510733c 100644 --- a/src/core/device_memory.h +++ b/src/core/device_memory.h | |||
| @@ -31,12 +31,14 @@ public: | |||
| 31 | DramMemoryMap::Base; | 31 | DramMemoryMap::Base; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | u8* GetPointer(PAddr addr) { | 34 | template <typename T> |
| 35 | return buffer.BackingBasePointer() + (addr - DramMemoryMap::Base); | 35 | T* GetPointer(PAddr addr) { |
| 36 | return reinterpret_cast<T*>(buffer.BackingBasePointer() + (addr - DramMemoryMap::Base)); | ||
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | const u8* GetPointer(PAddr addr) const { | 39 | template <typename T> |
| 39 | return buffer.BackingBasePointer() + (addr - DramMemoryMap::Base); | 40 | const T* GetPointer(PAddr addr) const { |
| 41 | return reinterpret_cast<T*>(buffer.BackingBasePointer() + (addr - DramMemoryMap::Base)); | ||
| 40 | } | 42 | } |
| 41 | 43 | ||
| 42 | Common::HostMemory buffer; | 44 | Common::HostMemory buffer; |