mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-23 17:13:13 -05:00
3.9 KiB
3.9 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; retin libSceRtc.sprx on firmware 13.60
Unknown function info
- sceRtcParseDateTime (libSceRtc) - the console's zone name table is only known from the names measured on PS5 firmware 13.60 and 13.42; any other name is assumed to take the military letter offset of its first character, as every measured name outside the table does (
HST,MSK,XYZ), so a 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, the same NUL-terminated text returned
BAD_PARSEwhen the byte after its terminator was zero and succeeded when that byte was uppercaseT. This dependence on storage after the terminator is not modeled; controlled backing-byte measurements on other firmware and title contexts are unavailable. - sceRtcFormatRFC2822, sceRtcFormatRFC2822LocalTime, sceRtcFormatRFC3339LocalTime (libSceRtc) - only shadPS4 (PS4) has bodies. A null tick returns
INVALID_POINTERlike the existingsceRtcFormatRFC3339, where shadPS4 formats the current time instead; offsets outside ±1439 minutes returnINVALID_VALUElikesceRtcFormatRFC3339; the local-time variants use the host's offset at the given instant (shadPS4 usessceKernelGettimezone, the current offset) - sceRtcGetDosTime, sceRtcSetDosTime (libSceRtc) - bit layout from shadPS4 (PS4, the standard FAT date/time). A year outside 1980-2107 makes
GetDosTimereturnINVALID_YEARafter writing 0 for an earlier one and0xff9fbf7d(2107-12-31 23:59:58, the largest encodable time) for a later one, andSetDosTimedecodes 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, sceRtcGetCurrentAdNetworkTick, sceRtcGetCurrentDebugNetworkTick (libSceRtc) - the console reads clocks 0x13, 0x12 and 0x11 (the ad and debug clocks fall back to the network clock 0x10) and returns the clock time plus the Unix epoch in ticks, or
0x80B50001when the clock is unsupported (errno 5). Those console clocks are not modelled; all three return the system clock likesceRtcGetCurrentNetworkTick. Read from the disassembly of libSceRtc.sprx on firmware 13.60, not measured on a console - sceRtcSetCurrentTick, sceRtcSetCurrentNetworkTick, sceRtcSetCurrentAdNetworkTick, sceRtcSetCurrentDebugNetworkTick (libSceRtc) - the console rejects a null pointer with
0x80B50002and a tick before the Unix epoch with0x80B50003, then sets the system clock (clock 0, 0x10, 0x12 or 0x11) from the tick. A valid tick throws: the host clock is not set. 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