Files
AnyPS5/docs/dev/debt/libSceRtc.md
T
2026-10-21 03:41:06 -03:00

5.4 KiB

libSceRtc technical debt

Silent stubs

  • sceRtcInit, sceRtcEnd (libSceRtc) - return 0 and do nothing, as the console functions do: both are a bare xor eax, eax; ret in libSceRtc.sprx on firmware 13.60

Unknown function info

  • sceRtcParseDateTime (libSceRtc) - the zone name table matches every name of 1 to 3 uppercase letters as a payload process on PS5 firmware 13.60 parsed them in the RFC 2822 form; of the longer names only real ones were tried (ACDT, AEST, CEST, NZDT, MESZ and others). Any other name of 4 or more letters is assumed to take the military letter offset of its first character, so a longer name the console's table holds but nobody measured gets the wrong offset
  • sceRtcParseDateTime (libSceRtc) - a blank zone after seconds is accepted. With fully allocated input storage on PS5 firmware 13.42 and again on 13.60, the same NUL-terminated text returned BAD_PARSE when the byte after its terminator was zero and succeeded when that byte was uppercase T. This dependence on storage after the terminator is not modeled; controlled backing-byte measurements in a title process are unavailable.
  • sceRtcFormatRFC2822, sceRtcFormatRFC2822LocalTime, sceRtcFormatRFC3339LocalTime (libSceRtc) - only shadPS4 (PS4) has bodies. A null tick formats the current time, as shadPS4 does and as these three and sceRtcFormatRFC3339 did in a payload process on a PS5 (firmware 13.60); offsets outside ±1439 minutes return INVALID_VALUE like sceRtcFormatRFC3339, also with a null tick there; the local-time variants use the host's offset at the given instant (shadPS4 uses sceKernelGettimezone, the current offset)
  • sceRtcGetDosTime, sceRtcSetDosTime (libSceRtc) - bit layout from shadPS4 (PS4, the standard FAT date/time). A year outside 1980-2107 makes GetDosTime return INVALID_YEAR after writing 0 for an earlier one and 0xff9fbf7d (2107-12-31 23:59:58, the largest encodable time) for a later one, and SetDosTime decodes the year as the unsigned 7-bit FAT field (1980-2107) without validating the fields, as the disassembly-derived fpPS4 reimplementation of the PS4 library does; not confirmed on a PS5 title, and shadPS4 instead masks out-of-range years into the packed value and sign-extends the 16-bit date
  • sceRtcGetCurrentRawNetworkTick (libSceRtc) - the console reads clock 0x13 and returns its time plus the Unix epoch in ticks, or 0x80B50001 when the clock is unsupported (errno 5). The raw network clock is not modelled; this returns the host clock. Read from the disassembly of libSceRtc.sprx on firmware 13.60, not measured on a console
  • sceRtcGetCurrentAdNetworkTick, sceRtcGetCurrentDebugNetworkTick (libSceRtc) - the console reads clocks 0x12 and 0x11 and falls back to network clock 0x10 when either clock is unsupported. These getters use their process-local clock when it was set, otherwise they follow the process-local network clock. The firmware's unsupported-clock result is not modelled. Read from the disassembly of libSceRtc.sprx on firmware 13.60, not measured on a console
  • sceRtcSetCurrentTick, sceRtcSetCurrentNetworkTick, sceRtcSetCurrentAdNetworkTick, sceRtcSetCurrentDebugNetworkTick (libSceRtc) - a valid tick sets a process-local clock that advances from a monotonic host clock; the host system clock is not changed. The console sets clock 0, 0x10, 0x12 or 0x11. Null pointers return 0x80B50002 and ticks before the Unix epoch return 0x80B50003, from disassembly of libSceRtc.sprx on firmware 13.60, not measured on a console. sceRtcSetConf passes its third and fourth arguments to the same clock call with clock 0 and throws; what the pair selects is unknown
  • sceRtcFormatRFC3339Precise, sceRtcFormatRFC3339PreciseLocalTime (libSceRtc) - read from the disassembly of libSceRtc.sprx on firmware 13.60: a null tick means the current tick, a precision above 6 or a zone outside -1439 to 1439 minutes returns 0x80B50003, and the fraction is the microseconds truncated to the requested number of digits. Not compared with console output. The output buffer size is unknown; at most 33 bytes are written
  • sceRtcGetYear, sceRtcGetMonth, sceRtcGetDay, sceRtcGetHour, sceRtcGetMinute, sceRtcGetSecond, sceRtcGetMicrosecond, sceRtcSetYear, sceRtcSetMonth, sceRtcSetDay, sceRtcSetHour, sceRtcSetMinute, sceRtcSetSecond, sceRtcSetMicrosecond (libSceRtc) - inferred component behavior without confirmed hardware trace. Component setters validate individual boundaries (e.g. day 1..31) independently without cross-field calendar validation; getters return 0x80B50002 (SCE_RTC_ERROR_INVALID_POINTER) for a null pointer

Functional