mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
error code cleanup and clang
This commit is contained in:
parent
f9c7a22b9c
commit
0e7470ecc5
@ -3,6 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
// companion_httpd error codes
|
||||
constexpr int ORBIS_COMPANION_HTTPD_ERROR_UNKNOWN = 0x80E40001;
|
||||
constexpr int ORBIS_COMPANION_HTTPD_ERROR_FATAL = 0x80E40002;
|
||||
@ -18,3 +20,8 @@ constexpr int ORBIS_COMPANION_HTTPD_ERROR_NOT_STARTED = 0x80E4000B;
|
||||
constexpr int ORBIS_COMPANION_HTTPD_ERROR_ALREADY_REGISTERED = 0x80E4000;
|
||||
constexpr int ORBIS_COMPANION_HTTPD_ERROR_NOT_CONNECTED = 0x80E4000D;
|
||||
constexpr int ORBIS_COMPANION_HTTPD_ERROR_USER_NOT_FOUND = 0x80E4000E;
|
||||
|
||||
// companion_util error codes
|
||||
constexpr u32 ORBIS_COMPANION_UTIL_INVALID_ARGUMENT = 0x80AD0004;
|
||||
constexpr u32 ORBIS_COMPANION_UTIL_INVALID_POINTER = 0x80AD0006;
|
||||
constexpr u32 ORBIS_COMPANION_UTIL_NO_EVENT = 0x80AD0008;
|
@ -2,14 +2,15 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "companion_error.h"
|
||||
#include "core/libraries/companion/companion_util.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
#include "core/libraries/libs.h"
|
||||
#include "core/libraries/companion/companion_util.h"
|
||||
|
||||
namespace Libraries::CompanionUtil {
|
||||
|
||||
u32 PS4_SYSV_ABI getEvent(sceCompanionUtilContext* ctx, sceCompanionUtilEvent* outEvent,
|
||||
s32 param_3) {
|
||||
s32 param_3) {
|
||||
u32 return_var;
|
||||
|
||||
if (outEvent == 0) {
|
||||
@ -32,19 +33,11 @@ u32 PS4_SYSV_ABI getEvent(sceCompanionUtilContext* ctx, sceCompanionUtilEvent* o
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCompanionUtilGetEvent(sceCompanionUtilEvent* outEvent) {
|
||||
|
||||
sceCompanionUtilContext* ctx = nullptr;
|
||||
u32 ret = getEvent(ctx, outEvent,
|
||||
1);
|
||||
u32 return_var;
|
||||
u32 ret = getEvent(ctx, outEvent, 1);
|
||||
|
||||
return_var = ret | 0xad0000;
|
||||
if (-1 < (int)ret) {
|
||||
return_var = ret;
|
||||
}
|
||||
|
||||
LOG_DEBUG(Lib_CompanionUtil, "(STUBBED) called ret: {}", return_var);
|
||||
return return_var;
|
||||
LOG_DEBUG(Lib_CompanionUtil, "(STUBBED) called ret: {}", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceCompanionUtilGetRemoteOskEvent() {
|
||||
|
@ -11,11 +11,7 @@ class SymbolsResolver;
|
||||
|
||||
namespace Libraries::CompanionUtil {
|
||||
|
||||
static constexpr u32 ORBIS_COMPANION_UTIL_OK = 0;
|
||||
|
||||
static constexpr u32 ORBIS_COMPANION_UTIL_INVALID_ARGUMENT = 0x80000004;
|
||||
static constexpr u32 ORBIS_COMPANION_UTIL_INVALID_POINTER = 0x80000006;
|
||||
static constexpr u32 ORBIS_COMPANION_UTIL_NO_EVENT = 0x80000008;
|
||||
constexpr u32 ORBIS_COMPANION_UTIL_OK = 0;
|
||||
|
||||
struct sceCompanionUtilEvent {
|
||||
std::uint8_t blob[0x104]{}; /// 0x104 bytes of data, dont know what it is exactly
|
||||
@ -26,7 +22,7 @@ struct sceCompanionUtilContext {
|
||||
};
|
||||
|
||||
u32 PS4_SYSV_ABI getEvent(sceCompanionUtilContext* ctx, sceCompanionUtilEvent* outEvent,
|
||||
s32 param_3);
|
||||
s32 param_3);
|
||||
s32 PS4_SYSV_ABI sceCompanionUtilGetEvent(sceCompanionUtilEvent* outEvent);
|
||||
s32 PS4_SYSV_ABI sceCompanionUtilGetRemoteOskEvent();
|
||||
s32 PS4_SYSV_ABI sceCompanionUtilInitialize();
|
||||
|
Loading…
Reference in New Issue
Block a user