Skip to content

Commit

Permalink
IOPBios: Defer to iopMemSafeWriteBytes when HLEing reads
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes committed Dec 12, 2024
1 parent 6574835 commit 7254a12
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pcsx2/IopBios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,16 @@ namespace R3000A

v0 = file->read(buf.get(), count);

for (s32 i = 0; i < (s32)v0; i++)
iopMemWrite8(data + i, buf[i]);
[[likely]]
if (v0 >= 0 && iopMemSafeWriteBytes(data, buf.get(), v0))
{
psxCpu->Clear(data, (v0 + 3) / 4);
}
else
{
for (s32 i = 0; i < static_cast<s32>(v0); i++)
iopMemWrite8(data + i, buf[i]);
}

pc = ra;
return 1;
Expand Down

0 comments on commit 7254a12

Please sign in to comment.