From 5a8921dd22f8974f03176debc0f5ace06edfd9bb Mon Sep 17 00:00:00 2001 From: Ty Lamontagne Date: Thu, 12 Dec 2024 17:54:00 -0500 Subject: [PATCH] IOPBios: Defer to iopMemSafeReadBytes when HLEing writes --- pcsx2/IopBios.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pcsx2/IopBios.cpp b/pcsx2/IopBios.cpp index 843f2a0275..6d848c492a 100644 --- a/pcsx2/IopBios.cpp +++ b/pcsx2/IopBios.cpp @@ -907,8 +907,12 @@ namespace R3000A { auto buf = std::make_unique(count); - for (u32 i = 0; i < count; i++) - buf[i] = iopMemRead8(data + i); + [[unlikely]] + if (!iopMemSafeReadBytes(data, buf.get(), count)) + { + for (u32 i = 0; i < count; i++) + buf[i] = iopMemRead8(data + i); + } v0 = file->write(buf.get(), count);