added error codes in system service

This commit is contained in:
georgemoralis 2024-03-13 13:10:34 +02:00
parent ff35e36a3b
commit eeab34277a
2 changed files with 22 additions and 4 deletions

View File

@ -190,4 +190,7 @@
#define ORBIS_USER_SERVICE_ERROR_OPERATION_NOT_SUPPORTED 0x80960006 #define ORBIS_USER_SERVICE_ERROR_OPERATION_NOT_SUPPORTED 0x80960006
#define ORBIS_USER_SERVICE_ERROR_NO_EVENT 0x80960007 #define ORBIS_USER_SERVICE_ERROR_NO_EVENT 0x80960007
#define ORBIS_USER_SERVICE_ERROR_NOT_LOGGED_IN 0x80960009 #define ORBIS_USER_SERVICE_ERROR_NOT_LOGGED_IN 0x80960009
#define ORBIS_USER_SERVICE_ERROR_BUFFER_TOO_SHORT 0x8096000A #define ORBIS_USER_SERVICE_ERROR_BUFFER_TOO_SHORT 0x8096000A
// SystemService library
#define ORBIS_SYSTEM_SERVICE_ERROR_PARAMETER 0x80A10003

View File

@ -1710,8 +1710,11 @@ int PS4_SYSV_ABI sceSystemServiceGetAppType() {
s32 PS4_SYSV_ABI s32 PS4_SYSV_ABI
sceSystemServiceGetDisplaySafeAreaInfo(OrbisSystemServiceDisplaySafeAreaInfo* info) { sceSystemServiceGetDisplaySafeAreaInfo(OrbisSystemServiceDisplaySafeAreaInfo* info) {
// TODO error handling
LOG_INFO(Lib_SystemService, "called"); LOG_INFO(Lib_SystemService, "called");
if (info == nullptr) {
LOG_ERROR(Lib_SystemService, "OrbisSystemServiceDisplaySafeAreaInfo is null");
return ORBIS_SYSTEM_SERVICE_ERROR_PARAMETER;
}
info->ratio = 1.0f; info->ratio = 1.0f;
return ORBIS_OK; return ORBIS_OK;
} }
@ -1757,6 +1760,11 @@ int PS4_SYSV_ABI sceSystemServiceGetRenderingMode() {
} }
s32 PS4_SYSV_ABI sceSystemServiceGetStatus(OrbisSystemServiceStatus* status) { s32 PS4_SYSV_ABI sceSystemServiceGetStatus(OrbisSystemServiceStatus* status) {
LOG_TRACE(Lib_SystemService, "called");
if (status == nullptr) {
LOG_ERROR(Lib_SystemService, "OrbisSystemServiceStatus is null");
return ORBIS_SYSTEM_SERVICE_ERROR_PARAMETER;
}
OrbisSystemServiceStatus st = {}; OrbisSystemServiceStatus st = {};
st.eventNum = 0; st.eventNum = 0;
st.isSystemUiOverlaid = false; st.isSystemUiOverlaid = false;
@ -1874,9 +1882,12 @@ int PS4_SYSV_ABI sceSystemServiceNavigateToGoHome() {
} }
s32 PS4_SYSV_ABI sceSystemServiceParamGetInt(int param_id, int* value) { s32 PS4_SYSV_ABI sceSystemServiceParamGetInt(int param_id, int* value) {
// TODO this probably should be stored in config for UI configuration
LOG_INFO(Lib_SystemService, "called"); LOG_INFO(Lib_SystemService, "called");
int v = 0; if (value == nullptr) {
LOG_ERROR(Lib_SystemService, "value is null");
return ORBIS_SYSTEM_SERVICE_ERROR_PARAMETER;
}
switch (param_id) { switch (param_id) {
case ORBIS_SYSTEM_SERVICE_PARAM_ID_LANG: case ORBIS_SYSTEM_SERVICE_PARAM_ID_LANG:
*value = ORBIS_SYSTEM_PARAM_LANG_ENGLISH_US; *value = ORBIS_SYSTEM_PARAM_LANG_ENGLISH_US;
@ -1899,6 +1910,10 @@ s32 PS4_SYSV_ABI sceSystemServiceParamGetInt(int param_id, int* value) {
case ORBIS_SYSTEM_SERVICE_PARAM_ID_ENTER_BUTTON_ASSIGN: case ORBIS_SYSTEM_SERVICE_PARAM_ID_ENTER_BUTTON_ASSIGN:
*value = ORBIS_SYSTEM_PARAM_ENTER_BUTTON_ASSIGN_CROSS; *value = ORBIS_SYSTEM_PARAM_ENTER_BUTTON_ASSIGN_CROSS;
break; break;
default:
LOG_ERROR(Lib_SystemService, "param_id {} unsupported!",
param_id); // shouldn't go there but log it
*value = 0; // return a dummy value
} }
return ORBIS_OK; return ORBIS_OK;