Commit Graph

35 Commits

Author SHA1 Message Date
Adrià ba08a1582a
Merge pull request #3876 from CnRJay/feat/savedata-convert
feat(savedata): implement sceSaveDataConvert
2026-10-12 00:43:58 +02:00
Chad eedf7a2671 feat(savedata): implement sceSaveDataConvert
PPSA28416 calls it on its existing save at boot (after sceSaveDataDirNameSearch finds it) and aborted on the missing implementation. The call takes one parameter block: user id at +0, the directory name pointer at +8. Host saves have no size limit, so the conversion completes at once: an existing save returns OK, a missing one NOT_FOUND, an invalid name PARAMETER. The title polls sceSaveDataGetEventResult once afterwards and continues on 'no event'.
2026-10-11 13:23:58 -05:00
Yunus Shaikh 9b1e1ecccd fix(savedata): sort sceSaveDataDirNameSearch results by the requested key and order
The search returned saves in host directory order and ignored the condition's key and order. A title that asks for the newest save first (modification time, descending) got whichever directory the host listed first: the alphabetically first on NTFS, an arbitrary one on Linux. Sort by directory name, user parameter or modification time, reverse for a descending order, and reject unknown keys and orders with the parameter error, as shadPS4 does.
2026-10-11 10:46:53 -07:00
Dean Galvin ec2bb21e70 fix(savedata): export sceSaveDataCancel
Palworld (PPSA23126) imports sceSaveDataCancel (e6y3WMBYbiM) from
libSceSaveData and fails to load because no library exports it. Its
signature is unknown, so it is exported without an implementation and
throws if it is called, like sceSaveDataConvert.
2026-10-10 21:22:48 +13:00
Adrià 5cb747c146
Merge pull request #1260 from MarcZX100/fix/savedata-file-clock-compat
fix(SaveData): use C++20 file clock conversion
2026-10-10 01:11:50 +02:00
MarcZX100 4e0e55ff45 fix(SaveData): use C++20 file clock conversion 2026-10-09 19:35:48 +00:00
authurtabo-byte f8b9b04dd1 fix(libSceSaveData): accept 32 MiB save memory 2026-10-09 10:24:30 -07:00
TideOPL c9685e47e4 fix(savedata): report a CREATE2 mount of an existing save as not created
sceSaveDataMount3 with SCE_SAVE_DATA_MOUNT_MODE_CREATE2 opens a save that
already exists, so its mount status is 0 rather than CREATED, as shadPS4's
savedata.cpp reports. A CREATE mount still reports CREATED.
2026-10-08 19:46:23 +01:00
Adrià da4027399e
Merge pull request #1125 from TideOPL/feat/ppsa16064-missing-exports
feat(libs): add the unimplemented exports PPSA16064 imports
2026-10-08 10:01:59 +02:00
Dean a7715e671f
Merge pull request #1109 from Sanjaysrinivas/fix/savedata-memory-write-preservation
fix(savedata): preserve memory on write failure
2026-10-08 18:28:14 +13:00
Ethan Barr e41050f71c fix(savedata): reject deleting mounted native saves 2026-10-07 15:13:43 -07:00
Sanjaysrinivas c4cfb8e23d fix(savedata): preserve memory on write failure 2026-10-07 21:40:33 +02:00
TideOPL cbdfcd8120 feat(libs): add the unimplemented exports PPSA16064 imports
PPSA16064 (Minecraft Dungeons II, Unreal Engine) failed to load because
these imports had no export:

- libkernel: sceCoredumpWriteUserString
- libSceSaveData: sceSaveDataConvert, sceSaveDataGetConvertProgress
- libSceVideoOut: sceVideoOutVrrPegToFixedRate,
  sceVideoOutVrrUnpegFromFixedRate

