diff options
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; |