Repository navigation
fix(libSceNgs2.native): parse ATRAC9 smpl loops as the module does - #9327
oneandonlydean merged 16 commits into
Conversation
…s in sceNgs2CalcWaveformBlock
|
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.
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.
|
|
Windows run of 69b21ad merged onto Built |
…-atrac9-parsed-delay
|
@MarrasFederico thanks for the VAG blocks and the module-style ATRAC9 mapping. I read the diff on be6d4f2, and it builds against current
For all of these, what's the evidence behind "as the module does": disassembly offsets, or results from a console run? A note in the PR body would be enough. |
…ay and blocks past the data chunk
|
@oneandonlydean thanks for the careful read. Where it says "as the module does" it's prosper's reading of
I also merged current |
|
@MarrasFederico on the rate question: keep the throw for rate indices other than 1, 4 and 7. The module's own table has no frame size for them, so a 44.1 kHz file can't be parsed or mapped by the real module either, and keeping That rests on the third-party reading of the table at rodata The other four points are covered in your comment; they need a read of the new head, which is a separate step. |
|
@oneandonlydean thanks, I'm keeping the throw. The PR body now has an "Evidence: read, not measured" section. It lists the table at rodata |
What
sceNgs2ParseWaveformDatabuilt ATRAC9 loop blocks with AnyPS5's own rules from #1301. Its debt entry recorded those rules as "unverified on hardware". The parser now follows prosper's reading oflibSceNgs2.native.sprx, the same rules #9149 applies to PCM:begin = start - delayandend = last - delay + 1, which wrap in 32 bits. The type, fraction, play count and any further loops are ignored.0xFFFFFFFF), and a tail when the end is not the last sample;sceNgs2CalcWaveformBlockmapping (feat(libSceNgs2.native): map ATRAC9 waveform blocks as the module does in sceNgs2CalcWaveformBlock #9155) plus the data offset.What changes for titles:
INVALID_WAVEFORM_DATA.What still throws (in the rewritten debt entry):
smplchunk too short for its count or first loop, where the module reads the bytes after it;This builds on #9155 (the block mapping) and #9143 (the delay). The branch merges both.
Evidence: read, not measured. Every "as the module does" in this PR comes from a third-party reading of
libSceNgs2.native.sprx, prosper's, done from the disassembly (parse core at file offset 0x10f50, block list 0x11a20,CalcWaveformBlock0x12060). Nobody here has checked it against the module, and nothing was run on a console. That includes:0x4e520, which has a frame size only for rate indices 1, 4 and 7, so the other rates throw;factchunk says;datahandling: the module does not bound blocks by thedatachunk.The two new throws, for a
smplstart inside the decoder delay and for a loop block past thedatachunk, cover cases where that reading shows the module wrapping or not bounding, so what it would then decode is unknown.Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.ngs2_atrac9:TestParseLoops: keeps its seven ranges, both sampler positions and the bit-exact comparison with the reference decoding. It now expects the loop block to repeat forever, renders the intro and three passes of the loop, and keeps the exit-loop case with its tail.TestMalformedLoops, rewritten for the module's rules:INVALID_WAVEFORM_DATA;smplchunks of 28, 36 and 50 bytes throw, while 52 bytes is enough.INVALID_WAVEFORM_DATAfor an end not after the start, or mapping the play count to repeats makes them fail.ngs2tests pass.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pyreports fix(ngs2): retain PCM input when reporting decoded bytes #5548 and my fix(libSceNgs2.native): return the module's errors for render buffer counts, types and null buffers #9320 on debt L9-10, the entries next to this one. It could not compare feat(ngs2): decode complete HE-VAG waveform blocks #5797, which does not change loop parsing.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)