None of them is called during the title's start-up, so they are added
as unimplemented exports that throw with their name if a title calls
them. Their signatures are unknown; TechnicalDebt records them. The
built libraries export the NIDs the title imports.
2026-10-07 14:09:55 +01:00
Claude 928cf9b42d
fix(savedata): serialize mount slot access in libSceSaveData.native
Mount, unmount, param, icon and mount-info calls read and wrote the
global mount slot table without a lock, so two threads mounting at
once could take the same slot and one would later fail to unmount its
own mount point. Guard the table with a mutex and make the initialization
count atomic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MBXJqzgohLeVAeHsn4Jpm7
2026-10-07 05:26:59 +00:00
Merijn d1d98a8261 fix(savedata): accept a repeated sceSaveDataInitialize3
A second sceSaveDataInitialize3 returned SAVE_DATA_ERROR_ALREADY_INITIALIZED.
PPSA12544's executable and its Unity SaveData plugin both initialize, and
the plugin raises Unity.SaveData.PS5.Core.SaveDataException on any error,
so the console must accept the second call. Initializations are now
counted; sceSaveDataTerminate ends the session at the last one and only
then checks for mounted slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 10:46:48 +02:00
Adrià Franch e923bea317 feat(savedata): implement the PS4 transfer mount and directory search
Rename the two unknown libSceSaveData.native stubs to
sceSaveDataTransferringMountPs4 (RjMlsR8EXrw) and
sceSaveDataDirNameSearchPs4 (X4MYzukPc3g). There is no PS4 save area:
the mount returns NOT_FOUND like sceSaveDataTransferringMount, and the
search reports zero hits.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:41:59 +02:00
Dean e6505d8a93
Merge pull request #312 from RomainROCH/codex/fix-save-memory-metadata
fix(savedata): report memory metadata write failures
2026-10-04 14:13:01 +13:00
Dean a6cdfa1c7f
Merge pull request #352 from arreina/pr/savedata-delete-dir-name
fix(savedata): reject invalid directory names in sceSaveDataDelete
2026-10-04 14:01:40 +13:00
RomainROCH 1a55adfee2 chore(savedata): sync metadata fix with main 2026-10-03 00:09:01 +02:00
Pouare514 1c724c0228 feat(libs): Cyberpunk 2077 loading support (REDGalaxy + stubs)
# Conflicts:
#	core/libs/prx/libSceContentExport/Export.cpp
#	core/libs/prx/libScePlayGoDialog/Export.cpp
2026-10-02 23:14:04 +03:00
boykopovar 55cea557ee
Merge pull request #273 from RomainROCH/codex/fix-save-memory-growth
fix(savedata): preserve memory saves when growth reads fail
2026-10-02 22:32:56 +03:00
Alberto Ruiz 95c1b40e71 fix(savedata): reject invalid directory names in sceSaveDataDelete
sceSaveDataDelete appended the title's directory name to the save root
without any check and passed the result to std::filesystem::remove_all.
"../victim" removed a directory beside the save root, ".." the directory
holding the save root, and an empty name or "." every save. The name
now has to be terminated within its field, non-empty, not "." or "..",
and free of "/", "\" and ":", as sceSaveDataMount3 already requires;
otherwise the call returns SAVE_DATA_ERROR_PARAMETER and deletes nothing.

The native library gains its own CMakeLists.txt, with the same library
definition as the generic one, to register guest_savedata_delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-02 20:41:43 +02:00
RomainROCH 193ec6e268 fix(savedata): report memory metadata write failures 2026-10-02 06:05:54 +02:00
RomainROCH c58f3f0a14 fix(savedata): preserve memory saves when growth reads fail 2026-10-01 23:20:39 +02:00
RomainROCH d7f89a6654 fix(savedata): preserve existing saves on replace failure 2026-10-01 16:40:38 +02:00
STL1te a812d6314a fix(savedata): throw on a param file that cannot be read or has the wrong size
A .param file of a save directory or of save data memory that exists but cannot
be read, or whose size is not sizeof(SaveDataParam), was silently ignored or
truncated. It now throws, naming the file and, for a size mismatch, both sizes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 21:14:20 +03:00
STL1te 97443fd108 fix(savedata): the native module keeps save directory params and mounts at /savedata<N>
sceSaveDataSetParam dropped the params, and sceSaveDataGetParam and
sceSaveDataDirNameSearch returned zeros, so a title that checks the params of
the save it found took its profile for a new one and rewrote it with defaults
on every boot. The params now live in a <directory>.param sidecar next to the
save directory, written by SetParam (mtime refreshed) and returned by GetParam
and by the directory search, with the directory's write time when no param
was stored yet.

