Waveform adds now follow the PS5 module in cases main threw or answered with
the wrong code: flag bits 0x8, 0x20 and 0x40 and up are ignored in the values
PS5 ran, an add of no blocks with APPEND or RESET|APPEND returns 0 (or the
closed code on a closed waveform), one APPEND block on a mono PCM voice with
nothing queued is queued as a block of no frames (unsigned 8-bit, 16, 24 and
32-bit integer, 32 and 64-bit float), and any add to a never-set-up voice whose
waveform an add of no blocks closed returns the closed code.
The PS4 library shares the sources and returns its own code for a closed
waveform and a full queue, 0x804A0151, as PS4 11.00 does.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
At 0.7f the stale stop was already excluded by the position comparison
(0.5 >= 0.7 fails), leaving the epoch conjunct of the stop walk
uncovered. At 0.3f the position check passes and only the epoch match
keeps the walk from splicing past the stale stop; removing the conjunct
aborts guest_font_graphics.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Same DrawupPackColor fix as on the parent branch: NaN (admitted by
DrawupColorValid) is undefined through static_cast<int32_t>; firmware
converts with vcvttss2si into 64-bit registers, so an invalid channel
contributes a zero byte from the indefinite value's low dword. Assert
the packed stop color for a NaN channel (0x80800080) and correct the
FlatColor NaN expectation to 0x00000000. Verified under
-fsanitize=float-cast-overflow -fno-sanitize-recover on Linux.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
GraphicsAppendGradientSegment computed unitUsed % unitSize ahead of the
unitSize==0 check that selects 0x804600a0, leaving the guard dead behind
an undefined division. The firmware body carries the same defect (the
unguarded div at 0x20703 faults before its own dead 0x208fa branch), but
on the host the check is the only defined outcome for a corrupt frame,
so hoist it ahead of the first modulo; behaviour on every valid frame
(unitSize is always positive after object init) is unchanged. Adds the
zero-size regression case.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
sceFontGraphicsAppendGradientSegment decodes from the 4.03 libSceFont
body at 0x20500: sorted-inserts a 0x18-byte color-stop node into the +8
chain of linear (0x20) and radial (0x30) gradient records while
node->+4 == record->+4 and position >= node->+0x10. Stop records live in
a unit byte stream built from the per-object segment arena at
object->+0x10 (+0xc0 descriptor, mutex at +0x40, stats +0x48/+0x4c),
allocated by the span allocator at 0x1b5e0 (12-byte nodes: count(22b),
chain index(21b), span end(21b); index 0 is the sentinel). Units chain
through frame->+0x18/+0x20 with byte position in frame->+0x10/+0x14;
sub-0x18 tails get a 0xff pad record plus a zeroed tail. Validation
order, error codes (0x80460020/0x80460086/0x80460002/0x804600a0), NaN
acceptance, stats updates skipped on alloc failure, and the pad loop's
abandon-on-failure all follow the disassembly; guest_font_graphics
covers insert order, epoch stop, pads, unit boundaries and exhaustion.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>