Skip to content

Commit

Permalink
IOPBios: Defer to iopMemSafeReadBytes when HLEing writes
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes committed Dec 12, 2024
1 parent 7254a12 commit 0e2e650
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pcsx2/IopBios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,12 @@ namespace R3000A
{
auto buf = std::make_unique<char[]>(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);

Expand Down

0 comments on commit 0e2e650

Please sign in to comment.