sysmodule: load game-shipped modules from /app0/sce_module #1266
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1266
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1266/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@overlordxrz-source on GitHub · 2026-10-09 00:10 UTC · original
overlordxrz-source:libs/sysmodule-game-modules→main· +62 −0 · 1 files · 1 commits · closed without mergingWhat
sceSysmoduleLoadModule/sceSysmoduleLoadModuleInternalWithArgnow load and start a module from/app0/sce_module/<name>.prxon the first request when the ID is one that libSceSysmodule marks as a game module (the module ships with the game, not with the system). Nothing else changes. Unknown IDs, system modules, an already loaded PRX, or a missing file all keep the current reference-count-only behaviour. 210d4dc's load/unload/IsLoaded bookkeeping is untouched.The IDs are the entries flagged "located in /app0/sce_module" in libSceSysmodule's module table: 0x38 Face, 0x39 Smart, 0x86 S3DConversion, 0x93 Hand, 0xcb HeadTracker, 0xd8 FaceTracker, 0xd9 HandTracker, 0xe8 AudioLatencyEstimation, 0xf7 NpToolkit, 0xfe JobManager, 0x102 NpToolkit2, 0x115 NpCppWebApi, 0x135 FontGsm. shadPS4 uses the same table (
sysmodule_table.h,IsGame). Loading goes through the same stepssceKernelLoadStartModuleuses:LoadProgram, thenRelocateProgram(which re-relocates everything, so imports already bound to stubs in the eboot or plugins get rebound), thenStartModule.Root cause
fdac55astopped preloading every PRX insce_module/and now loads only libc, because "other PRXs are requested by the application". That matches the real runtime. But the request path,sceSysmoduleLoadModule, never loaded anything. So since Oct 4, modules a game ships besides libc are never mapped or started, and every import from them resolves to the unresolved-import stub, which returns 0. With210d4dc,sceSysmoduleIsLoadedcorrectly reports these modules as unloaded, so games now go down the "load it myself, then use it" path and call straight into those stubs.The PS5 IDs for these modules match the table. In the pre-Oct-4 logs attached to issues here (33 runs from the blanket-preload era, which list every sce_module file), every game that logs
id = 277(0x115) shipslibSceNpCppWebApi.prx. No game requests 0x115 without shipping it. The other 3 ship it, but their logs end before they request it. Examples: Demon's Souls PPSA01341/PPSA01342, Astro Bot PPSA21564, Astro's Playroom PPSA01325, and Kerbal Space Program PPSA03748 and other Unity titles. Post-Oct-4 logs (#1121, #1134, #1158, #1070) showUnresolved import stub called ... [NpCppWebApi_v1].Games / issues
58978d1(comment by FilipMW) faults in game code reading NULL+0x60. Its sce_module islibc.prx+libSceNpCppWebApi.prx, and it callssceSysmoduleLoadModule(0x115)at startup. This patch makes that call load the PRX again. I haven't confirmed this is the cause of that crash.45b6d2cno longer shows on2f4b8a3(latest comment: it now reaches rendering and hits a separate Vulkan depth-compare format error). That fits 210d4dc'sIsLoadedfix. This PR doesn't claim to fix it.NpCppWebApi_v1unresolved stubs come from the missing module this loads.Tested
src/libs/libSysmodule.cppfor x86_64-linux (zig c++ 0.17, C++20) against current main.src/.clang-format.kernel_file_system_testsonly uses 0x113/0xb4, which aren't game modules, so its behaviour is unchanged.Written with AI assistance.
@coderabbitai[bot] on GitHub · 2026-10-09 00:12 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
36e1b9fd-6c11-4961-a3f8-c23a67e2d880📥 Commits
Reviewing files that changed from the base of the PR and between
2f4b8a335dand1125a0013e.📒 Files selected for processing (1)
src/libs/libSysmodule.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
LoadModulenow callsLoadGameModulebefore incrementing the module reference count. The new helper maps recognized IDs to module names, checks for files under/app0/sce_module, skips files already registered with the runtime linker, and loads and relocates other files. It starts a loaded module only when its initialization address is nonzero.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
1125aThe supplied evidence identifies no issue that must be fixed before merging. Game testing was not reported, so normal validation remains appropriate.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@overlordxrz-source on GitHub · 2026-10-16 18:52 UTC · original
Closing in favour of e7ac24203's table of game-shipped modules. Happy to add module IDs to it when a game needs one.
Pull request closed