summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-04-16 05:06:29 +0200
committerbunnei <bunneidev@gmail.com>2020-04-17 06:59:36 +0200
commit92caa003a8fabf177f012a4f59ac4e123cbb4e98 (patch)
treefd3c250905c8ae155e80292ffd4b9e8d5662db27 /src/core
parentmemory: Add copyright notice for Atmosphere where applicable. (diff)
downloadyuzu-92caa003a8fabf177f012a4f59ac4e123cbb4e98.tar
yuzu-92caa003a8fabf177f012a4f59ac4e123cbb4e98.tar.gz
yuzu-92caa003a8fabf177f012a4f59ac4e123cbb4e98.tar.bz2
yuzu-92caa003a8fabf177f012a4f59ac4e123cbb4e98.tar.lz
yuzu-92caa003a8fabf177f012a4f59ac4e123cbb4e98.tar.xz
yuzu-92caa003a8fabf177f012a4f59ac4e123cbb4e98.tar.zst
yuzu-92caa003a8fabf177f012a4f59ac4e123cbb4e98.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/device_memory.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/device_memory.h b/src/core/device_memory.h
index cc7bda070..ff66e202d 100644
--- a/src/core/device_memory.h
+++ b/src/core/device_memory.h
@@ -28,12 +28,16 @@ public:
~DeviceMemory();
template <typename T>
- constexpr PAddr GetPhysicalAddr(T* ptr) {
+ PAddr GetPhysicalAddr(const T* ptr) const {
return (reinterpret_cast<uintptr_t>(ptr) - reinterpret_cast<uintptr_t>(buffer.data())) +
DramMemoryMap::Base;
}
- constexpr u8* GetPointer(PAddr addr) {
+ u8* GetPointer(PAddr addr) {
+ return buffer.data() + (addr - DramMemoryMap::Base);
+ }
+
+ const u8* GetPointer(PAddr addr) const {
return buffer.data() + (addr - DramMemoryMap::Base);
}