feat(savedata): implement the PS4 transfer mount and directory search #713

Merged
adriadam10 merged 1 commit from upstream-pr/713 into main 2026-10-05 19:14:26 +00:00
adriadam10 commented 2026-10-05 17:42:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T17:42:21Z.


What

Gives the two sceSaveDataUnknown00/01 stubs of libSceSaveData.native their real names (NIDs RjMlsR8EXrw, X4MYzukPc3g, hash-checked with tools/nid_names.py; the built libSceSaveData.native.prx still exports both NIDs) and implements them. Both are the PS4-save variants of functions this module already has.

  • sceSaveDataTransferringMountPs4: same as sceSaveDataTransferringMount here, returns 0x809F0008 (NOT_FOUND) with the result cleared, as there is no PS4 save data to transfer. KytyPS5 (src/libs/libSaveData.cpp) binds this NID to the same function as sceSaveDataTransferringMount; prosper (src/hle/fs/savedata.cpp) returns NOT_FOUND for it too, and notes that a title gates on the result and breaks when told the mount succeeded.
  • sceSaveDataDirNameSearchPs4: writes zero hits and zero set entries and returns 0. prosper returns that and captured the same result layout on a title for both the PS4 and PS5 search. KytyPS5 binds the NID to its PS5 search, which filters by the title id the caller passes, so a search for a PS4 title id finds nothing there either. Our PS5 search does not filter by title id, so the PS4 one doesn't reuse it (it would report this title's own saves as PS4 saves). Null arguments throw, like the PS5 search.

Arguments are assumed to be the PS5 functions' ones: listed under "Unknown function info" in TechnicalDebt.

Tested

Linux, GCC Release. New guest_savedata_ps4 (cwd in a temp dir with one PS5 save): the mount returns NOT_FOUND with an empty mount point; the PS5 search finds the save (control) while the PS4 search writes 0/0 over pre-filled 7/7 and leaves the name buffer untouched; both null arguments throw. It fails on main (the stubs throw / the names don't exist) and with each of five mutations (mount returns 0, no hit_num write, no set_num write, search aliased to the PS5 one, no null check of cond). Full ninja + ninja libs, ctest -R 'guest_|savedata' 102/102 pass.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4748742312 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/713). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-05T17:42:21Z. --- ### What Gives the two `sceSaveDataUnknown00/01` stubs of libSceSaveData.native their real names (NIDs `RjMlsR8EXrw`, `X4MYzukPc3g`, hash-checked with `tools/nid_names.py`; the built `libSceSaveData.native.prx` still exports both NIDs) and implements them. Both are the PS4-save variants of functions this module already has. - `sceSaveDataTransferringMountPs4`: same as `sceSaveDataTransferringMount` here, returns `0x809F0008` (NOT_FOUND) with the result cleared, as there is no PS4 save data to transfer. [KytyPS5](https://github.com/KytyPS5/KytyPS5) (`src/libs/libSaveData.cpp`) binds this NID to the same function as `sceSaveDataTransferringMount`; [prosper](https://github.com/mattias800/prosper) (`src/hle/fs/savedata.cpp`) returns NOT_FOUND for it too, and notes that a title gates on the result and breaks when told the mount succeeded. - `sceSaveDataDirNameSearchPs4`: writes zero hits and zero set entries and returns 0. prosper returns that and captured the same result layout on a title for both the PS4 and PS5 search. KytyPS5 binds the NID to its PS5 search, which filters by the title id the caller passes, so a search for a PS4 title id finds nothing there either. Our PS5 search does not filter by title id, so the PS4 one doesn't reuse it (it would report this title's own saves as PS4 saves). Null arguments throw, like the PS5 search. Arguments are assumed to be the PS5 functions' ones: listed under "Unknown function info" in TechnicalDebt. ### Tested Linux, GCC Release. New `guest_savedata_ps4` (cwd in a temp dir with one PS5 save): the mount returns NOT_FOUND with an empty mount point; the PS5 search finds the save (control) while the PS4 search writes 0/0 over pre-filled 7/7 and leaves the name buffer untouched; both null arguments throw. It fails on `main` (the stubs throw / the names don't exist) and with each of five mutations (mount returns 0, no `hit_num` write, no `set_num` write, search aliased to the PS5 one, no null check of `cond`). Full `ninja` + `ninja libs`, `ctest -R 'guest_|savedata'` 102/102 pass. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-05 17:42:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-05T17:42:46Z.


Progress report (0518f0e → e923bea)

📈 System libraries: 79.27% (+0.06%, +2 implemented, -2 removed functions)

✅ 2 implemented
Library Name
libSceSaveData.native sceSaveDataDirNameSearchPs4
libSceSaveData.native sceSaveDataTransferringMountPs4
🗑️ 2 removed
Library Name
libSceSaveData.native sceSaveDataUnknown00
libSceSaveData.native sceSaveDataUnknown01
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5999861230 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/713#issuecomment-5999861230). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-05T17:42:46Z. --- <!-- progress-report --> ### Progress report (0518f0e → e923bea) 📈 **System libraries**: 79.27% (+0.06%, +2 implemented, -2 removed functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceSaveData.native | `sceSaveDataDirNameSearchPs4` | | libSceSaveData.native | `sceSaveDataTransferringMountPs4` | </details> <details> <summary>🗑️ 2 removed</summary> | Library | Name | | - | - | | libSceSaveData.native | `sceSaveDataUnknown00` | | libSceSaveData.native | `sceSaveDataUnknown01` | </details>
github-actions[bot] commented 2026-10-05 18:15:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-05T18:15:23Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#518 docs/dev/TechnicalDebt.md L37
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6000390243 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/713#issuecomment-6000390243). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-05T18:15:23Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #518 | `docs/dev/TechnicalDebt.md` [L37](https://github.com/boykopovar/AnyPS5/blob/a2da600645226779723f4ae9241df99ebc4bd260/docs/dev/TechnicalDebt.md#L37) | | |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!713
No description provided.