Add sceNp2 and some sceNpMatching2 functions

This commit is contained in:
Raul Tambre 2015-07-14 15:07:23 +03:00
parent ddcaf4972f
commit 80b544aa78
7 changed files with 332 additions and 43 deletions

View File

@ -46,6 +46,7 @@ extern Module cellVoice;
extern Module cellVpost;
extern Module libmixer;
extern Module sceNp;
extern Module sceNp2;
extern Module sceNpClans;
extern Module sceNpCommerce2;
extern Module sceNpSns;
@ -117,7 +118,7 @@ static const g_module_list[] =
{ 0x0035, "cellSysutilRec", nullptr },
{ 0x0036, "cellVideoExport", nullptr },
{ 0x0037, "cellGameExec", nullptr },
{ 0x0038, "sceNp2", nullptr },
{ 0x0038, "sceNp2", &sceNp2 },
{ 0x0039, "cellSysutilAp", &cellSysutilAp },
{ 0x003a, "cellSysutilNpClans", nullptr },
{ 0x003b, "cellSysutilOskExt", nullptr },

View File

@ -625,7 +625,6 @@ never_inline s32 savedata_op(
// Write PARAM.SFO
if (psf)
{
cellSysutil.Error("psf: true");
vfsFile f(sfo_path, vfsWriteNew);
psf.Save(f);
}

View File

@ -15,14 +15,12 @@ extern Module sceNp;
struct sceNpInternal
{
bool m_bSceNpInitialized;
bool m_bSceNp2Initialized;
bool m_bScoreInitialized;
bool m_bLookupInitialized;
bool m_bSceNpUtilBandwidthTestInitialized;
sceNpInternal()
: m_bSceNpInitialized(false),
m_bSceNp2Initialized(false),
m_bScoreInitialized(false),
m_bLookupInitialized(false),
m_bSceNpUtilBandwidthTestInitialized(false)
@ -32,54 +30,53 @@ struct sceNpInternal
sceNpInternal sceNpInstance;
s32 sceNpInit(u32 mem_size, u32 mem_addr)
s32 sceNpInit(u32 poolsize, vm::ptr<u32> poolptr)
{
sceNp.Warning("sceNpInit(mem_size=0x%x, mem_addr=0x%x)", mem_size, mem_addr);
sceNp.Warning("sceNpInit(poolsize=%d, poolptr=0x%x)", poolsize, poolptr);
if (sceNpInstance.m_bSceNpInitialized)
{
sceNp.Error("sceNpInit(): sceNp has been already initialized.");
return SCE_NP_ERROR_ALREADY_INITIALIZED;
}
if (poolsize == 0)
{
sceNp.Error("sceNpInit(): poolsize given is 0.");
return SCE_NP_ERROR_INVALID_ARGUMENT;
}
else if (poolsize < 128 * 1024)
{
sceNp.Error("sceNp2Init(): poolsize given is under 131072 bytes.");
return SCE_NP_ERROR_INSUFFICIENT_BUFFER;
}
if (!poolptr)
{
sceNp.Error("sceNpInit(): poolptr is invalid.");
return SCE_NP_ERROR_INVALID_ARGUMENT;
}
sceNpInstance.m_bSceNpInitialized = true;
return CELL_OK;
}
s32 sceNp2Init(u32 mem_size, u32 mem_addr)
{
sceNp.Warning("sceNp2Init(mem_size=0x%x, mem_addr=0x%x)", mem_size, mem_addr);
if (sceNpInstance.m_bSceNp2Initialized)
return SCE_NP_ERROR_ALREADY_INITIALIZED;
sceNpInstance.m_bSceNp2Initialized = true;
return CELL_OK;
}
s32 sceNpTerm()
{
sceNp.Warning("sceNpTerm()");
if (!sceNpInstance.m_bSceNpInitialized)
{
sceNp.Error("sceNpTerm(): sceNp has not been intialized.");
return SCE_NP_ERROR_NOT_INITIALIZED;
}
sceNpInstance.m_bSceNpInitialized = false;
return CELL_OK;
}
s32 sceNp2Term()
{
sceNp.Warning("sceNp2Term()");
if (!sceNpInstance.m_bSceNp2Initialized)
return SCE_NP_ERROR_NOT_INITIALIZED;
sceNpInstance.m_bSceNp2Initialized = false;
return CELL_OK;
}
s32 npDrmIsAvailable(u32 k_licensee_addr, vm::cptr<char> drm_path)
{
if (!Emu.GetVFS().ExistsFile(drm_path.get_ptr()))
@ -1625,16 +1622,13 @@ s32 _sceNpSysutilClientFree()
Module sceNp("sceNp", []()
{
sceNpInstance.m_bSceNpInitialized = false;
sceNpInstance.m_bSceNp2Initialized = false;
sceNpInstance.m_bScoreInitialized = false;
sceNpInstance.m_bLookupInitialized = false;
sceNpInstance.m_bSceNpUtilBandwidthTestInitialized = false;
REG_FUNC(sceNp, sceNpInit);
REG_FUNC(sceNp, sceNp2Init);
REG_FUNC(sceNp, sceNpUtilBandwidthTestInitStart);
REG_FUNC(sceNp, sceNpTerm);
REG_FUNC(sceNp, sceNp2Term);
REG_FUNC(sceNp, sceNpUtilBandwidthTestShutdown);
REG_FUNC(sceNp, sceNpDrmIsAvailable);
REG_FUNC(sceNp, sceNpDrmIsAvailable2);

View File

@ -31,6 +31,7 @@ enum
SCE_NP_ERROR_ALREADY_USED = 0x8002aa15,
SCE_NP_ERROR_DIFFERENT_USER = 0x8002aa16,
SCE_NP_ERROR_ALREADY_DONE = 0x8002aa17,
// NP Basic Utility
SCE_NP_BASIC_ERROR_ALREADY_INITIALIZED = 0x8002a661,
SCE_NP_BASIC_ERROR_NOT_INITIALIZED = 0x8002a662,
@ -65,6 +66,7 @@ enum
SCE_NP_EXT_ERROR_CONTEXT_ALREADY_EXISTS = 0x8002a6a2,
SCE_NP_EXT_ERROR_NO_CONTEXT = 0x8002a6a3,
SCE_NP_EXT_ERROR_NO_ORIGIN = 0x8002a6a4,
// NP Community Utility
SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED = 0x8002a101,
SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED = 0x8002a102,
@ -97,6 +99,122 @@ enum
SCE_NP_COMMUNITY_ERROR_TOO_LARGE_RANGE = 0x8002a1ae,
SCE_NP_COMMUNITY_ERROR_INVALID_PARTITION = 0x8002a1af,
SCE_NP_COMMUNITY_ERROR_TOO_MANY_SLOTID = 0x8002a1b1,
// NP Matching 2 Utility
SCE_NP_MATCHING2_ERROR_OUT_OF_MEMORY = 0x80022301,
SCE_NP_MATCHING2_ERROR_ALREADY_INITIALIZED = 0x80022302,
SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED = 0x80022303,
SCE_NP_MATCHING2_ERROR_CONTEXT_MAX = 0x80022304,
SCE_NP_MATCHING2_ERROR_CONTEXT_ALREADY_EXISTS = 0x80022305,
SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_FOUND = 0x80022306,
SCE_NP_MATCHING2_ERROR_CONTEXT_ALREADY_STARTED = 0x80022307,
SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED = 0x80022308,
SCE_NP_MATCHING2_ERROR_SERVER_NOT_FOUND = 0x80022309,
SCE_NP_MATCHING2_ERROR_INVALID_ARGUMENT = 0x8002230a,
SCE_NP_MATCHING2_ERROR_INVALID_CONTEXT_ID = 0x8002230b,
SCE_NP_MATCHING2_ERROR_INVALID_SERVER_ID = 0x8002230c,
SCE_NP_MATCHING2_ERROR_INVALID_WORLD_ID = 0x8002230d,
SCE_NP_MATCHING2_ERROR_INVALID_LOBBY_ID = 0x8002230e,
SCE_NP_MATCHING2_ERROR_INVALID_ROOM_ID = 0x8002230f,
SCE_NP_MATCHING2_ERROR_INVALID_MEMBER_ID = 0x80022310,
SCE_NP_MATCHING2_ERROR_INVALID_ATTRIBUTE_ID = 0x80022311,
SCE_NP_MATCHING2_ERROR_INVALID_CASTTYPE = 0x80022312,
SCE_NP_MATCHING2_ERROR_INVALID_SORT_METHOD = 0x80022313,
SCE_NP_MATCHING2_ERROR_INVALID_MAX_SLOT = 0x80022314,
SCE_NP_MATCHING2_ERROR_INVALID_MATCHING_SPACE = 0x80022316,
SCE_NP_MATCHING2_ERROR_INVALID_BLOCK_KICK_FLAG = 0x80022318,
SCE_NP_MATCHING2_ERROR_INVALID_MESSAGE_TARGET = 0x80022319,
SCE_NP_MATCHING2_ERROR_RANGE_FILTER_MAX = 0x8002231a,
SCE_NP_MATCHING2_ERROR_INSUFFICIENT_BUFFER = 0x8002231b,
SCE_NP_MATCHING2_ERROR_DESTINATION_DISAPPEARED = 0x8002231c,
SCE_NP_MATCHING2_ERROR_REQUEST_TIMEOUT = 0x8002231d,
SCE_NP_MATCHING2_ERROR_INVALID_ALIGNMENT = 0x8002231e,
SCE_NP_MATCHING2_ERROR_REQUEST_CB_QUEUE_OVERFLOW = 0x8002231f,
SCE_NP_MATCHING2_ERROR_EVENT_CB_QUEUE_OVERFLOW = 0x80022320,
SCE_NP_MATCHING2_ERROR_MSG_CB_QUEUE_OVERFLOW = 0x80022321,
SCE_NP_MATCHING2_ERROR_CONNECTION_CLOSED_BY_SERVER = 0x80022322,
SCE_NP_MATCHING2_ERROR_SSL_VERIFY_FAILED = 0x80022323,
SCE_NP_MATCHING2_ERROR_SSL_HANDSHAKE = 0x80022324,
SCE_NP_MATCHING2_ERROR_SSL_SEND = 0x80022325,
SCE_NP_MATCHING2_ERROR_SSL_RECV = 0x80022326,
SCE_NP_MATCHING2_ERROR_JOINED_SESSION_MAX = 0x80022327,
SCE_NP_MATCHING2_ERROR_ALREADY_JOINED = 0x80022328,
SCE_NP_MATCHING2_ERROR_INVALID_SESSION_TYPE = 0x80022329,
SCE_NP_MATCHING2_ERROR_CLAN_LOBBY_NOT_EXIST = 0x8002232a,
SCE_NP_MATCHING2_ERROR_NP_SIGNED_OUT = 0x8002232b,
SCE_NP_MATCHING2_ERROR_CONTEXT_UNAVAILABLE = 0x8002232c,
SCE_NP_MATCHING2_ERROR_SERVER_NOT_AVAILABLE = 0x8002232d,
SCE_NP_MATCHING2_ERROR_NOT_ALLOWED = 0x8002232e,
SCE_NP_MATCHING2_ERROR_ABORTED = 0x8002232f,
SCE_NP_MATCHING2_ERROR_REQUEST_NOT_FOUND = 0x80022330,
SCE_NP_MATCHING2_ERROR_SESSION_DESTROYED = 0x80022331,
SCE_NP_MATCHING2_ERROR_CONTEXT_STOPPED = 0x80022332,
SCE_NP_MATCHING2_ERROR_INVALID_REQUEST_PARAMETER = 0x80022333,
SCE_NP_MATCHING2_ERROR_NOT_NP_SIGN_IN = 0x80022334,
SCE_NP_MATCHING2_ERROR_ROOM_NOT_FOUND = 0x80022335,
SCE_NP_MATCHING2_ERROR_ROOM_MEMBER_NOT_FOUND = 0x80022336,
SCE_NP_MATCHING2_ERROR_LOBBY_NOT_FOUND = 0x80022337,
SCE_NP_MATCHING2_ERROR_LOBBY_MEMBER_NOT_FOUND = 0x80022338,
SCE_NP_MATCHING2_ERROR_EVENT_DATA_NOT_FOUND = 0x80022339,
SCE_NP_MATCHING2_ERROR_KEEPALIVE_TIMEOUT = 0x8002233a,
SCE_NP_MATCHING2_ERROR_TIMEOUT_TOO_SHORT = 0x8002233b,
SCE_NP_MATCHING2_ERROR_TIMEDOUT = 0x8002233c,
SCE_NP_MATCHING2_ERROR_CREATE_HEAP = 0x8002233d,
SCE_NP_MATCHING2_ERROR_INVALID_ATTRIBUTE_SIZE = 0x8002233e,
SCE_NP_MATCHING2_ERROR_CANNOT_ABORT = 0x8002233f,
SCE_NP_MATCHING2_RESOLVER_ERROR_NO_DNS_SERVER = 0x800223a2,
SCE_NP_MATCHING2_RESOLVER_ERROR_INVALID_PACKET = 0x800223ad,
SCE_NP_MATCHING2_RESOLVER_ERROR_TIMEOUT = 0x800223b0,
SCE_NP_MATCHING2_RESOLVER_ERROR_NO_RECORD = 0x800223b1,
SCE_NP_MATCHING2_RESOLVER_ERROR_RES_PACKET_FORMAT = 0x800223b2,
SCE_NP_MATCHING2_RESOLVER_ERROR_RES_SERVER_FAILURE = 0x800223b3,
SCE_NP_MATCHING2_RESOLVER_ERROR_NO_HOST = 0x800223b4,
SCE_NP_MATCHING2_RESOLVER_ERROR_RES_NOT_IMPLEMENTED = 0x800223b5,
SCE_NP_MATCHING2_RESOLVER_ERROR_RES_SERVER_REFUSED = 0x800223b6,
SCE_NP_MATCHING2_RESOLVER_ERROR_RESP_TRUNCATED = 0x800223bc,
SCE_NP_MATCHING2_SERVER_ERROR_BAD_REQUEST = 0x80022b01,
SCE_NP_MATCHING2_SERVER_ERROR_SERVICE_UNAVAILABLE = 0x80022b02,
SCE_NP_MATCHING2_SERVER_ERROR_BUSY = 0x80022b03,
SCE_NP_MATCHING2_SERVER_ERROR_END_OF_SERVICE = 0x80022b04,
SCE_NP_MATCHING2_SERVER_ERROR_INTERNAL_SERVER_ERROR = 0x80022b05,
SCE_NP_MATCHING2_SERVER_ERROR_PLAYER_BANNED = 0x80022b06,
SCE_NP_MATCHING2_SERVER_ERROR_FORBIDDEN = 0x80022b07,
SCE_NP_MATCHING2_SERVER_ERROR_BLOCKED = 0x80022b08,
SCE_NP_MATCHING2_SERVER_ERROR_UNSUPPORTED_NP_ENV = 0x80022b09,
SCE_NP_MATCHING2_SERVER_ERROR_INVALID_TICKET = 0x80022b0a,
SCE_NP_MATCHING2_SERVER_ERROR_INVALID_SIGNATURE = 0x80022b0b,
SCE_NP_MATCHING2_SERVER_ERROR_EXPIRED_TICKET = 0x80022b0c,
SCE_NP_MATCHING2_SERVER_ERROR_ENTITLEMENT_REQUIRED = 0x80022b0d,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_CONTEXT = 0x80022b0e,
SCE_NP_MATCHING2_SERVER_ERROR_CLOSED = 0x80022b0f,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_TITLE = 0x80022b10,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_WORLD = 0x80022b11,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_LOBBY = 0x80022b12,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_ROOM = 0x80022b13,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_LOBBY_INSTANCE = 0x80022b14,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_ROOM_INSTANCE = 0x80022b15,
SCE_NP_MATCHING2_SERVER_ERROR_PASSWORD_MISMATCH = 0x80022b17,
SCE_NP_MATCHING2_SERVER_ERROR_LOBBY_FULL = 0x80022b18,
SCE_NP_MATCHING2_SERVER_ERROR_ROOM_FULL = 0x80022b19,
SCE_NP_MATCHING2_SERVER_ERROR_GROUP_FULL = 0x80022b1b,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_USER = 0x80022b1c,
SCE_NP_MATCHING2_SERVER_ERROR_TITLE_PASSPHRASE_MISMATCH = 0x80022b1e,
SCE_NP_MATCHING2_SERVER_ERROR_DUPLICATE_LOBBY = 0x80022b25,
SCE_NP_MATCHING2_SERVER_ERROR_DUPLICATE_ROOM = 0x80022b26,
SCE_NP_MATCHING2_SERVER_ERROR_NO_JOIN_GROUP_LABEL = 0x80022b29,
SCE_NP_MATCHING2_SERVER_ERROR_NO_SUCH_GROUP = 0x80022b2a,
SCE_NP_MATCHING2_SERVER_ERROR_NO_PASSWORD = 0x80022b2b,
SCE_NP_MATCHING2_SERVER_ERROR_MAX_OVER_SLOT_GROUP = 0x80022b2c,
SCE_NP_MATCHING2_SERVER_ERROR_MAX_OVER_PASSWORD_MASK = 0x80022b2d,
SCE_NP_MATCHING2_SERVER_ERROR_DUPLICATE_GROUP_LABEL = 0x80022b2e,
SCE_NP_MATCHING2_SERVER_ERROR_REQUEST_OVERFLOW = 0x80022b2f,
SCE_NP_MATCHING2_SERVER_ERROR_ALREADY_JOINED = 0x80022b30,
SCE_NP_MATCHING2_SERVER_ERROR_NAT_TYPE_MISMATCH = 0x80022b31,
SCE_NP_MATCHING2_SERVER_ERROR_ROOM_INCONSISTENCY = 0x80022b32,
// SCE_NP_MATCHING2_NET_ERRNO_BASE = 0x800224XX,
// SCE_NP_MATCHING2_NET_H_ERRNO_BASE = 0x800225XX,
};
using SceNpBasicEventHandler = func_def<s32(s32 event, s32 retCode, u32 reqId, vm::ptr<void> arg)>;
@ -874,8 +992,7 @@ typedef void(SceNpManagerCallback)(s32 event, s32 result, u32 arg_addr);
// Request callback function
typedef void(*SceNpMatching2RequestCallback)(u16 ctxId, u32 reqId, u16 event,
u32 eventKey, s32 errorCode, u32 dataSize, u32 *arg
);
u32 eventKey, s32 errorCode, u32 dataSize, u32 *arg);
// NOTE: Use SceNpCommunicationPassphrase instead
// Np communication passphrase
@ -1237,7 +1354,7 @@ struct SceNpMatching2SignalingOptParam
u8 type;
u8 reserved1[1];
be_t<u16> hubMemberId;
//u8 reserved2[4];
u8 reserved2[4];
};
// Option parameters for requests
@ -1698,7 +1815,7 @@ struct SceNpMatching2GetLobbyMemberDataInternalListResponse
struct SceNpMatching2SignalingGetPingInfoRequest
{
be_t<u64> roomId;
//u8 reserved[16];
u8 reserved[16];
};
// Response data for obtaining Ping information
@ -1709,7 +1826,7 @@ struct SceNpMatching2SignalingGetPingInfoResponse
be_t<u32> worldId;
be_t<u64> roomId;
be_t<u32> rtt;
//u8 reserved[20];
u8 reserved[20];
};
// Join request parameters for room in prohibitive mode
@ -1852,7 +1969,7 @@ struct SceNpMatching2UtilityInitParam
be_t<u32> requestCbQueueLen;
be_t<u32> sessionEventCbQueueLen;;
be_t<u32> sessionMsgCbQueueLen;;
//u8 reserved[16];
u8 reserved[16];
};
// Matching2 memory information
@ -1861,7 +1978,7 @@ struct SceNpMatching2MemoryInfo
be_t<u32> totalMemSize;
be_t<u32> curMemUsage;;
be_t<u32> maxMemUsage;;
//u8 reserved[12];
u8 reserved[12];
};
// Matching2 information on the event data queues in the system
@ -1876,7 +1993,7 @@ struct SceNpMatching2CbQueueInfo
be_t<u32> sessionMsgCbQueueLen;;
be_t<u32> curSessionMsgCbQueueLen;;
be_t<u32> maxSessionMsgCbQueueLen;;
//u8 reserved[12];
u8 reserved[12];
};
// Score data unique to the application
@ -1934,7 +2051,7 @@ struct SceNpScoreNpIdPcId
{
SceNpId npId;
be_t<s32> pcId;
//u8 pad[4];
u8 pad[4];
};
// Basic clan information to be used in raking
@ -1942,7 +2059,7 @@ struct SceNpScoreClanBasicInfo
{
s8 clanName[SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH + 1];
s8 clanTag[SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH + 1];
//u8 reserved[10];
u8 reserved[10];
};
// Clan member information handled in ranking

