The seven fixed-unit additions (Ticks, Microseconds, Seconds, Minutes,
Hours, Days, Weeks) now only check the two pointers and store the source
plus the amount modulo 2^64; they no longer return 0x80B50003 for a source
above 9999-12-31 or a result outside the tick range.
sceRtcTickAddMonths and sceRtcTickAddYears no longer reject a source tick
above the 9999 limit. They split the tick into a 16-bit year, add the months
in 32 bits and divide by 12 truncating toward zero. They return 0 without
writing when the 16-bit target year is outside 1 to 9999 or the month sum is
negative and not a multiple of 12; otherwise they write the result.
Observed by executing the code of libSceRtc.sprx from PS5 firmware 3.20 and
4.03 in an emulator with its imports mocked (entry points 0x32c0-0x3440,
0x3470, 0x37f0 on 3.20; 0x3370-0x34f0, 0x3520, 0x3890 on 4.03), not on a
console. Both firmwares give identical results on the same inputs. Current
firmware was not checked.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Require the measured separator after RFC date minutes when seconds are absent. Preserve the destination tick on the parse failure and retain the accepted trailing-space and seconds controls.
AI-assisted; based on guarded PS5 measurements with controlled input backing storage.
Add thirteen offsets measured repeatedly on PS5 firmware 13.42, keeping DST names ahead of their shorter prefixes. Cover case folding, prefix matching and a second valid date.
Written with AI assistance; validated against real hardware and the guest RTC tests.
Measured on a PS5 (firmware 13.60) through dlopen of libSceRtc.sprx.
The weekday is required in any case or length, month names may be
full, RFC 2822 and RFC 850 share one lenient grammar with 2-digit years
split at 50, and the asctime zone is ignored. Zones come from a name
table, a military letter, or +HHMM without a range check. Text the
console rejects returns a parse error with the tick untouched, and an
invalid calendar date returns 0 with only the offset applied to the
tick, as the console does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a PS5 (firmware 13.60) every input that starts with a digit gets the
same result and tick from sceRtcParseDateTime as from
sceRtcParseRFC3339, except that leading spaces and tabs are skipped
first. A string without a zone, or with a space instead of T, is a
parse error rather than UTC.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on a PS5 (firmware 13.60) through dlopen of libSceRtc.sprx:
an empty fraction is accepted, any digits past the sixth are dropped,
text after the zone is ignored, the offset is applied without a range
check, and a 60th second returns 0 with the tick only shifted by the
offset.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A year before 1980 or after 2107 cannot be packed into the DOS time, so
GetDosTime threw. Following the disassembly-derived fpPS4
reimplementation of the PS4 library, it now returns INVALID_YEAR after
writing 0 for an earlier year and 0xff9fbf7d, the largest encodable
time, for a later one. The TechnicalDebt entry now records fpPS4 as the
source for the SetDosTime year decode as well.
Ticks count microseconds since 0001-01-01 in the proleptic Gregorian
calendar, up to 9999-12-31 23:59:59.999999. Implement validation, tick
and date conversion, time_t and Win32 FILETIME conversion, UTC and
local time conversion through the host time zone, RFC 3339 formatting
and parsing, and tick arithmetic. Add sceRtcGetDaysInMonth,
sceRtcTickAddMonths and sceRtcTickAddYears, which clamp the day to the
end of the target month.
The network clock uses the host clock.
Co-Authored-By: Claude Opus 5.5 <[email protected]>