The mount point is /savedata<N>, as on the console: a title read its profile
through /host//_sm/0/Profile when the mount point had another shape, and that
path does not exist.

The module logs the first three calls of each entry point, like the core
module; APS5_SAVEDATA_TRACE lifts the limit.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-30 08:23:02 +03:00
OverkillLabs 77ed5e6d0c feat(savedata): mount aliasing, wildcard search, memory slots, async events
Rework the local SaveData implementation into a general-purpose, title-agnostic
backend used by both the native library and the standard libSceSaveData path:

- Directory aliasing: long save directory names are hashed into short mount
  point aliases (persisted to disk) so they fit the SDK's fixed-size mount
  point buffer, with the aliases reversed on directory search.
- Wildcard directory-name search (%/_ patterns) with sorting and optional
  reverse order, matching the DirNameSearch contract.
- Save-data "memory" slots: small per-user, per-slot blobs the title can
  set up, read and write without mounting a directory, backed by files under
  the save root with a companion parameter blob, size and range validation
  on every access, and a dirty flag consulted on commit.
- Async-flavored operations (backup, commit, memory sync) that queue
  SaveDataEvent records consumed through GetEventResult and can be bound to
  kernel event flags, plus transaction-resource and cancel/abort bookkeeping.
- Atomic file writes (temp file + rename) so a mid-write crash never leaves a
  torn save on disk, and corrected/duplicated SDK error code constants.
- Local storage app-status get/set/delete and transferring-mount support for
  PS4-to-PS5 style save transfers.

The native library keeps its own lighter-weight mount/memory implementation
(short "/_sm/<slot>" mount point aliases via the path-alias table) while
gaining the same per-user memory-slot separation, atomic writes and bounds
checking; the two implementations were merged by hand where upstream had
independently touched the native Export.cpp in the same area (backup/event
queue, short mount points) to keep both sets of improvements.

None of this is game-specific: it is a general local save-data backend that
works for any title and tolerates any user id.
2026-09-28 12:48:09 +03:00
devilismyfriend 9c2a75601d feat(libs): agc packet builders, savedata memory, offline service stubs
- libSceAgc: SetIndexCount, SetBaseIndirectArgs, DispatchIndirect, wait
  and write-data patch functions, relaxed checks for what titles send,
  NOP fillers for LOD stats and wait-until-safe, NotImplemented stubs.
- libSceSaveData.native: short mount points, backup events, save-data
  memory slots.
- user/system service, store dialog, video-out flip modes and queue-full
  error, pad read, fibers, offline behaviour for network/NP modules, and
  new export-only modules Ampr, JpegEnc, Json2, MsgDialog.native,
  NpCppWebApi, NpUtility.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-25 16:27:49 -07:00
boykopovar 630d918b4a feat(agc): add timing logs for path after recompling 2026-09-23 22:11:41 +03:00
boykopovar abc72da741 feat(libs): define vabi macros + add to declarations 2026-09-10 08:07:03 +03:00
boykopovar fdd7049250 fix(libc): fix ftools exports 2026-09-07 19:54:01 +03:00
boykopovar 5f7ef909f8 feat(libs): libcSceSaveData impl (wip) 2026-09-07 13:42:25 +03:00
boykopovar 6123893998 feat(libs): throw not impl ex in every stub 2026-09-06 15:05:04 +03:00
boykopovar 59bee8d187 feat(libs): add libs function signatures 2026-08-20 23:18:16 +03:00