fix(libs): return what the firmware returns from 31 more calls it does not implement #8307

Merged
hypermoist merged 2 commits from upstream-pr/8307 into main 2026-10-21 07:57:01 +00:00
hypermoist commented 2026-10-20 09:39:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-20T09:39:36Z.


What

These 31 exports were NotImplemented stubs. In the decrypted firmware modules (system/common/lib/*.sprx), each is a single constant return; sceAjmInstanceCodecType is one shift and scePadEnableExtensionPort also stores its argument byte. None makes an IPC call or a syscall, so the exports now do the same. This follows #8303 and #8305 and covers the files other open pull requests also edit; every change here is at lines they leave alone.

Library Exports Firmware body Now
libSceNetCtl sceNetCtlApRpCheckCallback, ClearEvent, RegisterCallback, UnregisterCallback, GetResult, GetState, GetInfo, Start, StartWithRetry, StartConf, Stop xor eax, eax; ret 0
libSceSaveData.native sceSaveDataCheckIpmiIfSize, sceSaveDataDebug, DebugCheckBackupData, DebugCleanMount, DebugCompiledSdkVersion, DebugCreateSaveDataRoot, DebugProspero, DebugRemoveSaveDataRoot, DebugTarget xor eax, eax; ret 0
libSceHmd sceHmdGetDistortionWorkMemoryAlign mov eax, 0x400; ret 0x400
libSceHmd sceHmdGetDistortionWorkMemorySize mov eax, 0x20000; ret 0x20000
libSceHmd sceHmdDistortionGetCompoundEyeCorrectionCommand mov eax, 0x81110009; ret same
libSceHttp sceHttpDbgEnableProfile, sceHttpDbgSetPrintf ret / xor eax, eax; ret 0
libSceIme sceImeForTestFunction mov eax, 0x80bc00ff; ret ErrorInternal, added after the existing Error* codes
libScePad scePadEnableExtensionPort stores its byte argument, returns 0 0 (nothing reads the extension port setting here)
libSceVideoRecordingP sceVideoRecordingInit, sceVideoRecordingTerm (in libSceVideoRecording.sprx), sceVideoRecordingSendCommand (in libSceVideoRecording.native.sprx) xor eax, eax; ret 0
libSceAjm.native sceAjmInstanceCodecType mov eax, edi; shr eax, 0xe; ret instance_id >> 14, which matches the (codec << 14) | counter ids sceAjmInstanceCreate builds here

sceAjmInstanceCodecType is also removed from the debt entry for Ajm declarations that only resolve imports.

Left out because open pull requests edit those lines: sceHmdInternalRegisterEventCallback (#8256) and sceNpRegisterGamePresenceCallback (#6977).

Tested

Linux (CachyOS, GCC, Release): the eight libraries build, the 88 tests matching ajm|ime|savedata|netctl|pad|hmd|http pass, and check_conventions passes. pr_overlap could not compare six files because those PRs conflict with main. Checked by hand against their hunks (#3205, #5038, #6879, #6977, #7201, #7881): every edited function is clear. No title was run.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code), reviewed by the contributor

🤖 Generated with Claude Code

https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4933907435 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8307). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-20T09:39:36Z. --- ### What These 31 exports were `NotImplemented` stubs. In the decrypted firmware modules (`system/common/lib/*.sprx`), each is a single constant return; `sceAjmInstanceCodecType` is one shift and `scePadEnableExtensionPort` also stores its argument byte. None makes an IPC call or a syscall, so the exports now do the same. This follows #8303 and #8305 and covers the files other open pull requests also edit; every change here is at lines they leave alone. | Library | Exports | Firmware body | Now | |---|---|---|---| | libSceNetCtl | `sceNetCtlApRpCheckCallback`, `ClearEvent`, `RegisterCallback`, `UnregisterCallback`, `GetResult`, `GetState`, `GetInfo`, `Start`, `StartWithRetry`, `StartConf`, `Stop` | `xor eax, eax; ret` | 0 | | libSceSaveData.native | `sceSaveDataCheckIpmiIfSize`, `sceSaveDataDebug`, `DebugCheckBackupData`, `DebugCleanMount`, `DebugCompiledSdkVersion`, `DebugCreateSaveDataRoot`, `DebugProspero`, `DebugRemoveSaveDataRoot`, `DebugTarget` | `xor eax, eax; ret` | 0 | | libSceHmd | `sceHmdGetDistortionWorkMemoryAlign` | `mov eax, 0x400; ret` | `0x400` | | libSceHmd | `sceHmdGetDistortionWorkMemorySize` | `mov eax, 0x20000; ret` | `0x20000` | | libSceHmd | `sceHmdDistortionGetCompoundEyeCorrectionCommand` | `mov eax, 0x81110009; ret` | same | | libSceHttp | `sceHttpDbgEnableProfile`, `sceHttpDbgSetPrintf` | `ret` / `xor eax, eax; ret` | 0 | | libSceIme | `sceImeForTestFunction` | `mov eax, 0x80bc00ff; ret` | `ErrorInternal`, added after the existing `Error*` codes | | libScePad | `scePadEnableExtensionPort` | stores its byte argument, returns 0 | 0 (nothing reads the extension port setting here) | | libSceVideoRecordingP | `sceVideoRecordingInit`, `sceVideoRecordingTerm` (in `libSceVideoRecording.sprx`), `sceVideoRecordingSendCommand` (in `libSceVideoRecording.native.sprx`) | `xor eax, eax; ret` | 0 | | libSceAjm.native | `sceAjmInstanceCodecType` | `mov eax, edi; shr eax, 0xe; ret` | `instance_id >> 14`, which matches the `(codec << 14) \| counter` ids `sceAjmInstanceCreate` builds here | `sceAjmInstanceCodecType` is also removed from the debt entry for Ajm declarations that only resolve imports. Left out because open pull requests edit those lines: `sceHmdInternalRegisterEventCallback` (#8256) and `sceNpRegisterGamePresenceCallback` (#6977). ### Tested Linux (CachyOS, GCC, Release): the eight libraries build, the 88 tests matching `ajm|ime|savedata|netctl|pad|hmd|http` pass, and `check_conventions` passes. `pr_overlap` could not compare six files because those PRs conflict with `main`. Checked by hand against their hunks (#3205, #5038, #6879, #6977, #7201, #7881): every edited function is clear. No title was run. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code), reviewed by the contributor 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
github-actions[bot] commented 2026-10-20 09:40:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T09:40:26Z.


Progress report (2d4c51e → f4689c2)

📈 System libraries: 50.28% (+0.35%, +31 implemented functions)

✅ 31 implemented
Library Name
libSceAjm.native sceAjmInstanceCodecType
libSceHmd sceHmdDistortionGetCompoundEyeCorrectionCommand
libSceHmd sceHmdGetDistortionWorkMemoryAlign
libSceHmd sceHmdGetDistortionWorkMemorySize
libSceHttp sceHttpDbgEnableProfile
libSceHttp sceHttpDbgSetPrintf
libSceIme sceImeForTestFunction
libSceNetCtl sceNetCtlApRpCheckCallback
libSceNetCtl sceNetCtlApRpClearEvent
libSceNetCtl sceNetCtlApRpGetInfo
libSceNetCtl sceNetCtlApRpGetResult
libSceNetCtl sceNetCtlApRpGetState
libSceNetCtl sceNetCtlApRpRegisterCallback
libSceNetCtl sceNetCtlApRpStart
libSceNetCtl sceNetCtlApRpStartConf
libSceNetCtl sceNetCtlApRpStartWithRetry
libSceNetCtl sceNetCtlApRpStop
libSceNetCtl sceNetCtlApRpUnregisterCallback
libScePad scePadEnableExtensionPort
libSceSaveData.native sceSaveDataCheckIpmiIfSize
libSceSaveData.native sceSaveDataDebug
libSceSaveData.native sceSaveDataDebugCheckBackupData
libSceSaveData.native sceSaveDataDebugCleanMount
libSceSaveData.native sceSaveDataDebugCompiledSdkVersion
libSceSaveData.native sceSaveDataDebugCreateSaveDataRoot
libSceSaveData.native sceSaveDataDebugProspero
libSceSaveData.native sceSaveDataDebugRemoveSaveDataRoot
libSceSaveData.native sceSaveDataDebugTarget
libSceVideoRecordingP sceVideoRecordingInit
libSceVideoRecordingP sceVideoRecordingSendCommand
libSceVideoRecordingP sceVideoRecordingTerm
⚪ 29 behaviourally empty (constant return or throw)
Library Name
libSceHmd sceHmdGetDistortionWorkMemoryAlign
libSceHmd sceHmdGetDistortionWorkMemorySize
libSceHttp sceHttpDbgEnableProfile
libSceHttp sceHttpDbgSetPrintf
libSceIme sceImeForTestFunction
libSceNetCtl sceNetCtlApRpCheckCallback
libSceNetCtl sceNetCtlApRpClearEvent
libSceNetCtl sceNetCtlApRpGetInfo
libSceNetCtl sceNetCtlApRpGetResult
libSceNetCtl sceNetCtlApRpGetState
libSceNetCtl sceNetCtlApRpRegisterCallback
libSceNetCtl sceNetCtlApRpStart
libSceNetCtl sceNetCtlApRpStartConf
libSceNetCtl sceNetCtlApRpStartWithRetry
libSceNetCtl sceNetCtlApRpStop
libSceNetCtl sceNetCtlApRpUnregisterCallback
libScePad scePadEnableExtensionPort
libSceSaveData.native sceSaveDataCheckIpmiIfSize
libSceSaveData.native sceSaveDataDebug
libSceSaveData.native sceSaveDataDebugCheckBackupData
libSceSaveData.native sceSaveDataDebugCleanMount
libSceSaveData.native sceSaveDataDebugCompiledSdkVersion
libSceSaveData.native sceSaveDataDebugCreateSaveDataRoot
libSceSaveData.native sceSaveDataDebugProspero
libSceSaveData.native sceSaveDataDebugRemoveSaveDataRoot
libSceSaveData.native sceSaveDataDebugTarget
libSceVideoRecordingP sceVideoRecordingInit
libSceVideoRecordingP sceVideoRecordingSendCommand
libSceVideoRecordingP sceVideoRecordingTerm
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288057465 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8307#issuecomment-6288057465). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T09:40:26Z. --- <!-- progress-report --> ### Progress report (2d4c51e → f4689c2) 📈 **System libraries**: 50.28% (+0.35%, +31 implemented functions) <details> <summary>✅ 31 implemented</summary> | Library | Name | | - | - | | libSceAjm.native | `sceAjmInstanceCodecType` | | libSceHmd | `sceHmdDistortionGetCompoundEyeCorrectionCommand` | | libSceHmd | `sceHmdGetDistortionWorkMemoryAlign` | | libSceHmd | `sceHmdGetDistortionWorkMemorySize` | | libSceHttp | `sceHttpDbgEnableProfile` | | libSceHttp | `sceHttpDbgSetPrintf` | | libSceIme | `sceImeForTestFunction` | | libSceNetCtl | `sceNetCtlApRpCheckCallback` | | libSceNetCtl | `sceNetCtlApRpClearEvent` | | libSceNetCtl | `sceNetCtlApRpGetInfo` | | libSceNetCtl | `sceNetCtlApRpGetResult` | | libSceNetCtl | `sceNetCtlApRpGetState` | | libSceNetCtl | `sceNetCtlApRpRegisterCallback` | | libSceNetCtl | `sceNetCtlApRpStart` | | libSceNetCtl | `sceNetCtlApRpStartConf` | | libSceNetCtl | `sceNetCtlApRpStartWithRetry` | | libSceNetCtl | `sceNetCtlApRpStop` | | libSceNetCtl | `sceNetCtlApRpUnregisterCallback` | | libScePad | `scePadEnableExtensionPort` | | libSceSaveData.native | `sceSaveDataCheckIpmiIfSize` | | libSceSaveData.native | `sceSaveDataDebug` | | libSceSaveData.native | `sceSaveDataDebugCheckBackupData` | | libSceSaveData.native | `sceSaveDataDebugCleanMount` | | libSceSaveData.native | `sceSaveDataDebugCompiledSdkVersion` | | libSceSaveData.native | `sceSaveDataDebugCreateSaveDataRoot` | | libSceSaveData.native | `sceSaveDataDebugProspero` | | libSceSaveData.native | `sceSaveDataDebugRemoveSaveDataRoot` | | libSceSaveData.native | `sceSaveDataDebugTarget` | | libSceVideoRecordingP | `sceVideoRecordingInit` | | libSceVideoRecordingP | `sceVideoRecordingSendCommand` | | libSceVideoRecordingP | `sceVideoRecordingTerm` | </details> <details> <summary>⚪ 29 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceHmd | `sceHmdGetDistortionWorkMemoryAlign` | | libSceHmd | `sceHmdGetDistortionWorkMemorySize` | | libSceHttp | `sceHttpDbgEnableProfile` | | libSceHttp | `sceHttpDbgSetPrintf` | | libSceIme | `sceImeForTestFunction` | | libSceNetCtl | `sceNetCtlApRpCheckCallback` | | libSceNetCtl | `sceNetCtlApRpClearEvent` | | libSceNetCtl | `sceNetCtlApRpGetInfo` | | libSceNetCtl | `sceNetCtlApRpGetResult` | | libSceNetCtl | `sceNetCtlApRpGetState` | | libSceNetCtl | `sceNetCtlApRpRegisterCallback` | | libSceNetCtl | `sceNetCtlApRpStart` | | libSceNetCtl | `sceNetCtlApRpStartConf` | | libSceNetCtl | `sceNetCtlApRpStartWithRetry` | | libSceNetCtl | `sceNetCtlApRpStop` | | libSceNetCtl | `sceNetCtlApRpUnregisterCallback` | | libScePad | `scePadEnableExtensionPort` | | libSceSaveData.native | `sceSaveDataCheckIpmiIfSize` | | libSceSaveData.native | `sceSaveDataDebug` | | libSceSaveData.native | `sceSaveDataDebugCheckBackupData` | | libSceSaveData.native | `sceSaveDataDebugCleanMount` | | libSceSaveData.native | `sceSaveDataDebugCompiledSdkVersion` | | libSceSaveData.native | `sceSaveDataDebugCreateSaveDataRoot` | | libSceSaveData.native | `sceSaveDataDebugProspero` | | libSceSaveData.native | `sceSaveDataDebugRemoveSaveDataRoot` | | libSceSaveData.native | `sceSaveDataDebugTarget` | | libSceVideoRecordingP | `sceVideoRecordingInit` | | libSceVideoRecordingP | `sceVideoRecordingSendCommand` | | libSceVideoRecordingP | `sceVideoRecordingTerm` | </details>
github-actions[bot] commented 2026-10-20 10:00:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T10:00:08Z.


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
PR 8353 docs/dev/debt/libSceAjm.native.md L6

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3205 core/libs/prx/libSceAjm.native/Export.cpp
PR 5038 core/libs/prx/libScePad/Export.cpp
PR 6977 core/libs/prx/libSceSaveData.native/Export.cpp
PR 7201 core/libs/prx/libSceNetCtl/Export.cpp
PR 7881 core/libs/prx/libScePad/Export.cpp
PR 8553 core/libs/prx/libSceIme/Export.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288387501 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8307#issuecomment-6288387501). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T10:00:08Z. --- <!-- 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 | |---|---|---|---| | [PR 8353](https://www.github.com/boykopovar/AnyPS5/pull/8353) | `docs/dev/debt/libSceAjm.native.md` [L6](https://github.com/boykopovar/AnyPS5/blob/71401e331c8044a2b050f6606f6ea947b45b88de/docs/dev/debt/libSceAjm.native.md#L6) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 3205](https://www.github.com/boykopovar/AnyPS5/pull/3205) | `core/libs/prx/libSceAjm.native/Export.cpp` | | [PR 5038](https://www.github.com/boykopovar/AnyPS5/pull/5038) | `core/libs/prx/libScePad/Export.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceSaveData.native/Export.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceNetCtl/Export.cpp` | | [PR 7881](https://www.github.com/boykopovar/AnyPS5/pull/7881) | `core/libs/prx/libScePad/Export.cpp` | | [PR 8553](https://www.github.com/boykopovar/AnyPS5/pull/8553) | `core/libs/prx/libSceIme/Export.cpp` |
oneandonlydean commented 2026-10-21 06:53:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T06:53:43Z.


@hypermoist thanks, each body matches your table, and instance_id >> 14 agrees with how sceAjmInstanceCreate builds ids here (Ajm.cpp:1736). One small docs fix, not blocking:

docs/dev/debt/libSceAjm.native.md line 6 still lists sceAjmInstanceCodecType with sceAjmInstanceExtend and sceAjmInstanceSwitch and says "these throwing declarations only resolve imports". sceAjmInstanceCodecType no longer throws, so please take it out of that entry, or say there that it returns the codec from the instance id as the firmware does.

Also, the title says 29 calls, but the table and the diff have 31 (11 NetCtl, 9 SaveData, 3 Hmd, 3 VideoRecording, 2 Http and 1 each for Ime, Pad and Ajm).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309988957 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8307#issuecomment-6309988957). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T06:53:43Z. --- @hypermoist thanks, each body matches your table, and `instance_id >> 14` agrees with how `sceAjmInstanceCreate` builds ids here (`Ajm.cpp:1736`). One small docs fix, not blocking: `docs/dev/debt/libSceAjm.native.md` line 6 still lists `sceAjmInstanceCodecType` with `sceAjmInstanceExtend` and `sceAjmInstanceSwitch` and says "these throwing declarations only resolve imports". `sceAjmInstanceCodecType` no longer throws, so please take it out of that entry, or say there that it returns the codec from the instance id as the firmware does. Also, the title says 29 calls, but the table and the diff have 31 (11 NetCtl, 9 SaveData, 3 Hmd, 3 VideoRecording, 2 Http and 1 each for Ime, Pad and Ajm).
hypermoist commented 2026-10-21 06:57:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-21T06:57:37Z.


@oneandonlydean thanks, both fixed. f4689c27a5 takes sceAjmInstanceCodecType out of that debt entry, which now covers only sceAjmInstanceExtend and sceAjmInstanceSwitch. The title and description now say 31: the diff removes 31 NotImplemented calls, matching your breakdown.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310048065 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8307#issuecomment-6310048065). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-21T06:57:37Z. --- @oneandonlydean thanks, both fixed. f4689c27a5 takes `sceAjmInstanceCodecType` out of that debt entry, which now covers only `sceAjmInstanceExtend` and `sceAjmInstanceSwitch`. The title and description now say 31: the diff removes 31 `NotImplemented` calls, matching your breakdown.
oneandonlydean commented 2026-10-21 07:08:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T07:08:19Z.


@hypermoist thanks, both look right. Full CI on f4689c27a5 is next.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310214956 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8307#issuecomment-6310214956). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T07:08:19Z. --- @hypermoist thanks, both look right. Full CI on `f4689c27a5` is next.
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!8307
No description provided.