Commit Graph
189 Commits
Author SHA1 Message Date
Dean 23c7030f63 Merge pull request #11588 from camezaro-intc/feat/appcontent-systemservice-imports
feat(libs): export MW3 app content and system service imports
2026-11-03 21:08:54 +13:00
Dean cea4b30768 Merge pull request #13192 from kyon-eth/feat/system-service-320-exports
feat(libSceSystemService): declare 32 callable exports
2026-11-03 06:29:01 +13:00
Dean 46622fff7c Merge pull request #12752 from MarcZX10/feat/language-auto
feat(libSceSystemService): take the console language from the host with ANYPS5_LANGUAGE=auto
2026-11-03 02:39:32 +13:00
Dean Galvin aefbe42bcc Merge commit '88e804b0a7df1f1ac373a9e2f72fb378d925fdd4' into HEAD
# Conflicts:
#	core/libs/prx/libSceSystemService/PendingExports.cpp
2026-11-02 21:17:33 +13:00
Dean 8f5edf8757 Merge pull request #9586 from EagleBearerYS/feat/libscesystemservice-absent-features
feat(libSceSystemService): answer queries for streaming, VR, shell and device features AnyPS5 does not have
2026-11-02 20:57:58 +13:00
camezaro-intc 8b57112350 feat(libSceSystemService): export MW3 system service import 2026-11-01 03:48:18 -06:00
Dean f02ce8d292 Merge pull request #14195 from rooklz/refactor/systemservice-speculative-launch-rejection
refactor(libSceSystemService): throw the documented speculative-launch rejection
2026-11-01 18:48:26 +13:00
Dean bbe8cf31c1 Merge pull request #14188 from rooklz/refactor/systemservice-running-title-rejections
refactor(libSceSystemService): throw the documented running-title rejections
2026-11-01 18:47:35 +13:00
Dean 8bb1018913 Merge pull request #14180 from rooklz/refactor/systemservice-loadexec-rejection
refactor(libSceSystemService): throw the documented LoadExec and kill rejections
2026-11-01 16:31:54 +13:00
rooklz 87d192fadb refactor(libSceSystemService): throw the documented speculative-launch rejection 2026-10-31 23:51:29 +01:00
rooklz f440c992f5 refactor(libSceSystemService): throw the documented running-title rejections 2026-10-31 23:41:18 +01:00
rooklz 0b7c518e1a refactor(libSceSystemService): throw the documented LoadExec and kill rejections 2026-10-31 23:35:59 +01:00
rooklz bf3ef895d6 refactor(libSceSystemService): delegate the process lifecycle wrappers
Forward the suspend, resume, kill, exception and ready-for-suspend wrappers to their LncUtil exports, as the debt records. The targets keep their documented throws, so behaviour is unchanged.
2026-10-31 21:07:45 +01:00
Yunus Shaikh 2831b2367d refactor(libSceSystemService): use main's invalid-argument error names for null outputs
The branch defined SHELL_CORE_UTIL_ERROR_NULL_OUTPUT (0x80e30003) and
LNC_UTIL_ERROR_NULL_OUTPUT (0x80940005), while #10801 on main already
names the same values SHELL_CORE_UTIL_ERROR_INVALID_ARGUMENT and
LNC_UTIL_ERROR_INVALID_ARGUMENT. The two duplicates are gone and their
uses in the status exports and their tests take main's names. The
values, and so the behaviour, are unchanged.
2026-10-30 19:15:15 +00:00
Yunus Shaikhandjotitadev 2e5b93fd5f Merge main into feat/libscesystemservice-absent-features
main's #10706 requires each export to be declared once, in its
library's public header. GuestSystemServiceStatus.cpp now includes
prx/libSceSystemService/include/SystemService.hpp instead of declaring
25 of its exports in its own extern "C" lines, as jotitadev suggested
in review.

