Commit Graph
81 Commits
Author SHA1 Message Date
Dean 1bcaa14234 Merge pull request #8307 from hypermoist/fix/libs-console-results-part2
fix(libs): return what the firmware returns from 31 more calls it does not implement
2026-10-21 20:57:00 +13:00
Dean d243cc5cab Merge pull request #7960 from Lindamea1/fix/savedata-ps5-64k-blocks
fix(libSceSaveData.native): count PS5 save data in 64 KiB blocks, at most 16384
2026-10-21 04:08:02 +13:00
pushkarreddyy 3bb39053ae fix(savedata): return parameter error on null arguments in umount2, loadIcon and saveIcon 2026-10-20 12:54:28 +02:00
Adrià 4f99cbffd7 Merge pull request #7536 from voidlakhan/fix/savedata-setparam-null-arguments
fix(savedata): return parameter error on null arguments in setParam
2026-10-20 12:18:56 +02:00
hypermistandClaude Opus 5.5 db25758397 fix(libs): return what the firmware returns from 29 more calls it does not implement
The NetCtl ApRp calls, the SaveData debug calls, HttpDbgEnableProfile,
HttpDbgSetPrintf, PadEnableExtensionPort and VideoRecording Init, Term
and SendCommand return 0; ImeForTestFunction returns 0x80BC00FF; the Hmd
distortion work memory align and size are 0x400 and 0x20000 and
DistortionGetCompoundEyeCorrectionCommand returns 0x81110009;
AjmInstanceCodecType returns the instance id shifted right by 14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-20 22:38:57 +13:00
juanpimg 2f0ed638dc feat(prx): declare the missing PS5 3.20 system exports
AnyPS5 resolves a title's imports by NID, so a title that imports a system
function no library provides fails to load with an unresolved import. The
PS5 3.20 export inventory lists 193 such exports across 37 PS5 system
libraries AnyPS5 implements but does not provide.

Declare them as throwing stubs so those titles load and reach their next
blocker. Each declaration calls NotImplemented_nid_no_patch and returns 0;
none of them implements the function. Declarations with a credible
prototype use it and cite the source with a pinned commit, and the rest
are declared without parameters, which resolves the import without making
an ABI claim. The technical-debt files record the limitation per library.

libSceMbus and libSceSystemService are left out because pull request #7821
declares them. libSceAgc is left out because its exports are versioned, so
the 3.20 NID names a different symbol from the one AnyPS5 ships.
libSceAvPlayer.native is left out because it compiles libSceAvPlayer's
Export.cpp.

Names and NIDs come from the PS5 3.20 export inventory at
https://github.com/DNNDHH/PS5-3.20_Libs/tree/b2a77c09cd71c01f34c790cfbe98c751a13262ad
2026-10-19 23:16:55 +02:00
Lindamea1andClaude Opus 5.5 6206c230c4 fix(libSceSaveData.native): count PS5 save data in 64 KiB blocks, at most 16384
The PS5 references count save data differently from the PS4: SharpEmu
uses a 64 KiB block, and SharpEmu and KytyPS5 allow 48 to 16384 blocks
per save, which at 64 KiB a block is 3 MiB to 1 GiB, the PS4's byte
range. The module used the PS4 values, 32 KiB blocks and a 32768-block
maximum. At 64 KiB a block, sceSaveDataDirNameSearch and
sceSaveDataGetMountInfo therefore counted up to twice the blocks a
save's files use, and a save without a recorded size reported 32768
blocks, which is 2 GiB.

