fix(libSceNgs2): accept system option flag bit 1 #8341
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8341"
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 KernelPanicNT on 2026-10-20T10:36:11Z.
What
Rise of the Ronin (PPSA04540) creates its NGS2 system with
flags = 2inNgs2SystemOption. The other fields are nameKTSL2, 512/512 grain samples and 48000 Hz.CheckedSystemOptionthrows on any non-zero flag, and that is where the title stops (#2171:NGS2: system option flags are not implemented).With this change the title gets past that stop: @EdouardSence ran PPSA04540 01.009.000 on
mainat8c9161eacwith and without this commit (comment, follow-up). Without it the title stops onNGS2: system option flags are not implemented; with it the title loads further and stops onNGS2: custom module id 0x15 is not implemented, the custom rack gap mapped in #8039, which this PR does not address.This change accepts bit 1 and ignores it. Every other bit still throws, and the message now names the value.
Source of the behaviour.
0x1e7e0, used bysceNgs2SystemQueryBufferSize,sceNgs2SystemCreateandsceNgs2SystemCreateWithAllocator).0x90) and then only the fields from+0x6con: maximum grain, grain, sample rate and channel count.flagssits at+0x68(Ngs2SystemOption), and the validator does not check it.SystemSetupreads onlyflags >> 31, for the context buffer layout. It passes no other bit into system setup.What bit 1 selects is unknown. It could still matter later, for example during rendering. For that reason only bit 1 is accepted, and not every value the validator lets through. Bit 31 and the other bits keep throwing, because their effect is not implemented.
Changes:
CheckedSystemOptionmasks out the known flag0x2, following theknownFlagspattern used for waveform block flags inVoice.cpp. Any remaining bit throwsNGS2: system option flags 0x… are not implemented.ngs2_render, newTestSystemOptionFlags:flags = 2, the buffer size query andsceNgs2SystemCreatesucceed, and a sampler voice renders its PCM unchanged through a mastering voice;0x1,0x3,0x4,0x80000000and0x80000002still throw.docs/dev/debt/libSceNgs2.native.md: a new entry under "Unknown function info" records the accepted bit, its source, the title that passes it, and that its meaning is unknown.Tested
Title: Rise of the Ronin (PPSA04540) 01.009.000, run by @EdouardSence on 2026-10-19 (Linux, AMD RX 9070 XT, Mesa 26.2.4 RADV; comment, follow-up). On
mainat8c9161eacit stops after about 38 s (cold shader cache) onNGS2: system option flags are not implemented. With this commit cherry-picked onto the samemainit loads past that point and stops after about 20 s (warm cache) onNGS2: custom module id 0x15 is not implemented(#8039, not part of this PR). @EdouardSence, if you have time, could you confirm this on the rebased head6539598d5?Linux (GitHub Codespace, 4 cores, native build of this branch on
02fb1ce53):ngs2_render_tests,ngs2_handleerrors_testsandngs2_custom_tests: 5/5 runs each pass.System.cppfrommain,ngs2_render_testsaborts withNGS2: system option flags are not implemented, and the other two still pass; 5/5 pass again after restoring it.ctest -R ngs2_: all 13ngs2_*tests pass.Windows (fork CI, run 39406530313, this branch on
02fb1ce53merged into the fork'smainatd14a186f4): build and the full test suite pass, 1734/1734.Checks:
python3 tools/check_conventions.py --base origin/mainpasses.tools/progress.py: unchanged (4246/6515 on base and head).Duplicate and overlap check
Searches of open and closed pull requests for "system option flags",
CheckedSystemOption, "system option" andNgs2SystemOptionfind no other change to this check.python3 tools/pr_overlap.py --branch fix/ngs2-system-option-flag-bit1reports no overlapping change. It could not compare drafts #1384 and #5797, which conflict withmain; checked by hand: #1384 (I3DL2 reverb) changessceNgs2SystemSetSampleRateinSystem.cpp, notCheckedSystemOption, and #5797 (HE-VAG) adds its debt entry at the top of the same debt section. #8238 (rack lock) was compared: it changes the locking inSystem.cpp, not the option check.Checklist
main(02fb1ce53); 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)custom module id 0x15, #8039)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T03:09:47Z.
Independent Windows run of this PR (data only).
Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against
mainis clean. I built onlyngs2_core_render_tests;ctest -N -R ngs2_core_renderlists exactly one test.Results (3 runs each):
ngs2_core_renderpasses 3/3.core/libs/prx/libSceNgs2.native/src/System.cppwith the version from the PR's merge base (02fb1ce532), then rebuilt. The test fails 3/3 (exit 0xc0000409, a failed Require). I restored the PR's file afterwards.Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-21T08:19:11Z.
Confirmed on the rebased head
6539598d5(merge base02fb1ce53), built as-is with no other PRs or local changes.NGS2: system option flags are not implemented. The title loads past that point and aborts after about 38 s on:That is the same stop as on the 19th with the earlier commit, so the rebase keeps the behaviour. The
0x15stop is the custom rack gap tracked in #8039.Not tested: other titles, the CTest suite.
Tested and written by Claude (AI assistant) on a contributor's machine.
AI-assisted: yes