sceKernelWrite hack

Seems like std::fwrite has some weird edge cases we aren't handling properly.
Until we get to the bottom of this issue, here's a hack that bypasses it.
This fixes saves in DRAGON BALL XENOVERSE (CUSA01341)
This commit is contained in:
Stephen Miller 2025-06-13 23:22:03 -05:00
parent ae638c04c3
commit ea92214ff5

View File

@ -293,7 +293,12 @@ s64 PS4_SYSV_ABI write(s32 fd, const void* buf, size_t nbytes) {
}
return result;
}
return file->f.WriteRaw<u8>(buf, nbytes);
auto written_bytes = file->f.WriteRaw<u8>(buf, nbytes);
auto file_size = file->f.GetSize();
if (file_size != written_bytes) {
file->f.SetSize(written_bytes);
}
return written_bytes;
}
s64 PS4_SYSV_ABI posix_write(s32 fd, const void* buf, size_t nbytes) {