summaryrefslogtreecommitdiffstats
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-05-31 01:35:01 +0200
committerLiam <byteslice@airmail.cc>2022-06-01 06:01:25 +0200
commitfb4b3c127f7c390358d7f4cadd2f58de116fec48 (patch)
treee2588a859d364a32be0cd9e0401a345c6492d1a7 /src/core/memory.cpp
parentMerge pull request #8368 from german77/seventimes (diff)
downloadyuzu-fb4b3c127f7c390358d7f4cadd2f58de116fec48.tar
yuzu-fb4b3c127f7c390358d7f4cadd2f58de116fec48.tar.gz
yuzu-fb4b3c127f7c390358d7f4cadd2f58de116fec48.tar.bz2
yuzu-fb4b3c127f7c390358d7f4cadd2f58de116fec48.tar.lz
yuzu-fb4b3c127f7c390358d7f4cadd2f58de116fec48.tar.xz
yuzu-fb4b3c127f7c390358d7f4cadd2f58de116fec48.tar.zst
yuzu-fb4b3c127f7c390358d7f4cadd2f58de116fec48.zip
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 28d30eee2..7534de01e 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -594,6 +594,19 @@ bool Memory::IsValidVirtualAddress(const VAddr vaddr) const {
return pointer != nullptr || type == Common::PageType::RasterizerCachedMemory;
}
+bool Memory::IsValidVirtualAddressRange(VAddr base, u64 size) const {
+ VAddr end = base + size;
+ VAddr page = Common::AlignDown(base, PAGE_SIZE);
+
+ for (; page < end; page += PAGE_SIZE) {
+ if (!IsValidVirtualAddress(page)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
u8* Memory::GetPointer(VAddr vaddr) {
return impl->GetPointer(vaddr);
}