Co-authored-by: jotitadev <[email protected]>
2026-10-30 18:09:51 +00:00
BunnyFlandClaude Opus 5.5 126a40816f feat(libSceSystemService): answer the codec activation calls as firmware 13.42 does
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 15:18:59 +01:00
BunnyFlandClaude Opus 5.5 f87932d303 feat(libSceSystemService): implement sceSystemServiceGetPSButtonEvent
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 13:45:37 +01:00
BunnyFlandClaude Opus 5.5 5a161a06b1 feat(libSceSystemService): answer the codec activation calls as firmware 13.42 does
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 13:39:14 +01:00
Kyon 9775d2de54 build(libSceSystemService): avoid concurrent target edits 2026-10-30 05:56:26 +00:00
Kyon 5fe85e6690 build(libSceSystemService): isolate inventory target sources 2026-10-30 05:55:11 +00:00
Kyon 401b345a35 refactor(libSceSystemService): isolate added exports 2026-10-30 05:55:11 +00:00
Kyon dd72470587 feat(libSceSystemService): declare 32 callable exports 2026-10-30 05:55:11 +00:00
Adrià 84e114e4eb Merge pull request #12715 from MarcZX10/feat/log-to-file
feat(libc): copy the runtime log into a file with ANYPS5_LOG_FILE
2026-10-30 05:51:34 +01:00
MarcZX10 048ac7703d test(libSceSystemService): cover ANYPS5_LANGUAGE=auto through sceSystemServiceParamGetInt
Runs thirteen host environments (LANG, LC_MESSAGES and LC_ALL precedence,
LANGUAGE, C, nothing set, an unlisted language) and checks that parameters 1
and 400 and SystemServiceConsoleLanguage answer the expected console language,
that the answer does not change when the host locale changes afterwards, that
integers, the empty value and an unset variable still behave as before after
auto, that exactly the expected number of notices is printed, and that near
misses of auto and invalid values are refused with an error that names the
variable and lists auto. Registered on Linux, where the environment is the
locale source.
2026-10-29 08:51:17 +00:00
MarcZX10 d01ee0435f feat(libSceSystemService): name auto in the invalid ANYPS5_LANGUAGE error
A value that is neither a console language number from 0 to 30 nor auto still
stops the game at its first language query with an error that names the
variable, which now lists auto as the other accepted value.
2026-10-29 08:51:17 +00:00
MarcZX10 0706e41394 feat(libSceSystemService): take the console language from the host with ANYPS5_LANGUAGE=auto
auto, in any letter case, resolves the host locale once per process and answers
that console language for every later query of parameters 1 and 400 and for
every other consumer of SystemServiceConsoleLanguage (the trophy texts, and the
keyboard type the user service derives from parameter 1). An unset or empty
variable and every integer behave as before and are read at each query; any
other text is still refused.
2026-10-29 08:51:17 +00:00
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
MarcZX10 202fcb3792 fix(libSceSystemService): hand the real standard streams to a host executable that replaces the process
sceSystemServiceLoadExec of a host executable ends this process after it
starts the target, so with ANYPS5_LOG_FILE set the target would inherit
the pipes of the log copy with no reader left. Call LogFileRelease before
the launch (after the existing restore of the kept standard error on
POSIX) so the target inherits the original streams.
2026-10-29 05:57:24 +01:00
MarcZX10 b22252c9bb fix(libSceSystemService): hand the real standard streams to a converted executable that replaces the process
LoadExec replaces the running process with the target executable on
Windows, Linux and macOS. With ANYPS5_LOG_FILE set the standard output and
error are the pipes the log copy reads, and its threads end with this
process, so the new executable would write into pipes nobody reads and a
POSIX one would be killed by SIGPIPE. Before the replacement starts, call
LogFileRelease, which empties the pipes into the file and puts the
original streams back on descriptors 1 and 2 (the standard handles on
Windows) when they still are the pipes. The new executable starts its own
copy from the inherited variable and appends to the same file.
2026-10-29 05:57:24 +01:00
dantdmdarealguy c5a69e8e46 fix(build): skip the core/libs relinker CLI tests when ANYPS5_RELINKER_CLI is OFF
With -DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=OFF the generate step
failed: exec_arguments, loadexec_arguments, guest_timed_join_import_*,
guest_runtime_lifecycle and agc_driver_guest_memory_lifetime_converted
name the relinker target, which core/relinker defines only when the
option is on. The option is now declared in the root CMakeLists.txt,
before core/libs, and those tests are registered only with the command
line, as core/relinker already does for its own command line tests.
2026-10-28 11:05:02 -05:00
MarcZX10 eb385ab2da feat(libSceSystemService): track the suspend confirmation dialog flag
sceSystemServiceEnableSuspendConfirmationDialog and
sceSystemServiceDisableSuspendConfirmationDialog set an atomic flag
that sceShellCoreUtilGetSuspendConfirmationDialogFlag reads back for
the running title. The flag starts enabled. Another app ID still
throws NotImplemented_nid_no_patch because the console's answer is
unknown. AnyPS5 has no shell to suspend the title and show the
dialog, so the debt document lists the flag under Silent stubs.
2026-10-28 13:06:21 +00:00
MarcZX10 1755907bdb feat(libSceSystemService): keep the GPU load emulation mode
sceSystemServiceSetGpuLoadEmulationMode and
sceSystemServiceGetGpuLoadEmulationMode, with the sceShellCoreUtil
Set/Get pair and their ByAppId variants, now share one atomic mode
instead of throwing. Modes 0 (off) and 1 (normal) are accepted; the
getter returns the mode itself rather than a result code. The initial
mode is 1. Any other mode, and any app ID other than the running
title, still throws NotImplemented_nid_no_patch because the console's
errors for them are unknown. The host GPU is not throttled, which the
debt document lists under Silent stubs.
2026-10-28 13:06:21 +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