Libraries: Np libraries cleanup (#3535)

* Np library cleanup

Moved all Np libraries to a Np folder, created files for Np error codes and structs shared between the libraries, removed empty auto-generated stubs from NpCommon and NpManager, and more things of that nature.

Also implemented sceNpGetAccountCountry, since we already had sceNpGetAccountCountryA anyway.

* Cleanup NpManager signed_out checks

The PR that introduced the PSN signed in status reverted some of the changes I'd previously made to improve accuracy.
Also they missed sceNpHasSignedUp, which just uses an internal variant of sceNpGetState for it's own check.

* Copyright dates

* Move signin check to NpManager RegisterLib

Hardcoding it the way I did caused it to read signin status before config was read.

* Fix RegisterLib names

Not sure why these weren't adjusted yet, so I've adjusted them myself.

* Fix NpCommon exports

* Basic parameter validation in sceNpDeleteRequest and sceNpCreateRequest

* More thorough request logic

Created an enum to capture the current state of each request, using a vector to store them.
I've made 3 states, none represents deleted requests, active represents requests that were made, but haven't been used yet, and complete represents used requests (a request cannot be used for multiple functions).

* Functions

sceNpCheckAvailability, sceNpCheckAvailabilityA, sceNpCheckNpReachability, sceNpGetAccountDateOfBirth, sceNpGetAccountDateOfBirthA added.

* sceNpGetAccountLanguage, sceNpGetAccountLanguageA

* sceNpGetGamePresenceStatus, sceNpGetGamePresenceStatusA

Also reduced debug logging for functions with early signed out returns, since those should behave identically to real hardware so long as you keep PSN emulation disabled.

* Fix sceNpGetAccountLanguage parameters

Oops

* sceNpGetNpReachabilityState

* sceNpGetParentalControlInfo, sceNpGetParentalControlInfoA

* Move OrbisNpState back to np_manager.h

Until this sees use elsewhere, this doesn't need to be with np-wide things.

* Clang
This commit is contained in:
Stephen Miller
2025-09-06 16:32:22 -05:00
committed by GitHub
parent 6f5036f8dc
commit 0e7e100a7e
36 changed files with 828 additions and 13381 deletions

View File

@@ -577,26 +577,25 @@ set(VDEC_LIB src/core/libraries/videodec/videodec2_impl.cpp
src/core/libraries/videodec/videodec_impl.h
)
set(NP_LIBS src/core/libraries/np_common/np_common.cpp
src/core/libraries/np_common/np_common.h
src/core/libraries/np_manager/np_manager.cpp
src/core/libraries/np_manager/np_manager.h
src/core/libraries/np_score/np_score.cpp
src/core/libraries/np_score/np_score.h
src/core/libraries/np_trophy/np_trophy.cpp
src/core/libraries/np_trophy/np_trophy.h
src/core/libraries/np_trophy/trophy_ui.cpp
src/core/libraries/np_trophy/trophy_ui.h
src/core/libraries/np_trophy/np_trophy_error.h
src/core/libraries/np_web_api/np_web_api.cpp
src/core/libraries/np_web_api/np_web_api.h
src/core/libraries/np_party/np_party.cpp
src/core/libraries/np_party/np_party.h
src/core/libraries/np_party/np_party_error.h
src/core/libraries/np_auth/np_auth.cpp
src/core/libraries/np_auth/np_auth.h
src/core/libraries/np_profiledialog/np_profiledialog.cpp
src/core/libraries/np_profiledialog/np_profiledialog.h
set(NP_LIBS src/core/libraries/np/np_error.h
src/core/libraries/np/np_common.cpp
src/core/libraries/np/np_common.h
src/core/libraries/np/np_manager.cpp
src/core/libraries/np/np_manager.h
src/core/libraries/np/np_score.cpp
src/core/libraries/np/np_score.h
src/core/libraries/np/np_trophy.cpp
src/core/libraries/np/np_trophy.h
src/core/libraries/np/trophy_ui.cpp
src/core/libraries/np/trophy_ui.h
src/core/libraries/np/np_web_api.cpp
src/core/libraries/np/np_web_api.h
src/core/libraries/np/np_party.cpp
src/core/libraries/np/np_party.h
src/core/libraries/np/np_auth.cpp
src/core/libraries/np/np_auth.h
src/core/libraries/np/np_profile_dialog.cpp
src/core/libraries/np/np_profile_dialog.h
)
set(ZLIB_LIB src/core/libraries/zlib/zlib.cpp