feat(libkernel_sys): answer sceKernelIsNeoMode from the param.sfo Neo-mode attribute #12427
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12427"
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?
Imported from boykopovar/AnyPS5. Originally posted by simnJS on 2026-10-28T13:15:14Z.
What
sceKernelIsNeoModethrewNotImplementedonmain. Gang Beasts (CUSA04865) calls it first among the stops listed in discussions/7941, and inFAMOUS Second Son (CUSA00223) imports it (discussions/8214).It now answers from the title's metadata:
param.sfo(PS4): returns bit 23 (0x00800000) ofATTRIBUTE, the title's PS4 Pro (Neo) mode support, and 0 when the key is absent.IsNeo() && support_neo_mode.PSFAttributesputssupport_neo_modeat bit 23, read fromATTRIBUTEin emulator.cpp, 0 when the key is absent.mainalready answers as a Neo console:sceKernelHasNeoModeandsceKernelIsAuthenticNeoreturn 1, the constants #9172 read in the 13.60 module. shadPS4 returnsIsNeo()from both, so the title bit alone decides here.param.json(PS5): still throws. What a PS5 application gets is unknown, and the PS5 module's body for this export has not been read.param.json or param.sfo not founderror, as for the other metadata queries.To make the attribute reachable, the
param.sfoparser in libkernel now reads theATTRIBUTEinteger, and libkernel exposes it asGetAppParamSfoAttribute_nid_no_patch. That accessor returns false for a title loaded fromparam.json. Every prx library links libkernel, and libSceVideoOut already readsGetAppAttribute3_nid_no_patchthe same way.Not measured on a console. The PS4 FW 10.71 base-model measurement in discussions/7941 (0) is for a console without Neo mode, so it does not settle this case. The debt entry in
docs/dev/debt/libkernel_sys.mdrecords both points. Theparam.sfoentry indocs/dev/debt/libkernel.mdnow listsATTRIBUTE.Tested
Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 r7 (x86_64-ucrt-posix-seh), Release,
BUILD_TESTING=ON, onmain750cf6cf48. No title run: the titles that import it are PS4 titles, which do not start onmainyet.guest_kernel_sys_neo_mode: one process per case, each in its ownapp0/sce_sys:ATTRIBUTE0x00800000gives 1 on two calls;0xFFFFFFFFgives 1;0x00004002) give 0;param.sfowithoutATTRIBUTEgives 0;param.jsonalone throwssceKernelIsNeoMode not implemented;param.jsonbeside a Neo-modeparam.sfothrows (param.jsonwins);param.json or param.sfo not found.param_sfo_parserchecks:ATTRIBUTEabsent gives 0;0x00800000is read as is;-1keeps all 32 bits;ATTRIBUTEis ignored;param_json_parserchecks thatparam.jsongives noparam.sfoattribute.guest_kernel_sys_neo_mode,param_sfo_parser,param_json_parser,guest_app_info;guest_kernel_sys,guest_kernel_sys_constants,guest_kernel_sys_console_identity,guest_kernel_sys_cpumode,guest_kernel_sys_sdk_version.main's throwing body forsceKernelIsNeoModeand the parser withoutATTRIBUTE:guest_kernel_sys_neo_modefails on its first case (sceKernelIsNeoMode not implemented);param_sfo_parserfails (An absent ATTRIBUTE is not 0).public_headersandpublic_headers_compile_*: 65/65 pass.relinkerbuilds; it compilesParamJsonParser.cppand only reads the title.python tools/check_conventions.py --base origin/mainwith this title and body: all checks pass.python tools/pr_overlap.py --branch feat/kernel-is-neo-mode: no conflicting lines or exports. #10335 also adds an include toExport.Discovery.cpp;git merge-treewith its head is clean. The PRs it could not compare already conflict withmain. Of those, the ones touchingExport.Discovery.cpp(#10657, #11031, #11034, #11212, #11216, #11267, #12130) change other functions.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:47:17Z.
Review: APPROVED
Re-reviewed exact head
af7d8d38c1bf5f988973b8987f1a3695f417eb64. The new Windows report completes the remaining focused-platform check:guest_kernel_sys_neo_mode,param_json_parser, andparam_sfo_parserpass 3/3. Earlier QEMU runs on the implementation head also passed those targets; this PR intentionally answers only from the SFO path, leaves JSON-selected titles unimplemented, and does not infer a PS5 answer. The current-main merge preview is clean. Hosted Windows, relinker matrix, conventions, and report checks pass; the Linux/product job is skipped. I did not rerun the tests locally or validate on a console/title.