improved sceAppContentAppParamGetInt

This commit is contained in:
georgemoralis 2024-07-04 13:49:11 +03:00
parent 8d17f87a08
commit fd39c50910
2 changed files with 15 additions and 3 deletions

View File

@ -52,7 +52,7 @@ int PS4_SYSV_ABI sceAppContentAddcontUnmount() {
int PS4_SYSV_ABI sceAppContentAppParamGetInt(OrbisAppContentAppParamId paramId, s32* value) {
if (value == nullptr)
return 0x80D90002;
return ORBIS_APP_CONTENT_ERROR_PARAMETER;
auto* param_sfo = Common::Singleton<PSF>::Instance();
switch (paramId) {
case ORBIS_APP_CONTENT_APPPARAM_ID_SKU_FLAG:
@ -70,9 +70,18 @@ int PS4_SYSV_ABI sceAppContentAppParamGetInt(OrbisAppContentAppParamId paramId,
case ORBIS_APP_CONTENT_APPPARAM_ID_USER_DEFINED_PARAM_4:
*value = param_sfo->GetInteger("USER_DEFINED_PARAM_4");
break;
default:
LOG_ERROR(Lib_AppContent, " paramId = {}, value = {} paramId is not valid", paramId,
*value);
return ORBIS_APP_CONTENT_ERROR_PARAMETER;
}
LOG_ERROR(Lib_AppContent, " paramId = {}, value = {}", paramId, *value);
return *value == -1 ? 0x80D90005 : ORBIS_OK;
if (*value == -1) {
LOG_ERROR(Lib_AppContent,
" paramId = {}, value = {} value is not valid can't read param.sfo?", paramId,
*value);
return ORBIS_APP_CONTENT_ERROR_PARAMETER;
}
return ORBIS_OK;
}
int PS4_SYSV_ABI sceAppContentAppParamGetString() {

View File

@ -453,3 +453,6 @@ constexpr int ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE = 0x80551608;
constexpr int ORBIS_NP_TROPHY_ERROR_HANDLE_EXCEEDS_MAX = 0x80551624;
constexpr int ORBIS_NP_TROPHY_ERROR_CONTEXT_ALREADY_EXISTS = 0x80551613;
constexpr int ORBIS_NP_TROPHY_ERROR_CONTEXT_EXCEEDS_MAX = 0x80551622;
// AppContent library
constexpr int ORBIS_APP_CONTENT_ERROR_PARAMETER = 0x80D90002;