From fd39c50910941b03492609196b5fdc5304485539 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 4 Jul 2024 13:49:11 +0300 Subject: [PATCH] improved sceAppContentAppParamGetInt --- src/core/libraries/app_content/app_content.cpp | 15 ++++++++++++--- src/core/libraries/error_codes.h | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/core/libraries/app_content/app_content.cpp b/src/core/libraries/app_content/app_content.cpp index c43d6c39..aadc368f 100644 --- a/src/core/libraries/app_content/app_content.cpp +++ b/src/core/libraries/app_content/app_content.cpp @@ -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::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() { diff --git a/src/core/libraries/error_codes.h b/src/core/libraries/error_codes.h index c7732ad5..63016213 100644 --- a/src/core/libraries/error_codes.h +++ b/src/core/libraries/error_codes.h @@ -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;