summaryrefslogtreecommitdiffstats
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-11-17 22:44:53 +0100
committert895 <clombardo169@gmail.com>2023-11-25 06:46:47 +0100
commit9f91ba1f7357c61dd2c7c3b437ea203d467fd400 (patch)
tree3cfe55acf5d2f8a0d75373934b4c22a4e9bb2a09 /src/core/memory.cpp
parentdevice_memory: Enable direct mapped addresses for nce (diff)
downloadyuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar
yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.gz
yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.bz2
yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.lz
yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.xz
yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.zst
yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.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 14db64f9d..e5ca78ef4 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -1001,4 +1001,17 @@ void Memory::FlushRegion(Common::ProcessAddress dest_addr, size_t size) {
impl->FlushRegion(dest_addr, size);
}
+bool Memory::InvalidateNCE(Common::ProcessAddress vaddr, size_t size) {
+ bool mapped = true;
+ u8* const ptr = impl->GetPointerImpl(
+ GetInteger(vaddr),
+ [&] {
+ LOG_ERROR(HW_Memory, "Unmapped InvalidateNCE for {} bytes @ {:#x}", size,
+ GetInteger(vaddr));
+ mapped = false;
+ },
+ [&] { impl->system.GPU().InvalidateRegion(GetInteger(vaddr), size); });
+ return mapped && ptr != nullptr;
+}
+
} // namespace Core::Memory