The search test now expects 64 KiB blocks and the 16384 maximum, and
the block accounting gets its own technical debt entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:49:19 +01:00
UAQ Taxi a968336825 fix(libc): remove Windows trees without the remove_all symlink hang
MinGW libstdc++ up to GCC 16 does not treat a reparse point as a link in
std::filesystem::remove_all, so a host tree that holds a symlink is walked
through the link and never returns. Add RemoveTree, which removes the tree
itself on Windows, and use it where save data, app content and the shader
disk cache removed host trees. The libstdc++ fix is in GCC 17 (88856ad855ae).
2026-10-19 14:49:49 +02:00
Adrià db73af3506 Merge pull request #6831 from ErenYeager1836/fix/savedata-sync-memory-init-check
fix(libSceSaveData.native): return error for uninitialized sceSaveDataSyncSaveDataMemory
2026-10-19 13:43:56 +02:00
Adrià fb106a7e9a Merge pull request #6724 from Ondra97/codex/fix-savedata-mount-identity
fix(savedata): prevent duplicate mounts of one backing directory
2026-10-19 12:09:57 +02:00
Adrià 7f596df48d Merge pull request #6550 from orishamir/fix/savedata-memory-journal
fix(libSceSaveData.native): write only the changed bytes of save-data memory
2026-10-19 08:39:54 +02:00
lakhantheboss a605f94732 fix(savedata): return parameter error on null arguments in setParam 2026-10-18 18:06:26 +05:30
Nithishvelan M 738eff083c fix(libSceSaveData.native): return error for uninitialized sceSaveDataSyncSaveDataMemory 2026-10-18 09:42:13 +05:30
Dean 6447ed1ed7 Merge pull request #7241 from ErenYeager1836/fix/savedata-native-transaction-resource-validation
fix(libSceSaveData.native): validate initialization and parameters in transaction resource lifecycle
2026-10-18 10:19:36 +13:00
Nithishvelan M 87f2e7a88c fix(libSceSaveData.native): drop size 0 and resource validation per review 2026-10-18 01:05:22 +05:30
Nithishvelan M c43c931005 fix(libSceSaveData.native): validate initialization and parameters in transaction resource lifecycle 2026-10-18 00:19:48 +05:30
lakhantheboss 0936fe9b53 fix(savedata): return parameter error on null arguments in getMountInfo and getParam 2026-10-17 19:07:36 +05:30
Ondra97 37e62ddb3b fix(savedata): skip identity comparisons for missing paths 2026-10-16 14:16:07 +02:00
Ondra97 fcf65455f5 fix(savedata): prevent duplicate mounts of one backing directory 2026-10-16 08:53:05 +02:00
Ori ShamirandClaude Opus 5.5 f6fd60c6ca fix(libSceSaveData.native): write only the changed bytes of save-data memory
sceSaveDataSetSaveDataMemory2 read the whole slot file, patched it and
replaced it through a temporary file on every call, so each call cost a
full rewrite of the slot (up to 32 MiB). The changed ranges now go to a
small journal that is staged through the slot's temporary file and
renamed into place, then written into the slot file in place, and the
journal is removed. A journal left by an interrupted call is replayed by
the next setup, get, set or sync of that slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:43:50 +03:00
Adrià 0e6a5e7a5c Merge pull request #5690 from SandstromPL/fix/savedata-mount3-invalid-dir-name
fix(savedata): return a parameter error from sceSaveDataMount3 for an invalid directory name
2026-10-15 17:04:04 +02:00
Dean 95945006ec Merge pull request #4629 from mugurc/fix/libcxx-portability
fix(libs): build with libc++
2026-10-15 10:46:05 +13:00
Adrià Franch 31e53e53d7 fix(libSceSaveData.native): drop the duplicate APS5_EXPORT of the real name 2026-10-14 19:17:47 +02:00
Nicolas FalesyandClaude Opus 5.5 204c2ac4af refactor(libSceSaveData.native): name sceSaveDataPrepareForTransferring
The NID RvID8BVeg+g, declared as sceSaveDataUnknown_RvID8BVeg for
Minecraft (PPSA17221), hashes to sceSaveDataPrepareForTransferring. The
name is not in aerolib; it was found by combining words from the
libSceSaveData names that are. Behaviour is unchanged: it still throws,
now naming the real function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WeVmjnnPPKdxVTpr2Vjtw
2026-10-14 19:17:41 +02:00
SandstromPLandClaude Opus 5.5 c73e9720ae fix(savedata): return a parameter error from sceSaveDataMount3 for an invalid directory name
An unterminated or empty directory name, "." or "..", or a name
containing "/", "\" or ":" now returns SAVE_DATA_ERROR_PARAMETER and
leaves the mount result unchanged. The SDK 12.000 reference lists that
code for an invalid parameter of sceSaveDataMount3, KytyPS5's
SaveDataMount3 returns it for an invalid name, and sceSaveDataDelete
and sceSaveDataConvert already return it here for the same check.
It threw before, which stopped Minecraft Preview (PPSA19639) on
entering a world.

