Commit Graph

4 Commits

Author SHA1 Message Date
kjhq bb1a4cbec4 fix(libkernel): flush only the paths the guest changed in sceKernelSync on Windows
Opening a volume needs administrator rights, so the volume flush skipped
every volume in a normal user session. The libc, libkernel, save data and
app content file functions now record each host file and directory they
change. On Windows sceKernelSync flushes the recorded paths that changed
since the previous call, plus their changed parent directories, through
handles a normal user can open. Linux still calls sync().
2026-10-08 08:27:22 +00:00
RomainROCH d7f89a6654 fix(savedata): preserve existing saves on replace failure 2026-10-01 16:40:38 +02:00
boykopovar b01e0bbf52 fix(build): use portable save paths and validate all PRX libraries in CI 2026-09-29 02:24:56 +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