View File

@ -0,0 +1,174 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
#include "sceNp.cpp"
extern Module sceNp2;
struct sceNp2Internal
{
bool m_bSceNp2Initialized;
bool m_bSceNp2Matching2Initialized;
bool m_bSceNp2Matching2Initialized2;
sceNp2Internal()
: m_bSceNp2Initialized(false),
m_bSceNp2Matching2Initialized(false),
m_bSceNp2Matching2Initialized2(false)
{
}
};
sceNp2Internal sceNp2Instance;
s32 sceNp2Init(u32 poolsize, vm::ptr<u32> poolptr)
{
sceNp2.Warning("sceNp2Init(poolsize=%d, poolptr=0x%x)", poolsize, poolptr);
if (sceNp2Instance.m_bSceNp2Initialized)
{
sceNp2.Error("sceNp2Init(): sceNp2 has been already initialized.");
return SCE_NP_ERROR_ALREADY_INITIALIZED;
}
if (poolsize == 0)
{
sceNp2.Error("sceNp2Init(): poolsize given is 0.");
return SCE_NP_ERROR_INVALID_ARGUMENT;
}
else if (poolsize < 128 * 1024)
{
sceNp2.Error("sceNp2Init(): poolsize given is under 131072 bytes.");
return SCE_NP_ERROR_INSUFFICIENT_BUFFER;
}
if (!poolptr)
{
sceNp2.Error("sceNp2Init(): poolptr is invalid.");
return SCE_NP_ERROR_INVALID_ARGUMENT;
}
sceNpInstance.m_bSceNpInitialized = true;
sceNp2Instance.m_bSceNp2Initialized = true;
return CELL_OK;
}
s32 sceNpMatching2Init(u32 poolsize, s32 priority)
{
sceNp2.Todo("sceNpMatching2Init(poolsize=%d, priority=%d)", poolsize, priority);
if (!sceNp2Instance.m_bSceNp2Initialized)
{
sceNp2.Error("sceNpMatching2Init(): sceNp2 has not been intialized.");
return SCE_NP_ERROR_NOT_INITIALIZED;
}
if (sceNp2Instance.m_bSceNp2Matching2Initialized)
{
sceNp2.Error("sceNpMatching2Init(): sceNpMatching2 has already been intialized.");
return SCE_NP_MATCHING2_ERROR_ALREADY_INITIALIZED;
}
sceNp2Instance.m_bSceNp2Matching2Initialized = true;
return CELL_OK;
}
s32 sceNpMatching2Init2(u32 poolsize, s32 priority, vm::ptr<SceNpMatching2UtilityInitParam> param)
{
sceNp2.Todo("sceNpMatching2Init2(poolsize=%d, priority=%d, param_addr=0x%x)", poolsize, priority, param.addr());
if (!sceNp2Instance.m_bSceNp2Initialized)
{
sceNp2.Error("sceNpMatching2Init2(): sceNp2 has not been intialized.");
return SCE_NP_ERROR_NOT_INITIALIZED;
}
if (sceNp2Instance.m_bSceNp2Matching2Initialized2)
{
sceNp2.Error("sceNpMatching2Init2(): new sceNpMatching2 has already been intialized.");
return SCE_NP_MATCHING2_ERROR_ALREADY_INITIALIZED;
}
sceNp2Instance.m_bSceNp2Matching2Initialized2 = true;
// TODO:
// 1. Create an internal thread
// 2. Create heap area to be used by the NP matching 2 utility
// 3. Set maximum lengths for the event data queues in the system
return CELL_OK;
}
s32 sceNp2Term()
{
sceNp2.Warning("sceNp2Term()");
if (!sceNp2Instance.m_bSceNp2Initialized)
{
sceNp2.Error("sceNp2Term(): sceNp2 has not been intialized.");
return SCE_NP_ERROR_NOT_INITIALIZED;
}
sceNp2Instance.m_bSceNp2Initialized = false;
return CELL_OK;
}
s32 sceNpMatching2Term(PPUThread& ppu)
{
sceNp2.Warning("sceNpMatching2Term()");
if (!sceNp2Instance.m_bSceNp2Initialized)
{
sceNp2.Error("sceNpMatching2Term(): sceNp2 has not been intialized.");
return SCE_NP_ERROR_NOT_INITIALIZED;
}
if (!sceNp2Instance.m_bSceNp2Matching2Initialized)
{
sceNp2.Error("sceNpMatching2Term(): sceNpMatching2 has not been intialized.");
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
}
sceNp2Instance.m_bSceNp2Matching2Initialized = false;
return CELL_OK;
}
s32 sceNpMatching2Term2()
{
sceNp2.Warning("sceNpMatching2Term2()");
if (!sceNp2Instance.m_bSceNp2Initialized)
{
sceNp2.Error("sceNpMatching2Term2(): sceNp2 has not been intialized.");
return SCE_NP_ERROR_NOT_INITIALIZED;
}
if (!sceNp2Instance.m_bSceNp2Matching2Initialized2)
{
sceNp2.Error("sceNpMatching2Term(): new sceNpMatching2 has not been intialized.");
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
}
sceNp2Instance.m_bSceNp2Matching2Initialized2 = false;
return CELL_OK;
}
Module sceNp2("sceNp2", []()
{
sceNp2Instance.m_bSceNp2Initialized = false;
sceNp2Instance.m_bSceNp2Matching2Initialized = false;
sceNp2Instance.m_bSceNp2Matching2Initialized2 = false;
REG_FUNC(sceNp2, sceNp2Init);
REG_FUNC(sceNp2, sceNpMatching2Init);
REG_FUNC(sceNp2, sceNpMatching2Init2);
REG_FUNC(sceNp2, sceNp2Term);
REG_FUNC(sceNp2, sceNpMatching2Term);
REG_FUNC(sceNp2, sceNpMatching2Term2);
});

View File

@ -267,6 +267,7 @@
<ClCompile Include="Emu\SysCalls\Modules\libsnd3.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\libsynth2.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\sceNp.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\sceNp2.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\sceNpClans.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\sceNpCommerce2.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\sceNpSns.cpp" />

View File

@ -269,6 +269,9 @@
<ClCompile Include="Emu\SysCalls\Modules\sceNp.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\sceNp2.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\sceNpClans.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>