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 18, 2024
1 parent f964dfa commit 5a8921d
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 5a8921d

Please sign in to comment.