Commit Graph
27 Commits
Author SHA1 Message Date
Dean b705f11176 Merge pull request #6673 from xXPBSXx/docs/debt-ngs2-custom-module-0x20
docs(debt): list the NGS2 custom module id 0x20 of PPSA35169
2026-10-17 16:43:39 +13:00
Adrià FranchandClaude 0129876e52 docs(debt): name the KytyPS5 source and limits of sceNgs2GeomApply
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 21:59:08 +02:00
alosta b630e7897b fix(libSceNgs2): implement a minimal sceNgs2GeomApply pass-through
Implement sceNgs2GeomApply, which was previously an unimplemented
throwing stub and was blocking Dead Cells (PPSA15552).

The implementation validates null handles/output addresses and writes a
minimal Ngs2GeomAttribute: pitch_ratio 1.0, source position, source
volume/level maxima, and diagonal channel levels for the source's channel
count. It does not implement source attenuation, distance rolloff, panning
or Doppler.

The export lives in Geom.cpp's internal Ngs2GeomApply and is exposed through
the existing default-visibility wrapper in Voice.cpp. Unimplemented.cpp no
longer defines the stub. A passing test was added to Ngs2Geom.cpp.

Unblocks: PPSA15552 #<Game bring-up discussion number>
Depends on: none
AI assistance: yes
2026-10-16 21:59:08 +02:00
Adrià ea4cc112a0 Merge pull request #5916 from JosepBove/fix/ngs2-rack-voice-index-error
fix(ngs2): return the voice-index error from sceNgs2RackGetVoiceHandle
2026-10-16 21:54:28 +02:00
alosta f888a236bc fix(libSceNgs2): support custom filter type 0 in Ngs2ApplyCustomParam
Allow custom voice filter type 0 to clear the destination filter,
matching the sampler filter convention. Type 1 continues to configure
the biquad frequency, Q and level. Other unsupported filter types
still throw.

This follows the listener-transform support in
fix/libSceNgs2-listener-transform and is needed for Dead Cells
(PPSA15552), which reaches this path after the custom sampler rack.

