mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Move AdHoc error codes to the big enum, fix the naming convention to be consistent
This commit is contained in:
1 parent
b997b33d58
commit
3e2dce1e54
7 files changed
+431
-351
No files matched your search
@@ -552,4 +552,84 @@ enum PSPErrorCode : u32 {
|
||||
SCE_NET_APCTL_ERROR_INVALID_ID = 0x80410a09,
|
||||
SCE_NET_APCTL_ERROR_WLAN_SUSPENDED = 0x80410a0a,
|
||||
SCE_NET_APCTL_ERROR_TIMEOUT = 0x80410a0b,
|
||||
|
||||
// pspnet_adhoc_auth
|
||||
SCE_NET_ADHOC_ERROR_AUTH_ALREADY_INITIALIZED = 0x80410601,
|
||||
|
||||
// pspnet_adhoc
|
||||
SCE_NET_ADHOC_ERROR_INVALID_SOCKET_ID = 0x80410701,
|
||||
SCE_NET_ADHOC_ERROR_INVALID_ADDR = 0x80410702,
|
||||
SCE_NET_ADHOC_ERROR_INVALID_PORT = 0x80410703,
|
||||
SCE_NET_ADHOC_ERROR_INVALID_BUFLEN = 0x80410704,
|
||||
SCE_NET_ADHOC_ERROR_INVALID_DATALEN = 0x80410705,
|
||||
SCE_NET_ADHOC_ERROR_NOT_ENOUGH_SPACE = 0x80400706, // not a typo
|
||||
SCE_NET_ADHOC_ERROR_SOCKET_DELETED = 0x80410707,
|
||||
SCE_NET_ADHOC_ERROR_SOCKET_ALERTED = 0x80410708,
|
||||
SCE_NET_ADHOC_ERROR_WOULD_BLOCK = 0x80410709, //ERROR_NET_ADHOC_NO_DATA_AVAILABLE
|
||||
SCE_NET_ADHOC_ERROR_PORT_IN_USE = 0x8041070a,
|
||||
SCE_NET_ADHOC_ERROR_NOT_CONNECTED = 0x8041070B,
|
||||
SCE_NET_ADHOC_ERROR_DISCONNECTED = 0x8041070c,
|
||||
SCE_NET_ADHOC_ERROR_NOT_OPENED = 0x8040070D, // not a typo
|
||||
SCE_NET_ADHOC_ERROR_NOT_LISTENED = 0x8040070E, // not a typo
|
||||
SCE_NET_ADHOC_ERROR_SOCKET_ID_NOT_AVAIL = 0x8041070F,
|
||||
SCE_NET_ADHOC_ERROR_PORT_NOT_AVAIL = 0x80410710,
|
||||
SCE_NET_ADHOC_ERROR_INVALID_ARG = 0x80410711,
|
||||
SCE_NET_ADHOC_ERROR_NOT_INITIALIZED = 0x80410712,
|
||||
SCE_NET_ADHOC_ERROR_ALREADY_INITIALIZED = 0x80410713,
|
||||
SCE_NET_ADHOC_ERROR_BUSY = 0x80410714,
|
||||
SCE_NET_ADHOC_ERROR_TIMEOUT = 0x80410715,
|
||||
SCE_NET_ADHOC_ERROR_NO_ENTRY = 0x80410716,
|
||||
SCE_NET_ADHOC_ERROR_EXCEPTION_EVENT = 0x80410717,
|
||||
SCE_NET_ADHOC_ERROR_CONNECTION_REFUSED = 0x80410718,
|
||||
SCE_NET_ADHOC_ERROR_THREAD_ABORTED = 0x80410719,
|
||||
SCE_NET_ADHOC_ERROR_ALREADY_CREATED = 0x8041071A,
|
||||
SCE_NET_ADHOC_ERROR_NOT_IN_GAMEMODE = 0x8041071B,
|
||||
SCE_NET_ADHOC_ERROR_NOT_CREATED = 0x8041071C,
|
||||
|
||||
// pspnet_adhoc_matching
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MODE = 0x80410801,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_INVALID_PORT = 0x80410802,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MAXNUM = 0x80410803,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_RXBUF_TOO_SHORT = 0x80410804,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_INVALID_OPTLEN = 0x80410805,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG = 0x80410806,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID = 0x80410807,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_ID_NOT_AVAIL = 0x80410808,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_NO_SPACE = 0x80410809,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_IS_RUNNING = 0x8041080A,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING = 0x8041080B,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET = 0x8041080C,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_TARGET_NOT_READY = 0x8041080D,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_EXCEED_MAXNUM = 0x8041080E,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_REQUEST_IN_PROGRESS = 0x8041080F,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_ESTABLISHED = 0x80410810,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_BUSY = 0x80410811,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_INITIALIZED = 0x80410812,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED = 0x80410813,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_PORT_IN_USE = 0x80410814,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_STACKSIZE_TOO_SHORT = 0x80410815,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_INVALID_DATALEN = 0x80410816,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_NOT_ESTABLISHED = 0x80410817,
|
||||
SCE_NET_ADHOC_MATCHING_ERROR_DATA_BUSY = 0x80410818,
|
||||
|
||||
// pspnet_adhocctl
|
||||
SCE_NET_ADHOCCTL_ERROR_NOT_LEFT_IBSS = 0x80410b01,
|
||||
SCE_NET_ADHOCCTL_ERROR_ALREADY_CONNECTED = 0x80410b02,
|
||||
SCE_NET_ADHOCCTL_ERROR_WLAN_SWITCH_OFF = 0x80410b03,
|
||||
SCE_NET_ADHOCCTL_ERROR_INVALID_ARG = 0x80410B04,
|
||||
SCE_NET_ADHOCCTL_ERROR_TIMEOUT = 0x80410b05,
|
||||
SCE_NET_ADHOCCTL_ERROR_ID_NOT_FOUND = 0x80410B06,
|
||||
SCE_NET_ADHOCCTL_ERROR_ALREADY_INITIALIZED = 0x80410b07,
|
||||
SCE_NET_ADHOCCTL_ERROR_NOT_INITIALIZED = 0x80410b08,
|
||||
SCE_NET_ADHOCCTL_ERROR_DISCONNECTED = 0x80410b09,
|
||||
SCE_NET_ADHOCCTL_ERROR_NO_SCAN_INFO = 0x80410b0a,
|
||||
SCE_NET_ADHOCCTL_ERROR_INVALID_IBSS = 0x80410b0b,
|
||||
SCE_NET_ADHOCCTL_ERROR_NOT_ENTER_GAMEMODE = 0x80410B0C,
|
||||
SCE_NET_ADHOCCTL_ERROR_CHANNEL_NOT_AVAILABLE = 0x80410B0D,
|
||||
SCE_NET_ADHOCCTL_ERROR_WLAN_BEACON_LOST = 0x80410b0e,
|
||||
SCE_NET_ADHOCCTL_ERROR_WLAN_SUSPENDED = 0x80410b0f,
|
||||
SCE_NET_ADHOCCTL_ERROR_BUSY = 0x80410b10,
|
||||
SCE_NET_ADHOCCTL_ERROR_CHANNEL_NOT_MATCH = 0x80410b11,
|
||||
SCE_NET_ADHOCCTL_ERROR_TOO_MANY_HANDLERS = 0x80410b12,
|
||||
SCE_NET_ADHOCCTL_ERROR_STACKSIZE_TOO_SHORT = 0x80410B13,
|
||||
};
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "Core/HLE/sceKernel.h"
|
||||
#include "Core/HLE/sceKernelMutex.h"
|
||||
#include "Core/HLE/sceUtility.h"
|
||||
#include "Core/HLE/ErrorCodes.h"
|
||||
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
@@ -1454,7 +1455,7 @@ int friendFinder() {
|
||||
// Calculate EnterGameMode Timeout to prevent waiting forever for disconnected players
|
||||
if (isAdhocctlBusy && adhocctlState == ADHOCCTL_STATE_DISCONNECTED && adhocctlCurrentMode == ADHOCCTL_MODE_GAMEMODE && netAdhocGameModeEntered && static_cast<s64>(now - adhocctlStartTime) > netAdhocEnterGameModeTimeout) {
|
||||
netAdhocGameModeEntered = false;
|
||||
notifyAdhocctlHandlers(ADHOCCTL_EVENT_ERROR, ERROR_NET_ADHOC_TIMEOUT);
|
||||
notifyAdhocctlHandlers(ADHOCCTL_EVENT_ERROR, SCE_NET_ADHOC_ERROR_TIMEOUT);
|
||||
}
|
||||
|
||||
// Handle Packets
|
||||
|
||||
@@ -519,88 +519,6 @@ typedef struct SceNetAdhocMatchingContext {
|
||||
|
||||
// End of psp definitions
|
||||
|
||||
enum {
|
||||
// pspnet_adhoc_auth
|
||||
ERROR_NET_ADHOC_AUTH_ALREADY_INITIALIZED = 0x80410601,
|
||||
|
||||
// pspnet_adhoc
|
||||
ERROR_NET_ADHOC_INVALID_SOCKET_ID = 0x80410701,
|
||||
ERROR_NET_ADHOC_INVALID_ADDR = 0x80410702,
|
||||
ERROR_NET_ADHOC_INVALID_PORT = 0x80410703,
|
||||
ERROR_NET_ADHOC_INVALID_BUFLEN = 0x80410704,
|
||||
ERROR_NET_ADHOC_INVALID_DATALEN = 0x80410705,
|
||||
ERROR_NET_ADHOC_NOT_ENOUGH_SPACE = 0x80400706, // not a typo
|
||||
ERROR_NET_ADHOC_SOCKET_DELETED = 0x80410707,
|
||||
ERROR_NET_ADHOC_SOCKET_ALERTED = 0x80410708,
|
||||
ERROR_NET_ADHOC_WOULD_BLOCK = 0x80410709, //ERROR_NET_ADHOC_NO_DATA_AVAILABLE
|
||||
ERROR_NET_ADHOC_PORT_IN_USE = 0x8041070a,
|
||||
ERROR_NET_ADHOC_NOT_CONNECTED = 0x8041070B,
|
||||
ERROR_NET_ADHOC_DISCONNECTED = 0x8041070c,
|
||||
ERROR_NET_ADHOC_NOT_OPENED = 0x8040070D, // not a typo
|
||||
ERROR_NET_ADHOC_NOT_LISTENED = 0x8040070E, // not a typo
|
||||
ERROR_NET_ADHOC_SOCKET_ID_NOT_AVAIL = 0x8041070F,
|
||||
ERROR_NET_ADHOC_PORT_NOT_AVAIL = 0x80410710,
|
||||
ERROR_NET_ADHOC_INVALID_ARG = 0x80410711,
|
||||
ERROR_NET_ADHOC_NOT_INITIALIZED = 0x80410712,
|
||||
ERROR_NET_ADHOC_ALREADY_INITIALIZED = 0x80410713,
|
||||
ERROR_NET_ADHOC_BUSY = 0x80410714,
|
||||
ERROR_NET_ADHOC_TIMEOUT = 0x80410715,
|
||||
ERROR_NET_ADHOC_NO_ENTRY = 0x80410716,
|
||||
ERROR_NET_ADHOC_EXCEPTION_EVENT = 0x80410717,
|
||||
ERROR_NET_ADHOC_CONNECTION_REFUSED = 0x80410718,
|
||||
ERROR_NET_ADHOC_THREAD_ABORTED = 0x80410719,
|
||||
ERROR_NET_ADHOC_ALREADY_CREATED = 0x8041071A,
|
||||
ERROR_NET_ADHOC_NOT_IN_GAMEMODE = 0x8041071B,
|
||||
ERROR_NET_ADHOC_NOT_CREATED = 0x8041071C,
|
||||
|
||||
// pspnet_adhoc_matching
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_MODE = 0x80410801,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_PORT = 0x80410802,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_MAXNUM = 0x80410803,
|
||||
ERROR_NET_ADHOC_MATCHING_RXBUF_TOO_SHORT = 0x80410804,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_OPTLEN = 0x80410805,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_ARG = 0x80410806,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_ID = 0x80410807,
|
||||
ERROR_NET_ADHOC_MATCHING_ID_NOT_AVAIL = 0x80410808,
|
||||
ERROR_NET_ADHOC_MATCHING_NO_SPACE = 0x80410809,
|
||||
ERROR_NET_ADHOC_MATCHING_IS_RUNNING = 0x8041080A,
|
||||
ERROR_NET_ADHOC_MATCHING_NOT_RUNNING = 0x8041080B,
|
||||
ERROR_NET_ADHOC_MATCHING_UNKNOWN_TARGET = 0x8041080C,
|
||||
ERROR_NET_ADHOC_MATCHING_TARGET_NOT_READY = 0x8041080D,
|
||||
ERROR_NET_ADHOC_MATCHING_EXCEED_MAXNUM = 0x8041080E,
|
||||
ERROR_NET_ADHOC_MATCHING_REQUEST_IN_PROGRESS = 0x8041080F,
|
||||
ERROR_NET_ADHOC_MATCHING_ALREADY_ESTABLISHED = 0x80410810,
|
||||
ERROR_NET_ADHOC_MATCHING_BUSY = 0x80410811,
|
||||
ERROR_NET_ADHOC_MATCHING_ALREADY_INITIALIZED = 0x80410812,
|
||||
ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED = 0x80410813,
|
||||
ERROR_NET_ADHOC_MATCHING_PORT_IN_USE = 0x80410814,
|
||||
ERROR_NET_ADHOC_MATCHING_STACKSIZE_TOO_SHORT = 0x80410815,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_DATALEN = 0x80410816,
|
||||
ERROR_NET_ADHOC_MATCHING_NOT_ESTABLISHED = 0x80410817,
|
||||
ERROR_NET_ADHOC_MATCHING_DATA_BUSY = 0x80410818,
|
||||
|
||||
// pspnet_adhocctl
|
||||
ERROR_NET_ADHOCCTL_NOT_LEFT_IBSS = 0x80410b01,
|
||||
ERROR_NET_ADHOCCTL_ALREADY_CONNECTED = 0x80410b02,
|
||||
ERROR_NET_ADHOCCTL_WLAN_SWITCH_OFF = 0x80410b03,
|
||||
ERROR_NET_ADHOCCTL_INVALID_ARG = 0x80410B04,
|
||||
ERROR_NET_ADHOCCTL_TIMEOUT = 0x80410b05,
|
||||
ERROR_NET_ADHOCCTL_ID_NOT_FOUND = 0x80410B06,
|
||||
ERROR_NET_ADHOCCTL_ALREADY_INITIALIZED = 0x80410b07,
|
||||
ERROR_NET_ADHOCCTL_NOT_INITIALIZED = 0x80410b08,
|
||||
ERROR_NET_ADHOCCTL_DISCONNECTED = 0x80410b09,
|
||||
ERROR_NET_ADHOCCTL_NO_SCAN_INFO = 0x80410b0a,
|
||||
ERROR_NET_ADHOCCTL_INVALID_IBSS = 0x80410b0b,
|
||||
ERROR_NET_ADHOCCTL_NOT_ENTER_GAMEMODE = 0x80410B0C,
|
||||
ERROR_NET_ADHOCCTL_CHANNEL_NOT_AVAILABLE = 0x80410B0D,
|
||||
ERROR_NET_ADHOCCTL_WLAN_BEACON_LOST = 0x80410b0e,
|
||||
ERROR_NET_ADHOCCTL_WLAN_SUSPENDED = 0x80410b0f,
|
||||
ERROR_NET_ADHOCCTL_BUSY = 0x80410b10,
|
||||
ERROR_NET_ADHOCCTL_CHANNEL_NOT_MATCH = 0x80410b11,
|
||||
ERROR_NET_ADHOCCTL_TOO_MANY_HANDLERS = 0x80410b12,
|
||||
ERROR_NET_ADHOCCTL_STACKSIZE_TOO_SHORT = 0x80410B13,
|
||||
};
|
||||
|
||||
const size_t MAX_ADHOCCTL_HANDLERS = 32; //4
|
||||
const size_t MAX_MATCHING_HANDLERS = 32; //4
|
||||
|
||||
|
||||
@@ -1547,6 +1547,87 @@ const char *KernelErrorToString(u32 err) {
|
||||
case SCE_NET_APCTL_ERROR_INVALID_ID: return "SCE_NET_APCTL_ERROR_INVALID_ID";
|
||||
case SCE_NET_APCTL_ERROR_WLAN_SUSPENDED: return "SCE_NET_APCTL_ERROR_WLAN_SUSPENDED";
|
||||
case SCE_NET_APCTL_ERROR_TIMEOUT: return "SCE_NET_APCTL_ERROR_TIMEOUT";
|
||||
|
||||
// pspnet_adhoc_auth
|
||||
case SCE_NET_ADHOC_ERROR_AUTH_ALREADY_INITIALIZED: return "SCE_NET_ADHOC_ERROR_AUTH_ALREADY_INITIALIZED";
|
||||
|
||||
// pspnet_adhoc
|
||||
case SCE_NET_ADHOC_ERROR_INVALID_SOCKET_ID: return "SCE_NET_ADHOC_ERROR_INVALID_SOCKET_ID";
|
||||
case SCE_NET_ADHOC_ERROR_INVALID_ADDR: return "SCE_NET_ADHOC_ERROR_INVALID_ADDR";
|
||||
case SCE_NET_ADHOC_ERROR_INVALID_PORT: return "SCE_NET_ADHOC_ERROR_INVALID_PORT";
|
||||
case SCE_NET_ADHOC_ERROR_INVALID_BUFLEN: return "SCE_NET_ADHOC_ERROR_INVALID_BUFLEN";
|
||||
case SCE_NET_ADHOC_ERROR_INVALID_DATALEN: return "SCE_NET_ADHOC_ERROR_INVALID_DATALEN";
|
||||
case SCE_NET_ADHOC_ERROR_NOT_ENOUGH_SPACE: return "SCE_NET_ADHOC_ERROR_NOT_ENOUGH_SPACE";
|
||||
case SCE_NET_ADHOC_ERROR_SOCKET_DELETED: return "SCE_NET_ADHOC_ERROR_SOCKET_DELETED";
|
||||
case SCE_NET_ADHOC_ERROR_SOCKET_ALERTED: return "SCE_NET_ADHOC_ERROR_SOCKET_ALERTED";
|
||||
case SCE_NET_ADHOC_ERROR_WOULD_BLOCK: return "SCE_NET_ADHOC_ERROR_WOULD_BLOCK";
|
||||
case SCE_NET_ADHOC_ERROR_PORT_IN_USE: return "SCE_NET_ADHOC_ERROR_PORT_IN_USE";
|
||||
case SCE_NET_ADHOC_ERROR_NOT_CONNECTED: return "SCE_NET_ADHOC_ERROR_NOT_CONNECTED";
|
||||
case SCE_NET_ADHOC_ERROR_DISCONNECTED: return "SCE_NET_ADHOC_ERROR_DISCONNECTED";
|
||||
case SCE_NET_ADHOC_ERROR_NOT_OPENED: return "SCE_NET_ADHOC_ERROR_NOT_OPENED";
|
||||
case SCE_NET_ADHOC_ERROR_NOT_LISTENED: return "SCE_NET_ADHOC_ERROR_NOT_LISTENED";
|
||||
case SCE_NET_ADHOC_ERROR_SOCKET_ID_NOT_AVAIL: return "SCE_NET_ADHOC_ERROR_SOCKET_ID_NOT_AVAIL";
|
||||
case SCE_NET_ADHOC_ERROR_PORT_NOT_AVAIL: return "SCE_NET_ADHOC_ERROR_PORT_NOT_AVAIL";
|
||||
case SCE_NET_ADHOC_ERROR_INVALID_ARG: return "SCE_NET_ADHOC_ERROR_INVALID_ARG";
|
||||
case SCE_NET_ADHOC_ERROR_NOT_INITIALIZED: return "SCE_NET_ADHOC_ERROR_NOT_INITIALIZED";
|
||||
case SCE_NET_ADHOC_ERROR_ALREADY_INITIALIZED: return "SCE_NET_ADHOC_ERROR_ALREADY_INITIALIZED";
|
||||
case SCE_NET_ADHOC_ERROR_BUSY: return "SCE_NET_ADHOC_ERROR_BUSY";
|
||||
case SCE_NET_ADHOC_ERROR_TIMEOUT: return "SCE_NET_ADHOC_ERROR_TIMEOUT";
|
||||
case SCE_NET_ADHOC_ERROR_NO_ENTRY: return "SCE_NET_ADHOC_ERROR_NO_ENTRY";
|
||||
case SCE_NET_ADHOC_ERROR_EXCEPTION_EVENT: return "SCE_NET_ADHOC_ERROR_EXCEPTION_EVENT";
|
||||
case SCE_NET_ADHOC_ERROR_CONNECTION_REFUSED: return "SCE_NET_ADHOC_ERROR_CONNECTION_REFUSED";
|
||||
case SCE_NET_ADHOC_ERROR_THREAD_ABORTED: return "SCE_NET_ADHOC_ERROR_THREAD_ABORTED";
|
||||
case SCE_NET_ADHOC_ERROR_ALREADY_CREATED: return "SCE_NET_ADHOC_ERROR_ALREADY_CREATED";
|
||||
case SCE_NET_ADHOC_ERROR_NOT_IN_GAMEMODE: return "SCE_NET_ADHOC_ERROR_NOT_IN_GAMEMODE";
|
||||
case SCE_NET_ADHOC_ERROR_NOT_CREATED: return "SCE_NET_ADHOC_ERROR_NOT_CREATED";
|
||||
|
||||
// pspnet_adhoc_matching
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MODE: return "SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MODE";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_INVALID_PORT: return "SCE_NET_ADHOC_MATCHING_ERROR_INVALID_PORT";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MAXNUM: return "SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MAXNUM";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_RXBUF_TOO_SHORT: return "SCE_NET_ADHOC_MATCHING_ERROR_RXBUF_TOO_SHORT";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_INVALID_OPTLEN: return "SCE_NET_ADHOC_MATCHING_ERROR_INVALID_OPTLEN";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG: return "SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID: return "SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_ID_NOT_AVAIL: return "SCE_NET_ADHOC_MATCHING_ERROR_ID_NOT_AVAIL";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_NO_SPACE: return "SCE_NET_ADHOC_MATCHING_ERROR_NO_SPACE";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_IS_RUNNING: return "SCE_NET_ADHOC_MATCHING_ERROR_IS_RUNNING";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING: return "SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET: return "SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_TARGET_NOT_READY: return "SCE_NET_ADHOC_MATCHING_ERROR_TARGET_NOT_READY";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_EXCEED_MAXNUM: return "SCE_NET_ADHOC_MATCHING_ERROR_EXCEED_MAXNUM";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_REQUEST_IN_PROGRESS: return "SCE_NET_ADHOC_MATCHING_ERROR_REQUEST_IN_PROGRESS";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_ESTABLISHED: return "SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_ESTABLISHED";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_BUSY: return "SCE_NET_ADHOC_MATCHING_ERROR_BUSY";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_INITIALIZED: return "SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_INITIALIZED";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED: return "SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_PORT_IN_USE: return "SCE_NET_ADHOC_MATCHING_ERROR_PORT_IN_USE";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_STACKSIZE_TOO_SHORT: return "SCE_NET_ADHOC_MATCHING_ERROR_STACKSIZE_TOO_SHORT";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_INVALID_DATALEN: return "SCE_NET_ADHOC_MATCHING_ERROR_INVALID_DATALEN";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_NOT_ESTABLISHED: return "SCE_NET_ADHOC_MATCHING_ERROR_NOT_ESTABLISHED";
|
||||
case SCE_NET_ADHOC_MATCHING_ERROR_DATA_BUSY: return "SCE_NET_ADHOC_MATCHING_ERROR_DATA_BUSY";
|
||||
|
||||
// pspnet_adhocctl
|
||||
case SCE_NET_ADHOCCTL_ERROR_NOT_LEFT_IBSS: return "SCE_NET_ADHOCCTL_ERROR_NOT_LEFT_IBSS";
|
||||
case SCE_NET_ADHOCCTL_ERROR_ALREADY_CONNECTED: return "SCE_NET_ADHOCCTL_ERROR_ALREADY_CONNECTED";
|
||||
case SCE_NET_ADHOCCTL_ERROR_WLAN_SWITCH_OFF: return "SCE_NET_ADHOCCTL_ERROR_WLAN_SWITCH_OFF";
|
||||
case SCE_NET_ADHOCCTL_ERROR_INVALID_ARG: return "SCE_NET_ADHOCCTL_ERROR_INVALID_ARG";
|
||||
case SCE_NET_ADHOCCTL_ERROR_TIMEOUT: return "SCE_NET_ADHOCCTL_ERROR_TIMEOUT";
|
||||
case SCE_NET_ADHOCCTL_ERROR_ID_NOT_FOUND: return "SCE_NET_ADHOCCTL_ERROR_ID_NOT_FOUND";
|
||||
case SCE_NET_ADHOCCTL_ERROR_ALREADY_INITIALIZED: return "SCE_NET_ADHOCCTL_ERROR_ALREADY_INITIALIZED";
|
||||
case SCE_NET_ADHOCCTL_ERROR_NOT_INITIALIZED: return "SCE_NET_ADHOCCTL_ERROR_NOT_INITIALIZED";
|
||||
case SCE_NET_ADHOCCTL_ERROR_DISCONNECTED: return "SCE_NET_ADHOCCTL_ERROR_DISCONNECTED";
|
||||
case SCE_NET_ADHOCCTL_ERROR_NO_SCAN_INFO: return "SCE_NET_ADHOCCTL_ERROR_NO_SCAN_INFO";
|
||||
case SCE_NET_ADHOCCTL_ERROR_INVALID_IBSS: return "SCE_NET_ADHOCCTL_ERROR_INVALID_IBSS";
|
||||
case SCE_NET_ADHOCCTL_ERROR_NOT_ENTER_GAMEMODE: return "SCE_NET_ADHOCCTL_ERROR_NOT_ENTER_GAMEMODE";
|
||||
case SCE_NET_ADHOCCTL_ERROR_CHANNEL_NOT_AVAILABLE: return "SCE_NET_ADHOCCTL_ERROR_CHANNEL_NOT_AVAILABLE";
|
||||
case SCE_NET_ADHOCCTL_ERROR_WLAN_BEACON_LOST: return "SCE_NET_ADHOCCTL_ERROR_WLAN_BEACON_LOST";
|
||||
case SCE_NET_ADHOCCTL_ERROR_WLAN_SUSPENDED: return "SCE_NET_ADHOCCTL_ERROR_WLAN_SUSPENDED";
|
||||
case SCE_NET_ADHOCCTL_ERROR_BUSY: return "SCE_NET_ADHOCCTL_ERROR_BUSY";
|
||||
case SCE_NET_ADHOCCTL_ERROR_CHANNEL_NOT_MATCH: return "SCE_NET_ADHOCCTL_ERROR_CHANNEL_NOT_MATCH";
|
||||
case SCE_NET_ADHOCCTL_ERROR_TOO_MANY_HANDLERS: return "SCE_NET_ADHOCCTL_ERROR_TOO_MANY_HANDLERS";
|
||||
case SCE_NET_ADHOCCTL_ERROR_STACKSIZE_TOO_SHORT: return "SCE_NET_ADHOCCTL_ERROR_STACKSIZE_TOO_SHORT";
|
||||
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1426,7 +1426,7 @@ static int NetApctl_AddHandler(u32 handlerPtr, u32 handlerArg) {
|
||||
if (!foundHandler && Memory::IsValidAddress(handlerPtr)) {
|
||||
if (apctlHandlers.size() >= MAX_APCTL_HANDLERS) {
|
||||
ERROR_LOG(Log::sceNet, "Failed to Add handler(%x, %x): Too many handlers", handlerPtr, handlerArg);
|
||||
retval = ERROR_NET_ADHOCCTL_TOO_MANY_HANDLERS; // TODO: What's the proper error code for Apctl's TOO_MANY_HANDLERS?
|
||||
retval = SCE_NET_ADHOCCTL_ERROR_TOO_MANY_HANDLERS; // TODO: What's the proper error code for Apctl's TOO_MANY_HANDLERS?
|
||||
return retval;
|
||||
}
|
||||
apctlHandlers[retval] = handler;
|
||||
|
||||
+208
-208
File diff suppressed because it is too large.
Load diff
@@ -1695,7 +1695,7 @@ int sceNetAdhocMatchingInit(u32 memsize) {
|
||||
|
||||
// Uninitialized Library
|
||||
if (netAdhocMatchingInited)
|
||||
return ERROR_NET_ADHOC_MATCHING_ALREADY_INITIALIZED;
|
||||
return SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_INITIALIZED;
|
||||
|
||||
// Save Fake Pool Size
|
||||
fakePoolSize = memsize;
|
||||
@@ -1748,22 +1748,22 @@ static int sceNetAdhocMatchingCreate(int mode, int maxnum, int port, int rxbufle
|
||||
|
||||
if (!netAdhocMatchingInited) {
|
||||
// Uninitialized Library
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "adhoc matching not initialized");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "adhoc matching not initialized");
|
||||
}
|
||||
|
||||
if (maxnum <= 1 || maxnum > 16) {
|
||||
// Invalid Member Limit
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_MAXNUM, "adhoc matching invalid maxnum");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MAXNUM, "adhoc matching invalid maxnum");
|
||||
}
|
||||
|
||||
if (rxbuflen < 1) {
|
||||
// Invalid Receive Buffer Size
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_RXBUF_TOO_SHORT, "adhoc matching rxbuf too short");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_RXBUF_TOO_SHORT, "adhoc matching rxbuf too short");
|
||||
}
|
||||
|
||||
if (mode < 1 || mode > 3) {
|
||||
// InvalidERROR_NET_Arguments
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "adhoc matching invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "adhoc matching invalid arg");
|
||||
}
|
||||
|
||||
// Iterate Matching Contexts
|
||||
@@ -1771,7 +1771,7 @@ static int sceNetAdhocMatchingCreate(int mode, int maxnum, int port, int rxbufle
|
||||
for (; item != NULL; item = item->next) {
|
||||
// Port Match found
|
||||
if (item->port == port)
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_PORT_IN_USE, "adhoc matching port in use");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_PORT_IN_USE, "adhoc matching port in use");
|
||||
}
|
||||
|
||||
// Allocate Context Memory
|
||||
@@ -1846,7 +1846,7 @@ static int sceNetAdhocMatchingCreate(int mode, int maxnum, int port, int rxbufle
|
||||
}
|
||||
|
||||
// Out of Memory
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NO_SPACE, "adhoc matching no space");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NO_SPACE, "adhoc matching no space");
|
||||
}
|
||||
|
||||
int NetAdhocMatching_Start(int matchingId, int evthPri, int evthPartitionId, int evthStack, int inthPri, int inthPartitionId, int inthStack, int optLen, u32 optDataAddr) {
|
||||
@@ -1856,7 +1856,7 @@ int NetAdhocMatching_Start(int matchingId, int evthPri, int evthPartitionId, int
|
||||
SceNetAdhocMatchingContext* item = findMatchingContext(matchingId);
|
||||
|
||||
if (item == NULL) {
|
||||
// return ERROR_NET_ADHOC_MATCHING_INVALID_ID; //Faking success to prevent GTA:VCS from stuck unable to choose host/join menu
|
||||
// return SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID; //Faking success to prevent GTA:VCS from stuck unable to choose host/join menu
|
||||
return hleLogDebug(Log::sceNet, 0);
|
||||
}
|
||||
|
||||
@@ -1870,15 +1870,15 @@ int NetAdhocMatching_Start(int matchingId, int evthPri, int evthPartitionId, int
|
||||
item->hellolen = optLen;
|
||||
item->helloAddr = optDataAddr;
|
||||
}
|
||||
//else return ERROR_NET_ADHOC_MATCHING_NO_SPACE; //Faking success to prevent GTA:VCS from stuck unable to choose host/join menu
|
||||
//else return SCE_NET_ADHOC_MATCHING_ERROR_NO_SPACE; //Faking success to prevent GTA:VCS from stuck unable to choose host/join menu
|
||||
}
|
||||
//else return ERROR_NET_ADHOC_MATCHING_INVALID_ARG; // ERROR_NET_ADHOC_MATCHING_INVALID_OPTLEN; // Returning Not Success will cause GTA:VC stuck unable to choose host/join menu
|
||||
//else return SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG; // SCE_NET_ADHOC_MATCHING_ERROR_INVALID_OPTLEN; // Returning Not Success will cause GTA:VC stuck unable to choose host/join menu
|
||||
|
||||
// Create PDP Socket
|
||||
int sock = hleCall(sceNetAdhoc, int, sceNetAdhocPdpCreate, (const char*)&item->mac, static_cast<int>(item->port), item->rxbuflen, 0);
|
||||
item->socket = sock;
|
||||
if (sock < 1) {
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_PORT_IN_USE, "adhoc matching port in use");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_PORT_IN_USE, "adhoc matching port in use");
|
||||
}
|
||||
|
||||
// Create & Start the Fake PSP Thread ("matching_ev%d" and "matching_io%d")
|
||||
@@ -1944,12 +1944,12 @@ static int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddres
|
||||
|
||||
if (!netAdhocMatchingInited) {
|
||||
// Uninitialized Library
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
}
|
||||
|
||||
if (macAddress == NULL) {
|
||||
// Invalid Arguments
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "adhocmatching invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "adhocmatching invalid arg");
|
||||
}
|
||||
|
||||
SceNetEtherAddr * target = (SceNetEtherAddr *)macAddress;
|
||||
@@ -1959,12 +1959,12 @@ static int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddres
|
||||
|
||||
if (context == NULL) {
|
||||
// Invalid Matching ID
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ID, "adhocmatching invalid id");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID, "adhocmatching invalid id");
|
||||
}
|
||||
|
||||
if (!context->running) {
|
||||
// Idle Context
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_RUNNING, "adhocmatching not running");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING, "adhocmatching not running");
|
||||
}
|
||||
|
||||
// Search Result
|
||||
@@ -1972,12 +1972,12 @@ static int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddres
|
||||
|
||||
if (peer == NULL) {
|
||||
// Peer not found
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
}
|
||||
|
||||
if ((optLen != 0) && (optLen <= 0 || optDataPtr == 0)) {
|
||||
// Invalid Optional Data Length
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_OPTLEN, "adhocmatching invalid optlen");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_OPTLEN, "adhocmatching invalid optlen");
|
||||
}
|
||||
|
||||
void * opt = NULL;
|
||||
@@ -1985,10 +1985,10 @@ static int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddres
|
||||
// Host Mode
|
||||
if (context->mode == PSP_ADHOC_MATCHING_MODE_PARENT) {
|
||||
// Already Connected
|
||||
if (peer->state == PSP_ADHOC_MATCHING_PEER_CHILD) return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_ALREADY_ESTABLISHED, "adhocmatching already established");
|
||||
if (peer->state == PSP_ADHOC_MATCHING_PEER_CHILD) return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_ESTABLISHED, "adhocmatching already established");
|
||||
|
||||
// Not enough space
|
||||
if (countChildren(context) == (context->maxpeers - 1)) return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_EXCEED_MAXNUM, "adhocmatching exceed maxnum");
|
||||
if (countChildren(context) == (context->maxpeers - 1)) return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_EXCEED_MAXNUM, "adhocmatching exceed maxnum");
|
||||
|
||||
// Requesting Peer
|
||||
if (peer->state == PSP_ADHOC_MATCHING_PEER_INCOMING_REQUEST) {
|
||||
@@ -2014,10 +2014,10 @@ static int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddres
|
||||
// Client Mode
|
||||
else if (context->mode == PSP_ADHOC_MATCHING_MODE_CHILD) {
|
||||
// Already connected
|
||||
if (findParent(context) != NULL) return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_ALREADY_ESTABLISHED, "adhocmatching already established");
|
||||
if (findParent(context) != NULL) return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_ESTABLISHED, "adhocmatching already established");
|
||||
|
||||
// Outgoing Request in Progress
|
||||
if (findOutgoingRequest(context) != NULL) return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_REQUEST_IN_PROGRESS, "adhocmatching request in progress");
|
||||
if (findOutgoingRequest(context) != NULL) return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_REQUEST_IN_PROGRESS, "adhocmatching request in progress");
|
||||
|
||||
// Valid Offer
|
||||
if (peer->state == PSP_ADHOC_MATCHING_PEER_OFFER) {
|
||||
@@ -2035,10 +2035,10 @@ static int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddres
|
||||
// P2P Mode
|
||||
else {
|
||||
// Already connected
|
||||
if (findP2P(context) != NULL) return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_ALREADY_ESTABLISHED, "adhocmatching already established");
|
||||
if (findP2P(context) != NULL) return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_ALREADY_ESTABLISHED, "adhocmatching already established");
|
||||
|
||||
// Outgoing Request in Progress
|
||||
if (findOutgoingRequest(context) != NULL) return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_REQUEST_IN_PROGRESS, "adhocmatching request in progress");
|
||||
if (findOutgoingRequest(context) != NULL) return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_REQUEST_IN_PROGRESS, "adhocmatching request in progress");
|
||||
|
||||
// Join Request Mode
|
||||
if (peer->state == PSP_ADHOC_MATCHING_PEER_OFFER) {
|
||||
@@ -2068,13 +2068,13 @@ static int sceNetAdhocMatchingSelectTarget(int matchingId, const char *macAddres
|
||||
}
|
||||
|
||||
// How did this happen?! It shouldn't!
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_TARGET_NOT_READY, "adhocmatching target not ready");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_TARGET_NOT_READY, "adhocmatching target not ready");
|
||||
}
|
||||
|
||||
int NetAdhocMatching_CancelTargetWithOpt(int matchingId, const char* macAddress, int optLen, u32 optDataPtr) {
|
||||
if (!netAdhocMatchingInited) {
|
||||
// Uninitialized Library
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
}
|
||||
|
||||
SceNetEtherAddr* target = (SceNetEtherAddr*)macAddress;
|
||||
@@ -2083,7 +2083,7 @@ int NetAdhocMatching_CancelTargetWithOpt(int matchingId, const char* macAddress,
|
||||
|
||||
if (target == NULL || ((optLen != 0) && (optLen <= 0 || opt == NULL))) {
|
||||
// Invalid Arguments
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "adhocmatching invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "adhocmatching invalid arg");
|
||||
}
|
||||
|
||||
// Find Matching Context
|
||||
@@ -2091,12 +2091,12 @@ int NetAdhocMatching_CancelTargetWithOpt(int matchingId, const char* macAddress,
|
||||
|
||||
if (context == NULL) {
|
||||
// Invalid Matching ID
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ID, "adhocmatching invalid id");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID, "adhocmatching invalid id");
|
||||
}
|
||||
|
||||
if (!context->running) {
|
||||
// Context not running
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_RUNNING, "adhocmatching not running");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING, "adhocmatching not running");
|
||||
}
|
||||
|
||||
// Find Peer
|
||||
@@ -2104,7 +2104,7 @@ int NetAdhocMatching_CancelTargetWithOpt(int matchingId, const char* macAddress,
|
||||
|
||||
if (peer == NULL) {
|
||||
// Peer not found
|
||||
//return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
//return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
// Faking success to prevent the game (ie. Soul Calibur) to repeatedly calling this function when the other player is disconnected
|
||||
return hleLogDebug(Log::sceNet, 0);
|
||||
}
|
||||
@@ -2138,7 +2138,7 @@ int NetAdhocMatching_CancelTargetWithOpt(int matchingId, const char* macAddress,
|
||||
}
|
||||
|
||||
// Peer not found
|
||||
//return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
//return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
// Faking success to prevent the game (ie. Soul Calibur) to repeatedly calling this function when the other player is disconnected
|
||||
return hleLogDebug(Log::sceNet, 0);
|
||||
}
|
||||
@@ -2165,7 +2165,7 @@ int sceNetAdhocMatchingGetHelloOpt(int matchingId, u32 optLenAddr, u32 optDataAd
|
||||
}
|
||||
|
||||
if (!Memory::IsValidAddress(optLenAddr)) {
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG);
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG);
|
||||
}
|
||||
|
||||
s32_le *optlen = PSPPointer<s32_le>::Create(optLenAddr);
|
||||
@@ -2182,9 +2182,9 @@ int sceNetAdhocMatchingGetHelloOpt(int matchingId, u32 optLenAddr, u32 optDataAd
|
||||
uint8_t * optdata = Memory::GetPointerWriteUnchecked(optDataAddr);
|
||||
memcpy(optdata, item->hello, *optlen);
|
||||
}
|
||||
//else return ERROR_NET_ADHOC_MATCHING_INVALID_ARG;
|
||||
//else return SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG;
|
||||
}
|
||||
//else return ERROR_NET_ADHOC_MATCHING_INVALID_ID;
|
||||
//else return SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID;
|
||||
|
||||
// Multithreading Unlock
|
||||
peerlock.unlock();
|
||||
@@ -2198,7 +2198,7 @@ int sceNetAdhocMatchingSetHelloOpt(int matchingId, int optLenAddr, u32 optDataAd
|
||||
}
|
||||
|
||||
if (!netAdhocMatchingInited)
|
||||
return hleLogDebug(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
return hleLogDebug(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
|
||||
// Multithreading Lock
|
||||
peerlock.lock();
|
||||
@@ -2210,19 +2210,19 @@ int sceNetAdhocMatchingSetHelloOpt(int matchingId, int optLenAddr, u32 optDataAd
|
||||
|
||||
// Context not found
|
||||
if (context == NULL)
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ID, "adhocmatching invalid id");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID, "adhocmatching invalid id");
|
||||
|
||||
// Invalid Matching Mode (Child)
|
||||
if (context->mode == PSP_ADHOC_MATCHING_MODE_CHILD)
|
||||
return hleLogDebug(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_MODE, "adhocmatching invalid mode");
|
||||
return hleLogDebug(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_MODE, "adhocmatching invalid mode");
|
||||
|
||||
// Context not running
|
||||
if (!context->running)
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_RUNNING, "adhocmatching not running");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING, "adhocmatching not running");
|
||||
|
||||
// Invalid Optional Data Length
|
||||
if ((optLenAddr != 0) && (optDataAddr == 0))
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_OPTLEN, "adhocmatching invalid optlen"); //ERROR_NET_ADHOC_MATCHING_INVALID_ARG
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_OPTLEN, "adhocmatching invalid optlen"); //SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG
|
||||
|
||||
// Grab Existing Hello Data
|
||||
void* hello = context->hello;
|
||||
@@ -2240,7 +2240,7 @@ int sceNetAdhocMatchingSetHelloOpt(int matchingId, int optLenAddr, u32 optDataAd
|
||||
// Out of Memory
|
||||
if (hello == NULL) {
|
||||
context->hellolen = 0;
|
||||
return ERROR_NET_ADHOC_MATCHING_NO_SPACE;
|
||||
return SCE_NET_ADHOC_MATCHING_ERROR_NO_SPACE;
|
||||
}
|
||||
|
||||
// Clone Hello Data
|
||||
@@ -2270,11 +2270,11 @@ static int sceNetAdhocMatchingGetMembers(int matchingId, u32 sizeAddr, u32 buf)
|
||||
}
|
||||
|
||||
if (!netAdhocMatchingInited)
|
||||
return hleLogDebug(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
return hleLogDebug(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
|
||||
// Minimum Argument
|
||||
if (!Memory::IsValidAddress(sizeAddr))
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "adhocmatching invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "adhocmatching invalid arg");
|
||||
|
||||
// Multithreading Lock
|
||||
peerlock.lock();
|
||||
@@ -2285,15 +2285,15 @@ static int sceNetAdhocMatchingGetMembers(int matchingId, u32 sizeAddr, u32 buf)
|
||||
|
||||
// Context not found
|
||||
if (context == NULL)
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ID, "adhocmatching invalid id");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID, "adhocmatching invalid id");
|
||||
|
||||
// Context not running
|
||||
if (!context->running)
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_RUNNING, "adhocmatching not running");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING, "adhocmatching not running");
|
||||
|
||||
// Buffer Length not available
|
||||
if (!Memory::IsValidAddress(sizeAddr))
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "adhocmatching invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "adhocmatching invalid arg");
|
||||
|
||||
int* buflen = (int*)Memory::GetPointer(sizeAddr);
|
||||
SceNetAdhocMatchingMemberInfoEmu* buf2 = NULL;
|
||||
@@ -2466,12 +2466,12 @@ int sceNetAdhocMatchingSendData(int matchingId, const char *mac, int dataLen, u3
|
||||
|
||||
if (!netAdhocMatchingInited) {
|
||||
// Uninitialized Library
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "not initialized");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "not initialized");
|
||||
}
|
||||
|
||||
if (mac == NULL) {
|
||||
// Invalid Arguments
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "invalid arg");
|
||||
}
|
||||
|
||||
// Find Matching Context
|
||||
@@ -2479,18 +2479,18 @@ int sceNetAdhocMatchingSendData(int matchingId, const char *mac, int dataLen, u3
|
||||
|
||||
if (context == NULL) {
|
||||
// Invalid Matching ID
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ID, "invalid id");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID, "invalid id");
|
||||
}
|
||||
|
||||
if (!context->running) {
|
||||
// Context not running
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_RUNNING, "not running");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING, "not running");
|
||||
}
|
||||
|
||||
// Invalid Data Length
|
||||
if (dataLen <= 0 || dataAddr == 0) {
|
||||
// Invalid Data Length
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_DATALEN, "invalid datalen");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_DATALEN, "invalid datalen");
|
||||
}
|
||||
|
||||
void* data = NULL;
|
||||
@@ -2504,17 +2504,17 @@ int sceNetAdhocMatchingSendData(int matchingId, const char *mac, int dataLen, u3
|
||||
|
||||
if (peer == NULL) {
|
||||
// Peer not found
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_UNKNOWN_TARGET, "unknown target");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET, "unknown target");
|
||||
}
|
||||
|
||||
if (peer->state != PSP_ADHOC_MATCHING_PEER_PARENT && peer->state != PSP_ADHOC_MATCHING_PEER_CHILD && peer->state != PSP_ADHOC_MATCHING_PEER_P2P) {
|
||||
// Not connected / accepted
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_ESTABLISHED, "not established");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_ESTABLISHED, "not established");
|
||||
}
|
||||
|
||||
// Send in Progress
|
||||
if (peer->sending)
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_DATA_BUSY, "data busy");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_DATA_BUSY, "data busy");
|
||||
|
||||
// Mark Peer as Sending
|
||||
peer->sending = 1;
|
||||
@@ -2534,12 +2534,12 @@ int sceNetAdhocMatchingAbortSendData(int matchingId, const char *mac) {
|
||||
|
||||
if (!netAdhocMatchingInited) {
|
||||
// Uninitialized Library
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
}
|
||||
|
||||
if (mac == NULL) {
|
||||
// Invalid Arguments
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "adhocmatching invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "adhocmatching invalid arg");
|
||||
}
|
||||
|
||||
// Find Matching Context
|
||||
@@ -2547,12 +2547,12 @@ int sceNetAdhocMatchingAbortSendData(int matchingId, const char *mac) {
|
||||
|
||||
if (context == NULL) {
|
||||
// Invalid Matching ID
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ID, "adhocmatching invalid id");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ID, "adhocmatching invalid id");
|
||||
}
|
||||
|
||||
if (!context->running) {
|
||||
// Context not running
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_RUNNING, "adhocmatching not running");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_RUNNING, "adhocmatching not running");
|
||||
}
|
||||
|
||||
// Find Target Peer
|
||||
@@ -2560,7 +2560,7 @@ int sceNetAdhocMatchingAbortSendData(int matchingId, const char *mac) {
|
||||
|
||||
if (peer == NULL) {
|
||||
// Peer not found
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_UNKNOWN_TARGET, "adhocmatching unknown target");
|
||||
}
|
||||
|
||||
// Peer is sending
|
||||
@@ -2593,7 +2593,7 @@ int sceNetAdhocMatchingGetPoolStat(u32 poolstatPtr) {
|
||||
|
||||
if (!netAdhocMatchingInited) {
|
||||
// Uninitialized Library
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_NOT_INITIALIZED, "adhocmatching not initialized");
|
||||
}
|
||||
|
||||
SceNetMallocStat * poolstat = NULL;
|
||||
@@ -2601,7 +2601,7 @@ int sceNetAdhocMatchingGetPoolStat(u32 poolstatPtr) {
|
||||
|
||||
if (poolstat == NULL) {
|
||||
// Invalid Argument
|
||||
return hleLogError(Log::sceNet, ERROR_NET_ADHOC_MATCHING_INVALID_ARG, "adhocmatching invalid arg");
|
||||
return hleLogError(Log::sceNet, SCE_NET_ADHOC_MATCHING_ERROR_INVALID_ARG, "adhocmatching invalid arg");
|
||||
}
|
||||
|
||||
// Fill Poolstat with Fake Data
|
||||
|
||||
Reference in new issue
Block a user