mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
core: memory: Add templated GetPointer methods.
This commit is contained in:
parent
b5b92fd1e5
commit
24e1e17a8a
1 changed files with 10 additions and 0 deletions
|
@ -116,6 +116,11 @@ public:
|
||||||
*/
|
*/
|
||||||
u8* GetPointer(VAddr vaddr);
|
u8* GetPointer(VAddr vaddr);
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
T* GetPointer(VAddr vaddr) {
|
||||||
|
return reinterpret_cast<T*>(GetPointer(vaddr));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a pointer to the given address.
|
* Gets a pointer to the given address.
|
||||||
*
|
*
|
||||||
|
@ -126,6 +131,11 @@ public:
|
||||||
*/
|
*/
|
||||||
const u8* GetPointer(VAddr vaddr) const;
|
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
|
* Reads an 8-bit unsigned value from the current process' address space
|
||||||
* at the given virtual address.
|
* at the given virtual address.
|
||||||
|
|
Loading…
Reference in a new issue