Files
AnyPS5/core/libs/prx/libSceNpGameIntent/Export.cpp
T
juanpimg 2f0ed638dc feat(prx): declare the missing PS5 3.20 system exports
AnyPS5 resolves a title's imports by NID, so a title that imports a system
function no library provides fails to load with an unresolved import. The
PS5 3.20 export inventory lists 193 such exports across 37 PS5 system
libraries AnyPS5 implements but does not provide.

Declare them as throwing stubs so those titles load and reach their next
blocker. Each declaration calls NotImplemented_nid_no_patch and returns 0;
none of them implements the function. Declarations with a credible
prototype use it and cite the source with a pinned commit, and the rest
are declared without parameters, which resolves the import without making
an ABI claim. The technical-debt files record the limitation per library.

libSceMbus and libSceSystemService are left out because pull request #7821
declares them. libSceAgc is left out because its exports are versioned, so
the 3.20 NID names a different symbol from the one AnyPS5 ships.
libSceAvPlayer.native is left out because it compiles libSceAvPlayer's
Export.cpp.

Names and NIDs come from the PS5 3.20 export inventory at
https://github.com/DNNDHH/PS5-3.20_Libs/tree/b2a77c09cd71c01f34c790cfbe98c751a13262ad
2026-10-19 23:16:55 +02:00

127 lines
3.0 KiB
C++

#include <cstdint>
#include <cstddef>
#include <cstring>
#include <stdexcept>
#include "SceTypes.hpp"
#include "prx/libc/include/General.hpp"
namespace {
constexpr int NpGameIntentErrorInvalidArgument = -2141898748;
constexpr int NpGameIntentErrorIntentNotFound = -2141898746;
constexpr int NpGameIntentErrorValueNotFound = -2141898745;
constexpr int NpGameIntentUserIdInvalid = -1;
}
extern "C" {
int APS5_VABI sceNpGameIntentGetPropertyValueString(const NpGameIntentData* intentData, const char* key, char* valueBuf, size_t bufSize) {
if (intentData == nullptr || key == nullptr || valueBuf == nullptr || bufSize == 0) {
APS5_INVALID_ARG_EX;
}
valueBuf[0] = '\0';
return NpGameIntentErrorValueNotFound;
}
int APS5_VABI sceNpGameIntentInitialize(const void* initParam) {
(void)initParam;
return 0;
}
int APS5_VABI sceNpGameIntentReceiveIntent(NpGameIntentInfo* intentInfo) {
if (intentInfo == nullptr) {
APS5_INVALID_ARG_EX;
}
intentInfo->user_id = NpGameIntentUserIdInvalid;
std::memset(intentInfo->intent_type, 0, sizeof(intentInfo->intent_type));
std::memset(&intentInfo->intent_data, 0, sizeof(intentInfo->intent_data));
return NpGameIntentErrorIntentNotFound;
}
int APS5_VABI sceNpGameIntentTerminate(void) {
return 0;
}
int APS5_VABI sceNpGameIntentInitParamInit(NpGameIntentInitParam* param) {
if (param == nullptr) {
APS5_INVALID_ARG_EX;
}
std::memset(param, 0, sizeof(NpGameIntentInitParam));
param->size = sizeof(NpGameIntentInitParam);
return 0;
}
int APS5_VABI sceNpGameIntentInfoInit(NpGameIntentInfo* info) {
if (info == nullptr) {
APS5_INVALID_ARG_EX;
}
std::memset(info, 0, sizeof(NpGameIntentInfo));
info->size = sizeof(NpGameIntentInfo);
info->user_id = NpGameIntentUserIdInvalid;
return 0;
}
int APS5_VABI sceNpGameIntentVshInitialize(void) {
return 0;
}
int APS5_VABI sceNpGameIntentVshTerminate(void) {
return 0;
}
int APS5_VABI sceNpAppLauncherInitialize() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpAppLauncherLaunchApp() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpAppLauncherTerminate() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpGameIntentGetUdsNpComId() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpGameIntentLaunchApp() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpGameIntentLaunchApp2() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpGameIntentNotifyAppLaunched() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpSessionServiceGetJoinedPartySession() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpSessionServiceGetRunningGamePlayerSession() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
int APS5_VABI sceNpSessionServiceSendPlayerSessionInvitations() {
NotImplemented_nid_no_patch(__func__);
return 0;
}
}