Repository navigation
feat(libSceNgs2.native): implement sceNgs2ParseWaveformFile and parse 16-bit PCM waveforms - #1020
Conversation
|
Thanks. A named title with the exact stop on main is what we look for, and the change fits the existing ATRAC9 parser well (linking Two small things before it can go in:
The CI run needs a maintainer's approval because this is your first PR here; that's on our side. |
|
Thanks for the review. Pushed an update (e59b99b):
|
|
The Linux Pushed 13f0370: the test now asks |
… 16-bit PCM waveforms
…formFile and reject PCM data that does not fit The call site of PPSA21402 sets only three argument registers, so the function has no size parameter. A data chunk that runs past the buffer or ends inside a frame returns INVALID_WAVEFORM_DATA instead of being shortened. The test no longer writes padding from a string literal.
…the guest path resolves On Linux every absolute guest path is resolved under the working directory, so the temporary file in the host temp directory was not found. The test now asks ResolvePath_nid_no_patch for the host path of a guest path and writes the file there.
13f0370 to
1bdc37b
Compare
|
Thanks for the fixes. The Linux CI job still fails on the new head, in the ATRAC9 test this PR changes: Could you take a look? It can go in once both jobs are green. |
…ecutable On Linux ngs2_atrac9 aborted without any output once TestParseFile was part of its main(). The exception that TestCorruptSuperframeAtPageEnd throws in the Ngs2 module and catches in main() has to resume through a cleanup landing pad inside main(). That resume goes through the unwinder statically linked into the test executable, which then fails with _URC_FATAL_PHASE2_ERROR and aborts silently. Whether main() gets such a pad depends on what the compiler inlines into it, so adding any function with non-trivial cleanups to that main() is enough to trigger it. Move the PCM and file parse tests into a new ngs2_parse executable and restore Ngs2Atrac9.cpp to its upstream content, so the test that catches exceptions is unchanged. The new executable has no catch and never relies on that path.
What
Implements
sceNgs2ParseWaveformFile(path, offset, info)(resolves the guest path, reads the file fromoffsetto its end, and reusessceNgs2ParseWaveformData) and adds 16-bit PCM RIFF parsing tosceNgs2ParseWaveformData. Previously only ATRAC9 was parsed and any other format tag threw. Adatachunk that runs past the buffer or ends inside a frame returnsSCE_NGS2_ERROR_INVALID_WAVEFORM_DATA(assumed, recorded in TechnicalDebt); looped PCM and other PCM formats still throw.PPSA21402 (Balatro) imports
sceNgs2ParseWaveformFile. Its call site sets only three argument registers (path, offset, info), which is where the signature comes from. It loads its sound effects as 16-bit PCM.wavfiles (80 of 80 have adatachunk that exactly fills the file). It failed at startup with an unresolved import, then withparsing waveform format tag 0x1 is not implemented.Tested
ctest -R ngs2passes (render, atrac9, filter, custom), including new tests for PCM parsing (adatachunk past the buffer or ending inside a frame, 8-bit and zero-channel files are rejected) and file parsing (offset, offset past the end, null path and info).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)