Commit Graph
151 Commits
Author SHA1 Message Date
MarcZX10 59d0159e3b feat(libSceSystemService): resolve the host language from an injectable locale source
ResolveHostLanguage takes the host locales in order of preference from a source
and the console language of the first one that is recognised. When none is
(or the source returns none), it reports one notice line that names the
detected locale and the English (United States) fallback and returns it, so
auto never fails. Source and notice are injectable so tests do not depend on
the host.
2026-10-29 08:51:17 +00:00
MarcZX10 0b45532833 build(libSceSystemService): link CoreFoundation where the macOS host locale source is used
The macOS locale source calls CFLocaleCopyPreferredLanguages. The header is
inline, so every target that resolves the language needs the framework: an
interface target carries it on macOS and nothing elsewhere, and the system
service library, the trophy library and the locale test link it.
2026-10-29 08:51:17 +00:00
MarcZX10 0c4be5ba0e feat(libSceSystemService): choose the host locale source of the platform
HostLocales calls the Windows source on Windows, the macOS source on macOS and
the POSIX environment source elsewhere.
2026-10-29 08:51:17 +00:00
MarcZX10 ab43fe1e8c feat(libSceSystemService): read the host locales of a macOS system
MacHostLocales returns the user's preferred languages in order from
CFLocaleCopyPreferredLanguages, BCP-47 tags such as en-US, zh-Hans-CN or
pt-BR, which the process environment of a macOS desktop session does not
carry. Only built on macOS.
2026-10-29 08:51:17 +00:00
MarcZX10 403ca71698 feat(libSceSystemService): read the host locale of a Windows system
WindowsHostLocales returns the user default locale name from
GetUserDefaultLocaleName, a BCP-47 tag such as en-US, zh-Hans-CN or pt-BR. It
reads the regional-format locale of the user, not the list of preferred
display languages, because that is one documented call with a fixed buffer.
A name with a non-ASCII character is treated as no locale. Only built on
Windows.
2026-10-29 08:51:17 +00:00
MarcZX10 c3fa50327c feat(libSceSystemService): read the host locales of a POSIX system
PosixHostLocales takes an injectable environment reader and returns the locales
in order of preference: LC_ALL, then LC_MESSAGES, then LANG, the first one that
is set and not empty, as the C library chooses the locale of the messages
category. When that locale is a real one (not C, POSIX or unset) the entries of
LANGUAGE, the GNU preference list, come before it, as gettext ignores LANGUAGE
under the C locale.
2026-10-29 08:51:17 +00:00
MarcZX10 26f2879f05 feat(libSceSystemService): fall back to English (United States) for a locale with no console language
MatchLocale returns the console language of a locale and whether the locale was
recognised. An empty, C, POSIX, malformed or unlisted locale is not
recognised and gives English (United States), the language the console answers
when ANYPS5_LANGUAGE is unset, so resolving a host locale cannot fail. A
recognised language with no row for its region already takes the language's
main row.
2026-10-29 08:51:17 +00:00
MarcZX10 7538dd65df feat(libSceSystemService): map Arabic, Thai, Vietnamese, Indonesian, Turkish, Greek and Hungarian locales
Each has a single console language, so every region maps to it. The legacy
code in for Indonesian, still used by some POSIX and Java hosts, is accepted
as well as id.
2026-10-29 08:51:17 +00:00
MarcZX10 e439a2afe1 feat(libSceSystemService): map Slavic and Nordic locales
Russian, Ukrainian, Polish, Czech, Finnish, Swedish and Danish map to their
console language. Norwegian is the console's one Norwegian language, so no,
nb (Bokmal) and nn (Nynorsk) all map to it. Lithuanian, Latvian, Estonian and
the other Slavic languages the console has no entry for stay unrecognised.
2026-10-29 08:51:17 +00:00
MarcZX10 6db6ef40d4 feat(libSceSystemService): map Japanese and Korean locales
Japanese and Korean each have one console language, so every region of ja and
ko maps to it.
2026-10-29 08:51:17 +00:00
MarcZX10 b9f716124d feat(libSceSystemService): map Chinese locales to Traditional or Simplified
A script decides first (zh-Hant is Traditional, zh-Hans Simplified, also
against a contradicting region such as zh-Hans-TW), then the region (TW, HK and
MO are Traditional), and a bare zh is Simplified. Mandarin (cmn) follows the
same rules and Cantonese (yue) is Traditional unless it names Hans.
2026-10-29 08:51:16 +00:00
MarcZX10 348ac5df09 feat(libSceSystemService): map Spanish and Portuguese locales to their regional console languages
The console has Spanish (Spain) and Spanish (Latin America), and Portuguese
(Portugal) and Portuguese (Brazil). A bare es is Spain, and the Latin American
countries, the es-419 region and es-US are Latin America. A bare pt is Brazil,
the language's larger variant, and Portugal and the African and Asian
territories that follow the European standard (AO, MZ, CV, GW, ST, TL, MO) are
Portugal.
2026-10-29 08:51:16 +00:00
MarcZX10 48e165218d feat(libSceSystemService): look up the console language of a locale in a row table
ConsoleLanguageForTag picks, among the rows of the tag's language whose script
and region are empty or equal to the tag's, the one that names the most
(script outranks region), so a regional row wins over the language's main row
and a language with no row for the tag's region falls back to its main row.
The first group of rows covers the Latin-script European languages that have
no regional split but a few: English (United Kingdom for GB, IE, AU and NZ,
English (United States) otherwise), French and French (Canada), German,
Italian, Dutch and Romanian.
2026-10-29 08:51:16 +00:00
MarcZX10 f2fbb65aaa feat(libSceSystemService): parse a locale given as a BCP-47 tag or a POSIX name
ParseLocale normalises the text as a POSIX name first, which leaves a BCP-47
tag unchanged except for underscores, and then parses the result, so the
caller handles en-US and en_US.UTF-8 alike. C, POSIX and an empty text report
no locale and leave the output tag as it was.
2026-10-29 08:51:16 +00:00
MarcZX10 4d814c6a8c feat(libSceSystemService): normalise POSIX locale names to BCP-47 form
POSIX hosts name their locale language[_territory][.codeset][@modifier], such
as en_GB.UTF-8@euro, and use C and POSIX for no locale at all. NormalizePosixLocale
drops the codeset and the modifier, turns underscores into hyphens, maps the
@latin and @cyrillic modifiers to the Latn and Cyrl scripts where the name has
no script, and returns an empty string for C, POSIX and an empty name so the
caller sees "no locale" instead of a language called C.
2026-10-29 08:51:16 +00:00
MarcZX10 238bf96bcc test(libSceSystemService): cover the BCP-47 locale tag parser
Adds a host-only test, system_service_language_locale, for ParseTag: case
normalisation of the language, script and region subtags, the three-digit
region of es-419, variants and extensions that are ignored, and the inputs it
must reject (empty and oversized subtags, one-letter and long languages, the
POSIX underscore and codeset forms) without touching the output tag.
2026-10-29 08:51:16 +00:00
MarcZX10 30b912fea4 feat(libSceSystemService): parse BCP-47 locale tags
ANYPS5_LANGUAGE can only name a console language number. Taking the language
from the host needs the host's locale, which arrives as a BCP-47 tag such as
en-US, pt-BR or zh-Hant-TW. ParseTag reads the language, script and region
subtags, normalises their case, ignores variants and extensions, and rejects
empty subtags, subtags over 8 characters and languages that are not 2 or 3
letters.
2026-10-29 08:51:16 +00:00
simnJS b419a4a808 feat(libSceSystemService): call libSceUsbStorage from the USB storage aliases
The sceSystemServiceUsbStorage* exports jump straight into the USB storage
module, so call the matching libSceUsbStorage export instead of throwing.
RequestMapWSB keeps its marker while its two declarations disagree on the
fourth argument and the output type.
2026-10-27 14:18:59 +01:00
Yunus Shaikh 1928c54b4f fix(libSceSystemService): return firmware 13.42's results for the arguments it checks before a request
BunnyFl ran firmware 13.42's libSceSystemService.sprx in an emulator and
recorded the checks these calls make before they pass a request on. A
null title ID or one whose length isn't 9 makes sceSystemServiceGetAppId
and sceLncUtilGetAppId return -1 and sceLncUtilIsAppLaunched return
0x80940005. A null output, list, count or user returns 0x80940005 from
the LncUtil and SystemService calls and 0x80e30003 from
sceShellCoreUtilGetUserFocus, before the app ID is looked at, and a null
sceLncUtilLoadExec path returns 0x80940005.

