Follow the console libc.prx (PPSA02530) at 0xcb2d0: ignore the argument and throw the static bad_array_new_length object. Star Wars Racer (PPSA28416) imports it.
The libc.prx that PS5 titles ship (PPSA05916, PPSA07923, PPSA13934) gives
strerror, strerror_r and strerror_s texts for eight numbers above the
FreeBSD range: 107 "State not recoverable", 108 "Owner dead", 152 "File
positioning error", 1040 "No message available", 1050 "No stream
resources", 1051 "Not a stream", 1062 "Other" and 1074 "Stream timeout".
AnyPS5 answered "error_code=0x%08x" for them. Every other number from
-2000 to 2000, INT_MAX and INT_MIN already matched.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fputws and wprintf write a UTF-16 surrogate pair as one four-byte
UTF-8 sequence, but fgetwc decoded that sequence into a single code
point above 0xFFFF, which is not a 16-bit guest wchar_t value, and
fgetws stored it truncated: fputws(u"A\U0001F600\n") read back as
A, U+F600, newline.
fgetwc now returns the high surrogate and keeps the low one in the
stream for the next read, so fgetws stores the pair, also when the
buffer fills between the two halves. A successful seek discards it,
as FreeBSD's fseeko resets the stream's mbstate. Sequences that
decode to an overlong form or above U+10FFFF, and lead bytes F8 to
FF, fail with EILSEQ instead of returning made-up characters; the
three-byte surrogates that fputwc writes for a single unit are still
read back as that unit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QegaHM5QeCynUQ2ZLWHE4b
log10 returned the host's log10, whose last bit differs from the titles'
copy on Windows on 3,066,397 of 320 million random arguments. The titles'
copy is the fdlibm e_log10.c over its k_log.h, which FreeBSD 11.4 later
replaced, and it sets EDOM for every nonzero argument with the sign bit set
but leaves errno alone for +-0. log10 now computes that and sets EDOM there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
log2 returned the host's log2, whose last bit differs from the titles' copy
on Windows. The titles' copy is the fdlibm e_log2.c over the same k_log.h
kernel as log10, which FreeBSD 11.4 later replaced, and it sets EDOM for
every nonzero argument with the sign bit set but leaves errno alone for
+-0. log2 now computes that over the kernel, renamed KernelLog because both
functions use it, and sets EDOM there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
log10 returned the host's log10, whose last bit differs from the titles'
copy on Windows on 3,066,397 of 320 million random arguments. The titles'
copy is the fdlibm e_log10.c over its k_log.h, which FreeBSD 11.4 later
replaced, and it sets EDOM for every nonzero argument with the sign bit set
but leaves errno alone for +-0. log10 now computes that and sets EDOM there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>