Repository navigation
feat(ngs2): report custom sampler voice state - #5470
Merged
adriadam10 merged 1 commit intoOct 14, 2026
Merged
Conversation
Dead Cells (PPSA15552) calls sceNgs2VoiceGetState on custom sampler voices with a 48-byte buffer and reads the 64-bit value at offset 16 as a running counter. Fill it with the decoded sample count, keep the common state flags, and return INVALID_OUT_SIZE for other sizes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 tasks done
12 tasks done
Collaborator
|
Checked the new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
With #4417 merged, Dead Cells (PPSA15552) creates custom sampler voices (rack
0x4001) and polls them withsceNgs2VoiceGetState. That call threw for every custom sampler voice:The title passes a 48-byte buffer at two call sites, and both read only the 64-bit value at offset 16:
So offset 16 is a running counter that the title measures progress with. The custom sampler state now:
INVALID_OUT_SIZEfor any other size, as the sampler, submixer and reverb racks do.shadPS4's
OrbisNgs2CustomSamplerVoiceStateis about 80 bytes, so it doesn't match what this title passes. The size and that one field come only from the title, and the other field names and the console's values are unverified. This is recorded under Unknown function info indocs/dev/debt/libSceNgs2.native.md.Tested
Dead Cells on Windows 11 (MinGW GCC 15), on
maina0f5916a2with fix(ngs2): resolve voice patches to rack handles #4777. Dead Cells patches a sampler voice to a rack handle, which needs fix(ngs2): resolve voice patches to rack handles #4777 first. It also needs two local, unsubmitted stubs:mainreads (see my comment on #4417);sceNgs2GeomCalcListenerlistener, front(1,0,0)and up(0,0,1).Before this change, it stops on the error above about 80 s in. After it, it runs for the whole 120 s run with no library stop. With the same stack plus a local stand-in for this call, it reaches its title screen with audio.
Unit test:
ngs2_customnow creates a custom sampler voice, renders one grain and checks that:INVALID_OUT_SIZE;INUSE|PLAYINGwith 8 decoded samples, then 16 after a second render.With
main'sVoice.cppthe test aborts on the throw. All 10 NGS2 tests pass on Windows and on Linux (WSL Ubuntu, GCC).python tools/check_conventions.py --base origin/mainandtools/pr_overlap.pypass, with no overlap with open PRs.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)🤖 Generated with Claude Code