The Mount3 trace now prints at most the 32 bytes of the directory name
and the 16 bytes of the mount point, since both can be unterminated
when the mount fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 12:19:09 +05:30
Dean a7836b1495 Merge pull request #5094 from bubblegg/fix/savedata-save-size
fix(savedata): report a save's size as the mount that created it gave
2026-10-14 15:47:32 +13:00
Dean a21d73733c Merge pull request #5133 from SandstromPL/fix/savedata-search-other-title
fix(savedata): return no saves for a search with another title's ID
2026-10-14 15:41:58 +13:00
Dean 8a437941bd Merge pull request #4876 from EagleBearerYS/fix/savedata-failed-mount-keeps-result
fix(savedata): leave the mount result untouched when sceSaveDataMount3 fails
2026-10-14 14:32:59 +13:00
Yunus Shaikh 6a46563a93 refactor(savedata): clear the mount result once the mount point is made
#5173 changes the create condition right after the last error check, and #3950 removes the comment after the create block, so clearing the result in either place made the pull requests conflict. The result is still cleared only after every error return and before anything is written to it.
2026-10-13 07:10:41 -07:00
SandstromPLandClaude Opus 5.5 d34b78890d fix(savedata): return no saves for a search with another title's ID
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 17:53:29 +05:30
bubbleggandClaude Opus 5.5 4b7a357bd2 fix(savedata): report a save's size as the mount that created it gave
Every native save reported SAVE_DATA_BLOCKS_MAX blocks, all of them free,
in the sceSaveDataDirNameSearch infos and in sceSaveDataGetMountInfo,
whatever the title created it with and whatever its files held. A save's
size is now the blocks of the sceSaveDataMount3 call that created it,
kept beside the save; a save without a kept size takes that of its next
mount that names one, and otherwise keeps SAVE_DATA_BLOCKS_MAX. Free
blocks are what the save's files leave of it, each file rounded up to
32 KiB blocks, and the blocks and free-blocks sort keys use both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:32:43 +00:00
Aathish b078f475ec feat(libSceSaveData): implement sceSaveDataGetConvertProgress 2026-10-13 09:48:44 +02:00
Yunus Shaikh 4ccf888291 fix(savedata): leave the mount result untouched when sceSaveDataMount3 fails
Animal Well (PPSA22520) checks for its save with a CREATE2 mount it never
unmounts, then saves with a second mount of the same directory. That
mount returns BUSY, and the title keeps using the first mount point for
sceSaveDataPrepare, its save file and sceSaveDataUmount2.
sceSaveDataMount3 cleared the result before its checks, so the save was
written to "/save" in the game folder instead of the save directory, and
the first mount was never released. The result is now written only when
the mount succeeds, as shadPS4 does.
2026-10-12 17:47:46 -07:00
xXPBSXxandClaude Sonnet 5.5 989504ed84 feat(libSceSaveData): answer sceSaveDataDirNameSearch2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 22:59:26 +02:00
mugurc facc03ae90 fix(libs): build with libc++
Apple clang ships libc++, which differs from libstdc++ where the sources
relied on it:

- std::atomic<std::shared_ptr<T>> is not provided. AtomicSharedPtr is that
  type where the library has it and a mutex-guarded pointer with the same
  member functions elsewhere; the AGC driver uses it.