What the module passes on as a request still throws: another
9-character title ID, another app ID, a list capacity of 0 and an empty
sceLncUtilLoadExec path.
2026-10-25 14:15:27 -07:00
Yunus Shaikh 7a4b965d6f feat(libSceSystemService): forward sceLncUtilLoadExec to sceSystemServiceLoadExec
sceLncUtilLoadExec takes the same path and null-terminated argument
list, which the SystemService call passes on to it on the console. It
returns sceSystemServiceLoadExec's result: the same parameter errors,
the same refusals for paths it cannot start, and "exit" ends the title
in the same way.
2026-10-25 00:15:25 +00:00
Yunus Shaikh c2eb0a2404 feat(libSceSystemService): report the running title as not suspended
sceLncUtilIsAppSuspended, sceSystemServiceIsAppSuspended and
sceLncUtilIsSpeculativeLaunch write false for the running title's app
ID. The title that calls them is running and has no shell to suspend
it. It was started from the host rather than by sceLncUtilLaunchApp,
so no LncLaunchParam asked for a speculative launch. Another app ID
and a null output still throw.
2026-10-25 00:15:25 +00:00
Yunus Shaikh f5afb8755c feat(libSceSystemService): report the running title's user
sceLncUtilGetAppLaunchedUser, sceSystemServiceGetAppLaunchedUser and
sceShellCoreUtilGetUserFocus write the initial user for the running
title's app ID. That is the user sceUserServiceGetInitialUser and
sceUserServiceGetForegroundUser report. Another app ID and a null user
pointer still throw.
2026-10-25 00:15:25 +00:00
Yunus Shaikh 695041093b feat(libSceSystemService): answer the running title's app ID lookups
sceLncUtilGetAppId and sceLncUtilIsAppLaunched accept the running
title's ID as sceSystemServiceGetAppId does, and
sceLncUtilGetAppIdOfRunningBigApp returns what
sceSystemServiceGetAppIdOfRunningBigApp returns. Both big-app lists
write the running title's app ID as their only entry, because AnyPS5
runs one title. Another title ID, a null pointer and a list capacity of
0 still throw.
2026-10-25 00:15:25 +00:00
boykopovar fdf9ca7574 fix(sdk): reconcile public headers after rebase 2026-10-24 23:17:47 +03:00
boykopovar 35cf8d56cd refactor(sdk): add canonical headers for core libraries 2026-10-24 23:17:37 +03:00
Adrià a5f13b3fd4 Merge pull request #8354 from MarrasFederico/feat/system-service-app-title-id
feat(libSceSystemService): convert between the running title's app id and title id
2026-10-24 13:53:37 +02:00
frankea 56dfc1327e fix(libSceSystemService): answer the registry-backed integer parameters with values measured on a PS5 2026-10-23 04:36:58 -04:00
Dean e14bb6f532 Merge pull request #8957 from dantdmdarealguy/test/loadexec-tracy-client
test(libSceSystemService): stage the Tracy client with the loadexec_arguments libraries
2026-10-23 14:00:20 +13:00
Dean 6a6a35fdf5 Merge pull request #7965 from frankea/ps5-measured-1340
fix(libs): values measured on a PS5 (firmware 13.40) from inside retail games
2026-10-23 06:18:10 +13:00
Federico Marras 06f25300f9 Merge commit '3ca07d086d5f44fbe3c00370e7f03953ab46ca1b' into feat/system-service-app-title-id 2026-10-22 15:43:43 +02:00
Yossi Yadgar 13d3ef8080 feat(libSceSystemService): report no background music in sceShellCoreUtilIsBgmPlaying 2026-10-22 08:25:30 +03:00
Yossi Yadgar a946073ce1 feat(libSceSystemService): report no background music in sceSystemServiceIsBgmPlaying 2026-10-22 08:25:24 +03:00
Federico Marras e0e231ef3f Merge remote-tracking branch 'upstream/main' into feat/system-service-app-title-id
# Conflicts:
#	core/libs/prx/libSceSystemService/PendingExports.cpp
#	docs/dev/debt/libSceSystemService.md
2026-10-22 07:08:48 +02:00
frankea 41d551eb60 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into ps5-measured-1340
# Conflicts:
#	core/libs/prx/libSceSystemService/Export.cpp
2026-10-21 17:37:31 -04:00
boykopovar b35e344585 fix(systemservice): restore browser launch signature and validation 2026-10-21 21:54:54 +03:00
boykopovar 991efec086 fix(systemservice): restore tournament and daemon argument slots 2026-10-21 21:53:08 +03:00
boykopovar b167045830 fix(systemservice): recover activation handles and device argument types 2026-10-21 21:49:56 +03:00
boykopovar 50c8103af2 fix(systemservice): recover launch and process status structures 2026-10-21 21:49:56 +03:00
boykopovar 67ff7609c2 fix(systemservice): define application message payload layout 2026-10-21 21:49:55 +03:00
boykopovar 1db52e3e40 fix(systemservice): reject unsupported integer parameters 2026-10-21 21:49:54 +03:00
boykopovar 9e94b0cb71 fix(systemservice): define launch and microphone status layouts 2026-10-21 21:49:54 +03:00
boykopovar a8cb8345cd fix(systemservice): validate system name buffers and termination 2026-10-21 21:49:53 +03:00
boykopovar 28fdabd59c fix(systemservice): restore float progress returns and clock arguments 2026-10-21 21:49:53 +03:00
boykopovar 9b8c8e51d5 fix(usbstorage): restore mapping callbacks and system service aliases 2026-10-21 21:49:52 +03:00
boykopovar 4e9520a9db fix(systemservice): restore state manager and modal arguments 2026-10-21 21:49:52 +03:00
boykopovar 32b7c50240 fix(systemservice): restore process control and telemetry arguments 2026-10-21 21:49:51 +03:00
boykopovar d4f2911b74 fix(systemservice): restore collapsed launcher dispatch arguments 2026-10-21 21:49:51 +03:00
boykopovar c9c8675b1d fix(systemservice): restore assembly alias signatures 2026-10-21 21:49:50 +03:00
boykopovar 46e9270dc4 fix(systemservice): restore public query payload signatures 2026-10-21 21:49:50 +03:00
boykopovar 2386ab8e84 fix(systemservice): restore activation handles and process signatures 2026-10-21 21:49:49 +03:00