mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-13 20:58:00 -05:00
Core: Initial implementation of device memory mapping
This commit is contained in:
@ -31,6 +31,12 @@ public:
|
||||
DramMemoryMap::Base;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
PAddr GetRawPhysicalAddr(const T* ptr) const {
|
||||
return static_cast<PAddr>(reinterpret_cast<uintptr_t>(ptr) -
|
||||
reinterpret_cast<uintptr_t>(buffer.BackingBasePointer()));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* GetPointer(Common::PhysicalAddress addr) {
|
||||
return reinterpret_cast<T*>(buffer.BackingBasePointer() +
|
||||
@ -43,6 +49,16 @@ public:
|
||||
(GetInteger(addr) - DramMemoryMap::Base));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* GetPointerFromRaw(PAddr addr) {
|
||||
return reinterpret_cast<T*>(buffer.BackingBasePointer() + addr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
const T* GetPointerFromRaw(PAddr addr) const {
|
||||
return reinterpret_cast<T*>(buffer.BackingBasePointer() + addr);
|
||||
}
|
||||
|
||||
Common::HostMemory buffer;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user