- std::atomic_ref<const T> is not provided; the page span reads go through
  a non-const reference.
- std::filesystem::file_time_type::clock::to_sys is not provided;
  std::chrono::file_clock::to_sys is.
- std::max and std::min do not deduce across the integer types of the
  guest range arithmetic, which is spelled with an explicit type.
- <string> and <initializer_list> are included where the sources and tests
  use them.
2026-10-12 19:57:33 +03:00
Yunus Shaikh 12ef40e4f1 fix(savedata): let a trailing % in a directory name pattern match nothing
sceSaveDataDirNameSearch reads % in the directory name pattern as any
run of characters and _ as one character. The matcher stopped when the
name ran out and then required the pattern to have ended too, so a
trailing % with nothing left to match failed: SAVEDATA% did not find a
save named SAVEDATA, and TRAI_% did not find TRAIL. A % now matches no
characters at the end of a name as it already did in the middle.
2026-10-12 06:37:37 -07:00
Dean a88c4f272f Merge pull request #4234 from solbjorg1245/upstream/savedata-search-info
fix(savedata): fill the search infos of sceSaveDataDirNameSearch
2026-10-13 01:21:48 +13:00
Mouad-Scriptz-0andClaude Fable 5.1 295e6b501d feat(libSceNpAuthAuthorizedAppDialog): add the dialog, with NpAuth and SaveData imports of Minecraft
Minecraft (PPSA17221) fails to load on nine absent imports. The authorized-app
dialog runs the common-dialog state machine without UI and reports the user
as having cancelled, like the login and VR setup dialogs. The other two,
sceNpAuthGetAuthorizedAppCode and the unnamed libSceSaveData.native NID
RvID8BVeg+g, are declared as throwing stubs with unknown signatures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 08:53:30 +00:00
Dean 732fc01aaf Merge pull request #3814 from xXPBSXx/fix/export-ppsa30601-imports
fix(exports): export the calls PPSA30601 imports
2026-10-12 21:36:02 +13:00
Dean 4dfa8506b3 Merge pull request #1680 from emirplus/fix/savedata-memory-metadata
fix(savedata): recover from metadata setup failure
2026-10-12 16:08:53 +13:00
pallpandClaude Fable 5.1 4b125c0ca5 fix(savedata): fill the search infos of sceSaveDataDirNameSearch
SaveDataDirNameSearchResult.infos points at an array the title reads one
entry per returned directory name, but the search never wrote it, and
SaveDataSearchInfo was declared as 128 opaque bytes. A title that asks for
the infos read whatever its buffer held.

SaveDataSearchInfo is now the 48-byte record shadPS4 declares as
OrbisSaveDataSearchInfo (blocks, free blocks, 32 reserved bytes), and the
search fills one per returned name. Every native save reports
SAVE_DATA_BLOCKS_MAX blocks, as sceSaveDataGetMountInfo and the block sort
keys already assume, so both counts are SAVE_DATA_BLOCKS_MAX and the
reserved bytes are zero.

guest_savedata_search_tests checks the two records, their zero reserved
bytes and that the search writes nothing past them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VFVE5WbaUJ2vyj8NAW44CS
2026-10-12 02:18:33 +01:00
xXPBSXx 35a6df818f Merge remote-tracking branch 'upstream/main' into fix/export-ppsa30601-imports
# Conflicts:
#	core/libs/prx/libSceJson2/Export.cpp
#	docs/dev/TechnicalDebt.md
2026-10-12 01:19:36 +02:00
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
xXPBSXxandClaude Sonnet 5.5 d7bf16a054 fix(exports): export the calls PPSA30601 imports
PPSA30601 (Resonance: A Plague Tale Legacy) fails to load without these imports that no library exports. Their signatures are unknown, so they are declared without parameters and throw until they are implemented. Adds a TechnicalDebt entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 19:02:18 +02:00
emirplus 6a7cce415a fix(savedata): recover from metadata setup failure 2026-10-10 21:09:00 +03: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