Depends on: fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener- #5810
Unblocks: PPSA15552
AI assistance: yes
2026-10-16 20:31:18 +02:00
xXPBSXxandClaude Sonnet 5.5 905a0dffb2 docs(debt): list the NGS2 custom module id 0x20 of PPSA35169
Trails in the Sky 2nd Chapter creates a custom rack with module id 0x20, which Custom.cpp rejects; the module and its structure are unknown (#4246).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 05:45:49 +02:00
Adrià FranchandClaude 2f25a54b7b docs(ngs2): cite the PS5PCEM source that exists and describe the orientation handling as implemented
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 15:03:32 +02:00
alosta 868d8bd24c fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener
Restore world-to-listener matrix construction instead of rejecting
non-default orientation, translation or flags.

- Build an orthonormal row-major matrix from position, orient_front
  and orient_up; apply the right-handed axis flip for flag 1.
- Store the negated dotted translation in each matrix row.
- Validate unknown flags, invalid or non-finite input, short
  orientation axes, and unrepresentable translation without changing
  the output.
- Preserve finite velocity and positive finite sound speed.
- Update NGS2 geometry tests and the libSceNgs2 technical debt note.

AI assistance: yes
2026-10-15 15:03:25 +02:00
Adrià FranchandClaude a8be2c8fee docs(ngs2): matrix levels debt line names the voice-without-format exception
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 13:49:09 +02:00
milescovielloandClaude Opus 5.5 c6e3af3258 fix(ngs2): accept empty waveform blocks and matrix levels on a voice without a format
A sampler voice set up with an all-zero format has no channels. Adding no
waveform blocks to it, or setting a matrix with no levels, threw
std::invalid_argument, which ends the title.

Accept both on such a voice: the empty add only applies RESET and the
CONTINUE state, and the empty matrix clears that matrix, which rendering
already treats as unset. Blocks with data, APPEND, and an empty matrix on
a voice with a format are still refused.

Steins;Gate Re:Boot (PPSA36591) clears a voice this way when a button is
pressed at its title screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:48:54 +02:00
Adrià 5e7d09aafe Merge pull request #5538 from JJenkx/fix/ngs2-render-capacity
fix(ngs2): limit render writes to the configured grain
2026-10-15 13:29:33 +02:00
Dean a077a88df5 Merge pull request #5139 from Kikoarl/feat/ngs2-custom-module-user-fx
feat(ngs2): support custom submixer rack UserFx module 0x1d
2026-10-15 15:34:22 +13:00
JosepBove 9926c6b76b docs(ngs2): cite the PS5 module for the voice-index error 2026-10-14 18:36:33 +02:00
JosepBove 17f8bb521e docs(ngs2): name DOOM + DOOM II among the titles that probe the voice index 2026-10-14 17:55:09 +02:00
JosepBove 5fe4780812 fix(ngs2): return the voice-index error from sceNgs2RackGetVoiceHandle
An index at or beyond the rack's voice count returned through
APS5_INVALID_ARG_EX, which throws and ends the process. Heretic + Hexen
(PPSA26525) creates a one-voice reverb rack, takes voice 0 and asks for
voice 1 at start-up, so it stopped at 1.5 s on
"sceNgs2RackGetVoiceHandle: invalid argument". Return 0x804A8305 and
leave the output handle untouched, after the existing null-output and
rack-handle checks. The value follows prosper's analysis of
libSceNgs2.native.sprx; shadPS4 lists 0x804A0302 for the PS4 library.
Neither is a PS5 measurement, recorded in the technical debt.

ngs2_voiceindex creates one-voice sampler, submixer, mastering and
reverb racks and a default sampler rack, and checks the error, the
untouched output, the null-output and invalid-rack codes and that the
last valid index still resolves afterwards. It aborts on main's library
with the throw above and passes with this change.
2026-10-14 17:29:25 +02:00
Adrià 956269ad1a Merge pull request #5470 from p3n1cillin/claude/ngs2-custom-sampler-state
feat(ngs2): report custom sampler voice state
2026-10-14 14:20:02 +02:00
Kikoarl 40e2019756 feat(ngs2): support custom submixer rack UserFx module 0x1d
Accept SCE_NGS2_CUSTOM_MODULE_ID_USER_FX (0x1d) on custom submixer racks alongside UserFx2 (0x1f). When configuring a custom rack voice, support voice control parameter SCE_NGS2_CUSTOM_VOICE_PARAM_USER_FX (0x40001d00) to install custom submixer UserFx callbacks with user data. Run legacy UserFx callbacks during custom voice rendering and update sample presence flags accordingly.

Fixes runtime abort in Void Terrarium (PPSA03061):
  terminate called after throwing an instance of 'std::runtime_error'
    what(): NGS2: custom module id 0x1d is not implemented
  FATAL: abort() (SIGABRT)

Closes #5055
2026-10-14 10:04:34 +02:00
JJenkx aaa34abc67 Merge commit '30f961266ade83b41d5c9de7dec1393e7fcecfb7' into fix/ngs2-render-capacity 2026-10-13 18:59:57 -04:00
p3nicillinandClaude Opus 5.5 87f2c7de83 feat(ngs2): report custom sampler voice state
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>
2026-10-13 21:20:15 +01:00
MarcZX100 8b0da182a0 fix(ngs2): resolve voice patches to rack handles 2026-10-13 20:02:08 +00:00
Dean Galvin 22f6b1735c docs: keep the technical debt index and end the NGS2 entry with a newline
The rebase onto main deleted docs/dev/TechnicalDebt.md, which is now the
index that points into docs/dev/debt/. Restore it from main and add the
missing final newline to docs/dev/debt/libSceNgs2.native.md.
2026-10-14 08:39:38 +13:00
jnbla6 40ebfae70b fix: throw on unsupported filter types and update debt docs 2026-10-14 08:39:32 +13:00
Jnbla6 855823e85e feat(libSceNgs2.native): implement custom sampler rack id 0x4001 (#4334) 2026-10-14 08:39:32 +13:00
JJenkx d6cd25e123 fix(ngs2): limit render writes to the configured grain 2026-10-12 21:36:12 -04:00
lorkydey dadc23a8c1 fix(libSceNgs2): reject unverified listener transforms 2026-10-12 23:12:40 +02:00
lorkydey 4168cf3bbd feat(libSceNgs2): calculate the listener coordinate transform 2026-10-12 23:10:42 +02:00
Adrià FranchandClaude 342a8c4590 docs(debt): move library entries to one file per library
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 20:38:29 +02:00