Merge branch 'main' into reset-controller-colour-on-exit

This commit is contained in:
georgemoralis 2026-06-08 00:13:12 +03:00 committed by GitHub
commit 80fb01dd59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 3447 additions and 192 deletions

View File

@ -5,6 +5,7 @@ name: Build and Release
on:
push:
branches-ignore: [Pre-release-shadPS4-*]
paths-ignore:
- "documents/**"
- "**/*.md"

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,12 @@ enum OrbisHttpMethod : s32 {
ORBIS_HTTP_METHOD_CUSTOM = 8,
};
// mode argument for sceHttpAddRequestHeader.
enum OrbisHttpHeaderModes : s32 {
ORBIS_HTTP_HEADER_OVERWRITE = 0,
ORBIS_HTTP_HEADER_ADD = 1,
};
enum OrbisUriBuild : s32 {
ORBIS_HTTP_URI_BUILD_WITH_SCHEME = 0x01,
ORBIS_HTTP_URI_BUILD_WITH_HOSTNAME = 0x02,
@ -141,7 +147,6 @@ using OrbisHttpsCaList = Libraries::Ssl::OrbisSslCaList;
int PS4_SYSV_ABI sceHttpAddCookie(int libhttpCtxId, const char* url, const char* cookie,
u64 cookieLength);
int PS4_SYSV_ABI sceHttpAddQuery();
int PS4_SYSV_ABI sceHttpAddRequestHeader(int id, const char* name, const char* value, s32 mode);
int PS4_SYSV_ABI sceHttpAddRequestHeaderRaw();
int PS4_SYSV_ABI sceHttpAuthCacheExport();
int PS4_SYSV_ABI sceHttpAuthCacheFlush(int libhttpCtxId);
@ -167,7 +172,6 @@ int PS4_SYSV_ABI sceHttpDbgShowConnectionStat();
int PS4_SYSV_ABI sceHttpDbgShowMemoryPoolStat();
int PS4_SYSV_ABI sceHttpDbgShowRequestStat();
int PS4_SYSV_ABI sceHttpDbgShowStat();
int PS4_SYSV_ABI sceHttpGetAcceptEncodingGZIPEnabled(int id, int* isEnable);
int PS4_SYSV_ABI sceHttpGetAuthEnabled(int id, int* isEnable);
int PS4_SYSV_ABI sceHttpGetConnectionStat();
int PS4_SYSV_ABI sceHttpGetCookie(int libhttpCtxId, const char* url, char* cookie, u64* required,
@ -179,10 +183,8 @@ int PS4_SYSV_ABI sceHttpGetMemoryPoolStats(int libhttpCtxId, OrbisHttpMemoryPool
int PS4_SYSV_ABI sceHttpGetRegisteredCtxIds();
int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, u64 poolSize);
int PS4_SYSV_ABI sceHttpRedirectCacheFlush(int libhttpCtxId);
int PS4_SYSV_ABI sceHttpRemoveRequestHeader(int id, const char* name);
int PS4_SYSV_ABI sceHttpRequestGetAllHeaders();
int PS4_SYSV_ABI sceHttpSendRequest(int reqId, const void* postData, u64 size);
int PS4_SYSV_ABI sceHttpSetAcceptEncodingGZIPEnabled(int id, int isEnable);
int PS4_SYSV_ABI sceHttpSetAuthEnabled(int id, int isEnable);
int PS4_SYSV_ABI sceHttpSetAuthInfoCallback(int id, OrbisHttpAuthInfoCallback cbfunc,
void* userArg);
@ -203,15 +205,10 @@ int PS4_SYSV_ABI sceHttpSetEpollId();
int PS4_SYSV_ABI sceHttpSetHttp09Enabled(int id, int isEnable);
int PS4_SYSV_ABI sceHttpSetPolicyOption();
int PS4_SYSV_ABI sceHttpSetPriorityOption();
int PS4_SYSV_ABI sceHttpSetProxy();
int PS4_SYSV_ABI sceHttpSetRecvBlockSize(int id, u32 blockSize);
int PS4_SYSV_ABI sceHttpSetRedirectCallback(int id, OrbisHttpRedirectCallback cbfunc,
void* userArg);
int PS4_SYSV_ABI sceHttpSetRequestStatusCallback(int id, OrbisHttpRequestStatusCallback cbfunc,
void* userArg);
int PS4_SYSV_ABI sceHttpSetResolveRetry(int id, int retry);
int PS4_SYSV_ABI sceHttpSetResolveTimeOut(int id, u32 usec);
int PS4_SYSV_ABI sceHttpSetResponseHeaderMaxSize(int id, u64 headerSize);
int PS4_SYSV_ABI sceHttpSetSocketCreationCallback();
int PS4_SYSV_ABI sceHttpsFreeCaList(int libhttpCtxId, OrbisHttpsCaList* caList);
int PS4_SYSV_ABI sceHttpsGetCaList(int httpCtxId, OrbisHttpsCaList* list);
@ -222,11 +219,23 @@ int PS4_SYSV_ABI sceHttpsSetMinSslVersion(int id, int version);
int PS4_SYSV_ABI sceHttpsSetSslCallback(int id, OrbisHttpsCallback cbfunc, void* userArg);
int PS4_SYSV_ABI sceHttpsSetSslVersion(int id, int version);
int PS4_SYSV_ABI sceHttpsUnloadCert(int libhttpCtxId);
int PS4_SYSV_ABI sceHttpTerm(int libhttpCtxId);
int PS4_SYSV_ABI sceHttpWaitRequest(OrbisHttpEpollHandle eh, OrbisHttpNBEvent* nbev, int maxevents,
int timeout);
int PS4_SYSV_ABI sceHttpUriCopy();
//***********************************
// Init/Terminate functions
//***********************************
int PS4_SYSV_ABI sceHttpTerm(int libhttpCtxId);
//***********************************
// Misc functions
//***********************************
int PS4_SYSV_ABI sceHttpSetRecvBlockSize(int id, u32 blockSize);
int PS4_SYSV_ABI sceHttpSetProxy(int id, int httpProxyConf, int wlanProxyConf, const char* host,
u16 port);
int PS4_SYSV_ABI sceHttpGetAcceptEncodingGZIPEnabled(int id, int* isEnable);
int PS4_SYSV_ABI sceHttpSetDefaultAcceptEncodingGZIPEnabled(int libhttpCtxId, int isEnable);
int PS4_SYSV_ABI sceHttpSetAcceptEncodingGZIPEnabled(int id, int isEnable);
//***********************************
// Non-blocking processing functions
//***********************************
int PS4_SYSV_ABI sceHttpCreateEpoll(int libhttpCtxId, OrbisHttpEpollHandle* eh);
@ -254,6 +263,8 @@ int PS4_SYSV_ABI sceHttpsEnableOptionPrivate(int id, u32 sslFlags);
//***********************************
// Response Information functions
//***********************************
int PS4_SYSV_ABI sceHttpSetResolveTimeOut(int id, u32 usec);
int PS4_SYSV_ABI sceHttpSetResponseHeaderMaxSize(int id, u64 headerSize);
int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(int reqId, char** header, u64* headerSize);
int PS4_SYSV_ABI sceHttpGetResponseContentLength(int reqId, int* result, u64* contentLength);
int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode);
@ -261,6 +272,8 @@ int PS4_SYSV_ABI sceHttpSetInflateGZIPEnabled(int id, int isEnable);
//***********************************
// Http Header setting functions
//***********************************
int PS4_SYSV_ABI sceHttpAddRequestHeader(int id, const char* name, const char* value, s32 mode);
int PS4_SYSV_ABI sceHttpRemoveRequestHeader(int id, const char* name);
int PS4_SYSV_ABI sceHttpSetRequestContentLength(int id, u64 contentLength);
//***********************************
// Redirection setting functions
@ -270,6 +283,7 @@ int PS4_SYSV_ABI sceHttpSetAutoRedirect(int id, int isEnable);
//***********************************
// Timeout settting functions
//***********************************
int PS4_SYSV_ABI sceHttpSetResolveRetry(int id, int retry);
int PS4_SYSV_ABI sceHttpSetConnectTimeOut(int id, u32 usec);
int PS4_SYSV_ABI sceHttpSetSendTimeOut(int id, u32 usec);
int PS4_SYSV_ABI sceHttpSetRecvTimeOut(int id, u32 usec);

View File

@ -5,7 +5,7 @@
#include "core/libraries/error_codes.h"
// Base NP errors (0x80550001 0x8055001F)
// Base NP errors (0x80550001 - 0x8055001F)
constexpr int ORBIS_NP_ERROR_ALREADY_INITIALIZED = 0x80550001;
constexpr int ORBIS_NP_ERROR_NOT_INITIALIZED = 0x80550002;
constexpr int ORBIS_NP_ERROR_INVALID_ARGUMENT = 0x80550003;
@ -38,7 +38,7 @@ constexpr int ORBIS_NP_ERROR_CALLBACK_MAX = 0x8055001D;
constexpr int ORBIS_NP_ERROR_INVALID_NP_TITLE_ID = 0x8055001E;
constexpr int ORBIS_NP_ERROR_ONLINE_ID_CHANGED = 0x8055001F;
// NP Util (0x80550601 0x8055060e)
// NP Util (0x80550601 - 0x8055060e)
constexpr int ORBIS_NP_UTIL_ERROR_INVALID_ARGUMENT = 0x80550601;
constexpr int ORBIS_NP_UTIL_ERROR_INSUFFICIENT = 0x80550602;
constexpr int ORBIS_NP_UTIL_ERROR_PARSER_FAILED = 0x80550603;
@ -50,7 +50,7 @@ constexpr int ORBIS_NP_UTIL_ERROR_NOT_MATCH = 0x80550609;
constexpr int ORBIS_NP_UTIL_ERROR_INVALID_TITLEID = 0x8055060A;
constexpr int ORBIS_NP_UTIL_ERROR_UNKNOWN = 0x8055060E;
// NP Auth errors (0x80550300 0x8055040F)
// NP Auth errors (0x80550300 - 0x8055040F)
constexpr int ORBIS_NP_AUTH_ERROR_INVALID_ARGUMENT = 0x80550301;
constexpr int ORBIS_NP_AUTH_ERROR_INVALID_SIZE = 0x80550302;
constexpr int ORBIS_NP_AUTH_ERROR_OUT_OF_MEMORY = 0x80550303;
@ -94,7 +94,7 @@ constexpr int ORBIS_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT16 = 0x8055044F;
constexpr int ORBIS_NP_AUTH_ERROR_SUB_ACCOUNT_RENEW_EULA = 0x8055044F;
constexpr int ORBIS_NP_AUTH_ERROR_UNKNOWN = 0x80550480;
// NP Community / Score client errors (0x80550700 0x8055071D)
// NP Community / Score client errors (0x80550700 - 0x8055071D)
constexpr int ORBIS_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED = 0x80550701;
constexpr int ORBIS_NP_COMMUNITY_ERROR_NOT_INITIALIZED = 0x80550702;
constexpr int ORBIS_NP_COMMUNITY_ERROR_OUT_OF_MEMORY = 0x80550703;
@ -125,7 +125,7 @@ constexpr int ORBIS_NP_COMMUNITY_ERROR_GHOST_SERVER_RETURN_INVALID_STATUS_CODE =
constexpr int ORBIS_NP_COMMUNITY_ERROR_UBS_ONLINE_ID_IN_XML_CREATED_PAST_IS_DIFFERENT_FROM_CURRENT =
0x8055071D;
// NP Community / Score server errors (0x80550800 0x805508AB)
// NP Community / Score server errors (0x80550800 - 0x805508AB)
constexpr int ORBIS_NP_COMMUNITY_SERVER_ERROR_BAD_REQUEST = 0x80550801;
constexpr int ORBIS_NP_COMMUNITY_SERVER_ERROR_INVALID_TICKET = 0x80550802;
constexpr int ORBIS_NP_COMMUNITY_SERVER_ERROR_INVALID_SIGNATURE = 0x80550803;
@ -205,7 +205,7 @@ constexpr int ORBIS_NP_COMMUNITY_SERVER_ERROR_UBS_MAINTENANCE = 0x805508B2;
constexpr int ORBIS_NP_COMMUNITY_SERVER_ERROR_BASIC_BLACKLISTED_USER_ID = 0x805508B3;
constexpr int ORBIS_NP_COMMUNITY_SERVER_ERROR_UNSPECIFIED = 0x805508FF;
// NP Matching2 (0x80550c01 0x80550d33)
// NP Matching2 (0x80550c01 - 0x80550d33)
constexpr int ORBIS_NP_MATCHING2_ERROR_OUT_OF_MEMORY = 0x80550C01;
constexpr int ORBIS_NP_MATCHING2_ERROR_ALREADY_INITIALIZED = 0x80550C02;
constexpr int ORBIS_NP_MATCHING2_ERROR_NOT_INITIALIZED = 0x80550C03;
@ -307,7 +307,7 @@ constexpr int ORBIS_NP_MATCHING2_SERVER_ERROR_NAT_TYPE_MISMATCH = 0x80550D31;
constexpr int ORBIS_NP_MATCHING2_SERVER_ERROR_ROOM_INCONSISTENCY = 0x80550D32;
constexpr int ORBIS_NP_MATCHING2_SERVER_ERROR_BLOCKED_USER_IN_ROOM = 0x80550D33;
// NP Matching2 Signaling (0x80550e01 0x80550e1a)
// NP Matching2 Signaling (0x80550e01 - 0x80550e1a)
constexpr int ORBIS_NP_MATCHING2_SIGNALING_ERROR_NOT_INITIALIZED = 0x80550E01;
constexpr int ORBIS_NP_MATCHING2_SIGNALING_ERROR_ALREADY_INITIALIZED = 0x80550E02;
constexpr int ORBIS_NP_MATCHING2_SIGNALING_ERROR_OUT_OF_MEMORY = 0x80550E03;
@ -335,7 +335,7 @@ constexpr int ORBIS_NP_MATCHING2_SIGNALING_ERROR_TERMINATED_BY_MYSELF = 0x80550E
constexpr int ORBIS_NP_MATCHING2_SIGNALING_ERROR_MATCHING2_PEER_NOT_FOUND = 0x80550E19;
constexpr int ORBIS_NP_MATCHING2_SIGNALING_ERROR_OWN_PEER_ADDRESS = 0x80550E1A;
// NP Trophy (0x80551600 0x805516c2)
// NP Trophy (0x80551600 - 0x805516c2)
constexpr int ORBIS_NP_TROPHY_ERROR_UNKNOWN = 0x80551600;
constexpr int ORBIS_NP_TROPHY_ERROR_NOT_INITIALIZED = 0x80551601;
constexpr int ORBIS_NP_TROPHY_ERROR_ALREADY_INITIALIZED = 0x80551602;
@ -385,7 +385,7 @@ constexpr int ORBIS_NP_TROPHY_ERROR_SCREENSHOT_DISPLAY_BUFFER_TOO_BIG = 0x805516
constexpr int ORBIS_NP_TROPHY_ERROR_SCREENSHOT_DISPLAY_BUFFER_RETRY_COUNT_MAX = 0x80551630;
constexpr int ORBIS_NP_TROPHY_ERROR_TITLE_NOT_FOUND = 0x805516C2;
// NP Bandwidth Test (0x80551f02 0x80551f09)
// NP Bandwidth Test (0x80551f02 - 0x80551f09)
constexpr int ORBIS_NP_BANDWIDTH_TEST_ERROR_NOT_INITIALIZED = 0x80551F02;
constexpr int ORBIS_NP_BANDWIDTH_TEST_ERROR_BAD_RESPONSE = 0x80551F03;
constexpr int ORBIS_NP_BANDWIDTH_TEST_ERROR_OUT_OF_MEMORY = 0x80551F04;
@ -395,7 +395,7 @@ constexpr int ORBIS_NP_BANDWIDTH_TEST_ERROR_CONTEXT_NOT_AVAILABLE = 0x80551F07;
constexpr int ORBIS_NP_BANDWIDTH_TEST_ERROR_ABORTED = 0x80551F08;
constexpr int ORBIS_NP_BANDWIDTH_TEST_ERROR_TIMEOUT = 0x80551F09;
// NP Party (0x80552501 0x80552516)
// NP Party (0x80552501 - 0x80552516)
constexpr int ORBIS_NP_PARTY_ERROR_UNKNOWN = 0x80552501;
constexpr int ORBIS_NP_PARTY_ERROR_ALREADY_INITIALIZED = 0x80552502;
constexpr int ORBIS_NP_PARTY_ERROR_NOT_INITIALIZED = 0x80552503;
@ -413,7 +413,7 @@ constexpr int ORBIS_NP_PARTY_ERROR_GAME_SESSION_NOT_ENABLED = 0x80552514;
constexpr int ORBIS_NP_PARTY_ERROR_INVALID_PARTY_NO_FRIENDS = 0x80552515;
constexpr int ORBIS_NP_PARTY_ERROR_INVALID_PARTY_IS_GAME_SESSION = 0x80552516;
// NP Signaling (0x80552701 0x8055271b)
// NP Signaling (0x80552701 - 0x8055271b)
constexpr int ORBIS_NP_SIGNALING_ERROR_NOT_INITIALIZED = 0x80552701;
constexpr int ORBIS_NP_SIGNALING_ERROR_ALREADY_INITIALIZED = 0x80552702;
constexpr int ORBIS_NP_SIGNALING_ERROR_OUT_OF_MEMORY = 0x80552703;
@ -442,7 +442,7 @@ constexpr int ORBIS_NP_SIGNALING_ERROR_PROHIBITED_TO_USE = 0x80552719;
constexpr int ORBIS_NP_SIGNALING_ERROR_EXCEED_RATE_LIMIT = 0x8055271A;
constexpr int ORBIS_NP_SIGNALING_ERROR_OWN_PEER_ADDRESS = 0x8055271B;
// NP WebAPI (0x80552901 0x8055291f)
// NP WebAPI (0x80552901 - 0x8055291f)
constexpr int ORBIS_NP_WEBAPI_ERROR_OUT_OF_MEMORY = 0x80552901;
constexpr int ORBIS_NP_WEBAPI_ERROR_INVALID_ARGUMENT = 0x80552902;
constexpr int ORBIS_NP_WEBAPI_ERROR_INVALID_LIB_CONTEXT_ID = 0x80552903;
@ -475,7 +475,7 @@ constexpr int ORBIS_NP_WEBAPI_ERROR_EXTD_PUSH_EVENT_CALLBACK_NOT_FOUND = 0x80552
constexpr int ORBIS_NP_WEBAPI_ERROR_AFTER_SEND = 0x8055291E;
constexpr int ORBIS_NP_WEBAPI_ERROR_TIMEOUT = 0x8055291F;
// NP In-Game Message (0x80552b01 0x80552b09)
// NP In-Game Message (0x80552b01 - 0x80552b09)
constexpr int ORBIS_NP_IN_GAME_MESSAGE_ERROR_OUT_OF_MEMORY = 0x80552B01;
constexpr int ORBIS_NP_IN_GAME_MESSAGE_ERROR_INVALID_ARGUMENT = 0x80552B02;
constexpr int ORBIS_NP_IN_GAME_MESSAGE_ERROR_LIB_CONTEXT_NOT_FOUND = 0x80552B03;
@ -486,13 +486,13 @@ constexpr int ORBIS_NP_IN_GAME_MESSAGE_ERROR_SIGNED_IN_USER_NOT_FOUND = 0x80552B
constexpr int ORBIS_NP_IN_GAME_MESSAGE_ERROR_NOT_PREPARED = 0x80552B08;
constexpr int ORBIS_NP_IN_GAME_MESSAGE_ERROR_EXCEED_RATE_LIMIT = 0x80552B09;
// NP ID Mapper (0x80553000 0x80553003)
// NP ID Mapper (0x80553000 - 0x80553003)
constexpr int ORBIS_NP_ID_MAPPER_ERROR_ABORTED = 0x80553000;
constexpr int ORBIS_NP_ID_MAPPER_ERROR_ACCOUNT_ID_NOT_FOUND = 0x80553001;
constexpr int ORBIS_NP_ID_MAPPER_ERROR_ONLINE_ID_NOT_FOUND = 0x80553002;
constexpr int ORBIS_NP_ID_MAPPER_ERROR_NP_ID_NOT_FOUND = 0x80553003;
// NP Data Communication (0x80553200 0x80553218)
// NP Data Communication (0x80553200 - 0x80553218)
constexpr int ORBIS_NP_DATA_COMMUNICATION_ERROR_UNKNOWN = 0x80553200;
constexpr int ORBIS_NP_DATA_COMMUNICATION_ERROR_NOT_INITIALIZED = 0x80553201;
constexpr int ORBIS_NP_DATA_COMMUNICATION_ERROR_ALREADY_INITIALIZED = 0x80553202;
@ -519,7 +519,7 @@ constexpr int ORBIS_NP_DATA_COMMUNICATION_ERROR_SIGNALING_EXCEEDS_MAX = 0x805532
constexpr int ORBIS_NP_DATA_COMMUNICATION_ERROR_DATA_CHANNEL_EXCEEDS_MAX = 0x80553217;
constexpr int ORBIS_NP_DATA_COMMUNICATION_ERROR_INSUFFICIENT_BUFFER = 0x80553218;
// NP Session Signaling (0x80553301 0x80553312)
// NP Session Signaling (0x80553301 - 0x80553312)
constexpr int ORBIS_NP_SESSION_SIGNALING_ERROR_NOT_INITIALIZED = 0x80553301;
constexpr int ORBIS_NP_SESSION_SIGNALING_ERROR_ALREADY_INITIALIZED = 0x80553302;
constexpr int ORBIS_NP_SESSION_SIGNALING_ERROR_INVALID_ARGUMENT = 0x80553303;
@ -539,7 +539,7 @@ constexpr int ORBIS_NP_SESSION_SIGNALING_ERROR_TERMINATED_BY_MYSELF = 0x80553310
constexpr int ORBIS_NP_SESSION_SIGNALING_ERROR_TOO_MANY_CONN = 0x80553311;
constexpr int ORBIS_NP_SESSION_SIGNALING_ERROR_GROUP_SIGNALING_ALREADY_ACTIVATED = 0x80553312;
// NP WEBAPI2 (0x80553401 0x8055341c)
// NP WEBAPI2 (0x80553401 - 0x8055341c)
constexpr int ORBIS_NP_WEBAPI2_ERROR_OUT_OF_MEMORY = 0x80553401;
constexpr int ORBIS_NP_WEBAPI2_ERROR_INVALID_ARGUMENT = 0x80553402;
constexpr int ORBIS_NP_WEBAPI2_ERROR_INVALID_LIB_CONTEXT_ID = 0x80553403;
@ -569,7 +569,7 @@ constexpr int ORBIS_NP_WEBAPI2_AFTER_SEND = 0x8055341a;
constexpr int ORBIS_NP_WEBAPI2_TIMEOUT = 0x8055341b;
constexpr int ORBIS_NP_WEBAPI2_PUSH_CONTEXT_NOT_FOUND = 0x8055341c;
// NP Session Management Client (0x80553600 0x8055361e)
// NP Session Management Client (0x80553600 - 0x8055361e)
constexpr int ORBIS_NP_SESSION_MANAGEMENT_CLIENT_ERROR_ALREADY_INITIALIZED = 0x80553600;
constexpr int ORBIS_NP_SESSION_MANAGEMENT_CLIENT_ERROR_NOT_INITIALIZED = 0x80553601;
constexpr int ORBIS_NP_SESSION_MANAGEMENT_CLIENT_ERROR_OUT_OF_MEMORY = 0x80553602;
@ -602,7 +602,7 @@ constexpr int ORBIS_NP_SESSION_MANAGEMENT_CLIENT_ERROR_INVALID_VIEW_NAME = 0x805
constexpr int ORBIS_NP_SESSION_MANAGEMENT_CLIENT_ERROR_INVALID_EVENT = 0x8055361D;
constexpr int ORBIS_NP_SESSION_MANAGEMENT_CLIENT_ERROR_INVALID_MEMBER_ID = 0x8055361E;
// NP Session Management Manager (0x80553700 0x80553736)
// NP Session Management Manager (0x80553700 - 0x80553736)
constexpr int ORBIS_NP_SESSION_MANAGEMENT_MANAGER_ERROR_ALREADY_INITIALIZED = 0x80553700;
constexpr int ORBIS_NP_SESSION_MANAGEMENT_MANAGER_ERROR_NOT_INITIALIZED = 0x80553701;
constexpr int ORBIS_NP_SESSION_MANAGEMENT_MANAGER_ERROR_OUT_OF_MEMORY = 0x80553702;
@ -661,7 +661,7 @@ constexpr int ORBIS_NP_SESSION_MANAGEMENT_MANAGER_ERROR_BRIDGE_INFO_NOT_FOUND =
constexpr int ORBIS_NP_SESSION_MANAGEMENT_MANAGER_ERROR_ITEM_NOT_FOUND = 0x80553735;
constexpr int ORBIS_NP_SESSION_MANAGEMENT_MANAGER_ERROR_INVALID_SESSION_CUSTOM_DATA = 0x80553736;
// NP Game Intent (0x80553800 0x80553807)
// NP Game Intent (0x80553800 - 0x80553807)
constexpr int ORBIS_NP_GAME_INTENT_ERROR_UNKNOWN = 0x80553800;
constexpr int ORBIS_NP_GAME_INTENT_ERROR_ALREADY_INITIALIZED = 0x80553801;
constexpr int ORBIS_NP_GAME_INTENT_ERROR_NOT_INITIALIZED = 0x80553802;
@ -671,6 +671,6 @@ constexpr int ORBIS_NP_GAME_INTENT_ERROR_INSUFFICIENT_BUFFER = 0x80553805;
constexpr int ORBIS_NP_GAME_INTENT_ERROR_INTENT_NOT_FOUND = 0x80553806;
constexpr int ORBIS_NP_GAME_INTENT_ERROR_VALUE_NOT_FOUND = 0x80553807;
// NP ASM Client (0x8055a287 0x8055a289)
// NP ASM Client (0x8055a287 - 0x8055a289)
constexpr int ORBIS_NP_ASM_CLIENT_ERROR_ABORTED = 0x8055A287;
constexpr int ORBIS_NP_ASM_CLIENT_ERROR_NP_SERVICE_LAVEL_NOT_MATCH = 0x8055A289;

View File

@ -125,6 +125,8 @@ struct ContextKeyHash {
struct TrophyContext {
u32 context_id;
u32 service_label;
u32 user_id;
bool registered = false;
std::filesystem::path trophy_xml_path; // resolved once at CreateContext
std::filesystem::path xml_dir; // .../Xml/
@ -216,29 +218,11 @@ s32 PS4_SYSV_ABI sceNpTrophyCreateContext(OrbisNpTrophyContext* context,
auto& ctx = contexts_internal[key];
ctx.context_id = *context;
// Resolve and cache all paths once so callers never recompute them.
std::string np_comm_id;
const auto& trophyMap = Common::ElfInfo::Instance().GetTrophyIndexMap();
auto it = trophyMap.find(service_label);
if (it != trophyMap.end()) {
np_comm_id = it->second;
} else {
LOG_ERROR(Lib_NpTrophy, "No npCommId found for trophy index/service_label: {}",
service_label);
return ORBIS_NP_TROPHY_ERROR_UNKNOWN;
}
const auto trophy_base =
Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "trophy" / np_comm_id;
ctx.xml_save_file =
EmulatorSettings.GetHomeDir() / std::to_string(user_id) / "trophy" / (np_comm_id + ".xml");
ctx.xml_dir = trophy_base / "Xml";
ctx.icons_dir = trophy_base / "Icons";
ctx.trophy_xml_path = GetTrophyXmlPath(ctx.xml_dir, EmulatorSettings.GetConsoleLanguage());
ctx.service_label = service_label;
ctx.user_id = user_id;
LOG_INFO(Lib_NpTrophy, "New context = {}, user_id = {} service label = {}", *context, user_id,
service_label);
return ORBIS_OK;
}
@ -836,12 +820,34 @@ int PS4_SYSV_ABI sceNpTrophyRegisterContext(OrbisNpTrophyContext context,
ContextKey contextkey = trophy_contexts[contextId];
auto& ctx = contexts_internal[contextkey];
if (ctx.registered)
if (ctx.registered) {
return ORBIS_NP_TROPHY_ERROR_ALREADY_REGISTERED;
}
if (!std::filesystem::exists(ctx.trophy_xml_path)) {
LOG_ERROR(Lib_NpTrophy, "Could not find trophy files.");
// Stub success here to prevent issues specific to missing a trophy key.
// Resolve trophy-related paths using the context's service_label
std::string np_comm_id;
const auto& trophyMap = Common::ElfInfo::Instance().GetTrophyIndexMap();
auto it = trophyMap.find(ctx.service_label);
if (it != trophyMap.end()) {
// If we have an NP communication ID, prepare proper trophy paths
np_comm_id = it->second;
const auto trophy_base =
Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "trophy" / np_comm_id;
ctx.xml_save_file = EmulatorSettings.GetHomeDir() / std::to_string(ctx.user_id) / "trophy" /
(np_comm_id + ".xml");
ctx.xml_dir = trophy_base / "Xml";
ctx.icons_dir = trophy_base / "Icons";
ctx.trophy_xml_path = GetTrophyXmlPath(ctx.xml_dir, EmulatorSettings.GetConsoleLanguage());
if (!std::filesystem::exists(ctx.trophy_xml_path)) {
LOG_ERROR(Lib_NpTrophy, "Could not find trophy files.");
// Stub success here to prevent issues specific to missing a trophy key.
}
} else {
LOG_ERROR(Lib_NpTrophy, "No npCommId found for trophy index/service_label: {}",
ctx.service_label);
return ORBIS_NP_UTIL_ERROR_INVALID_TITLEID;
}
ctx.registered = true;

View File

@ -120,8 +120,13 @@ std::map<s32, std::string> ExtractTrophies(const std::filesystem::path& npbind_p
}
auto np_comm_ids = npbind.GetNpCommIds();
if (!std::filesystem::exists(trophy_dir) || np_comm_ids.empty()) {
LOG_WARNING(Common_Filesystem, "Cannot extract game trophies");
if (np_comm_ids.empty()) {
LOG_WARNING(Common_Filesystem, "No NPCommIDs in npbind.dat");
return trophy_index_map;
}
if (!std::filesystem::exists(trophy_dir)) {
LOG_WARNING(Common_Filesystem, "Game does not contain a trophy directory");
return trophy_index_map;
}
@ -146,8 +151,13 @@ std::map<s32, std::string> ExtractTrophies(const std::filesystem::path& npbind_p
continue;
}
// Extract the actual trophies if they're no extracted yet
// Add the relevant trophies to our trophy index map.
// This currently assumes the order of NPCommIDs matches the order of trophies.
std::string np_comm_id = np_comm_ids[trophy_index];
trophy_index_map[trophy_index] = np_comm_id;
LOG_DEBUG(Loader, "Mapped trophy index {} to NPCommID: {}", trophy_index, np_comm_id);
// Extract the actual trophies if they're no extracted yet
const auto& trophy_output_dir =
Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "trophy" / np_comm_id;
if (!std::filesystem::exists(trophy_output_dir)) {
@ -171,11 +181,6 @@ std::map<s32, std::string> ExtractTrophies(const std::filesystem::path& npbind_p
user_trophy_file, discard);
}
}
// Add the relevant trophies to our trophy index map.
// This currently assumes the order of NPCommIDs matches the order of trophies.
trophy_index_map[trophy_index] = np_comm_id;
LOG_DEBUG(Loader, "Mapped trophy index {} to NPCommID: {}", trophy_index, np_comm_id);
}
}
return trophy_index_map;

View File

@ -212,7 +212,6 @@ endforeach()
set(HTTP_TEST_SOURCES
# Under test
${CMAKE_SOURCE_DIR}/src/core/libraries/network/http.cpp
# Required to link RegisterLib's LIB_FUNCTION calls and the logger's
# access to EmulatorSettings.
${CMAKE_SOURCE_DIR}/src/core/emulator_settings.cpp
@ -231,11 +230,13 @@ set(HTTP_TEST_SOURCES
stubs/sdl_stub.cpp
stubs/loader_stub.cpp
stubs/core_stub.cpp
stubs/kernel_stub.cpp
# Tests
network/test_http_uri.cpp
network/test_http_status_line.cpp
network/test_http_parse_response_header.cpp
network/test_http_lifecycle.cpp
)
add_executable(shadps4_http_test ${HTTP_TEST_SOURCES})

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "tests/stubs/kernel_stub.h"
#include "core/libraries/kernel/process.h"
namespace Libraries::Kernel {
static constexpr s32 DefaultTestSdkVersion = 0x4500000;
static s32 g_test_sdk_version = DefaultTestSdkVersion;
void TestSetSdkVersion(s32 ver) {
g_test_sdk_version = ver;
}
void TestResetSdkVersion() {
g_test_sdk_version = DefaultTestSdkVersion;
}
s32 PS4_SYSV_ABI sceKernelGetCompiledSdkVersion(s32* ver) {
if (ver) {
*ver = g_test_sdk_version;
}
return 0;
}
} // namespace Libraries::Kernel

13
tests/stubs/kernel_stub.h Normal file
View File

@ -0,0 +1,13 @@
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/types.h"
namespace Libraries::Kernel {
void TestSetSdkVersion(s32 ver);
void TestResetSdkVersion();
} // namespace Libraries::Kernel