mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 00:12:40 +00:00
remove readback hacks, allows to read/write guest memory directly
This commit is contained in:
1 parent
013e9a4485
commit
e903c93848
27 files changed
+522
-1228
No files matched your search
@@ -1,9 +1,9 @@
|
||||
#include "graphics/shader/recompiler/SrtWalker.h"
|
||||
|
||||
#include "graphics/host_gpu/hostMemory.h"
|
||||
#include "graphics/shader/recompiler/ScalarProvenance.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <fmt/format.h>
|
||||
|
||||
namespace Libs::Graphics::ShaderRecompiler::IR {
|
||||
@@ -485,12 +485,14 @@ private:
|
||||
value.pc, base_aligned, relative));
|
||||
}
|
||||
}
|
||||
const auto read_memory =
|
||||
m_runtime.read_memory != nullptr ? m_runtime.read_memory : HostMemoryReadDword;
|
||||
if (!read_memory(m_runtime.userdata, address, result)) {
|
||||
if (m_runtime.read_memory != nullptr &&
|
||||
!m_runtime.read_memory(m_runtime.userdata, address, result)) {
|
||||
return Fail(
|
||||
error, fmt::format("ReadConst pc=0x{:08x} failed at 0x{:016x}", value.pc, address));
|
||||
}
|
||||
if (m_runtime.read_memory == nullptr) {
|
||||
std::memcpy(result, reinterpret_cast<const void*>(address), sizeof(*result));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user