mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #3360] [MERGED] Core: Simulate write-only file access with read-write access #3413
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3413
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/3360
Author: @StevenMiller123
Created: 8/1/2025
Status: ✅ Merged
Merged: 11/4/2025
Merged by: @georgemoralis
Base:
main← Head:catherine-fix📝 Commits (10+)
5c9ba6cSwap write access mode for read write12dc103Create mode038ad7dUpdate file_system.cppa538770Check access mode in read functionsad5c019Separate appends into proper modesb0f93afMove IsWriteOnly check after device/socket readsbc7af55Fix issuesf20636aFix remaining uses of FileAccessMode write to create files2ce0433Merge branch 'main' into catherine-fix7bc0ce0Fix rebase📊 Changes
16 files changed (+78 additions, -43 deletions)
View changed files
📝
src/common/io_file.cpp(+12 -8)📝
src/common/io_file.h(+14 -4)📝
src/common/logging/backend.cpp(+1 -1)📝
src/core/devtools/widget/common.h(+1 -1)📝
src/core/devtools/widget/frame_dump.cpp(+1 -1)📝
src/core/file_format/psf.cpp(+1 -1)📝
src/core/libraries/kernel/file_system.cpp(+34 -13)📝
src/core/libraries/save_data/save_instance.cpp(+1 -1)📝
src/core/libraries/save_data/save_memory.cpp(+2 -2)📝
src/core/libraries/save_data/savedata.cpp(+1 -1)📝
src/core/loader/elf.cpp(+4 -4)📝
src/core/loader/symbols_resolver.cpp(+1 -1)📝
src/shader_recompiler/frontend/translate/translate.cpp(+1 -1)📝
src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp(+1 -1)📝
src/shader_recompiler/ir/program.cpp(+2 -2)📝
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp(+1 -1)📄 Description
The standard library functions we're using for opening files will erase files when opening with write access. This differs from real hardware behavior, where the file opens without getting erased.
To properly emulate this behavior, I've made write-only access identical to read-write access, and added checks in
read,posix_preadv, andreadvto ensure that reading from a file with write-only access fails in a hardware-accurate way. I've also created a separate create mode that uses write-access to create files to simplify the process of creating a file inopensince read-write mode doesn't create files.Handling this behavior properly fixes saving in Catherine: Full Body (CUSA15036)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.