main's canonical-header refactor (f38d29fd08) edited the old libSceSaveData and libSceSaveDataDialog sources this branch removes, and made EventFlag.cpp, libSceNpCommon's Runtime.cpp and GuestKernelErrors.cpp include the old SaveDataCore.hpp. Those three use nothing from it and build without it, so the include is dropped. SaveDataWriteReplacement.cpp takes main's canonical header and keeps only the native path.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PS4 titles import save data from libSceSaveData and libSceSaveDataDialog,
and a converted title loads exactly the modules its DT_NEEDED names. Those
two libraries were separate, older implementations that export only 9 and 8
functions, while libSceSaveData.native and libSceSaveDataDialog.native carry
sceSaveDataDelete, sceSaveDataDirNameSearch, sceSaveDataSetParam,
sceSaveDataSaveIcon, sceSaveDataDialogUpdateStatus and the rest. A PS4 title
importing any of those failed at startup with unresolved imports.
Both plain libraries are now built from the native sources, the way
libSceNgs2 is built from libSceNgs2.native, and the old implementation and
its test variant are removed. The earlier implementation's save-data memory
and mount alias files are not read; that is recorded in the debt file.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.