mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-12 13:13:43 +00:00
stub sceNpTus
This commit is contained in:
parent
776c2ada6a
commit
caa1324457
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,7 @@
|
||||
#include "sceNp.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <map>
|
||||
|
||||
// Constants for TUS functions and structures
|
||||
enum
|
||||
@ -14,9 +15,25 @@ enum
|
||||
SCE_NP_TUS_MAX_CTX_NUM = 32,
|
||||
SCE_NP_TUS_MAX_SLOT_NUM_PER_TRANS = 64,
|
||||
SCE_NP_TUS_MAX_USER_NUM_PER_TRANS = 101,
|
||||
SCE_NP_TUS_MAX_SELECTED_FRIENDS_NUM = 100,
|
||||
};
|
||||
|
||||
SceNpOnlineId SceNpTusVirtualUserId;
|
||||
enum SceNpTssStatusCodeType
|
||||
{
|
||||
SCE_NP_TSS_STATUS_TYPE_OK,
|
||||
SCE_NP_TSS_STATUS_TYPE_PARTIAL,
|
||||
SCE_NP_TSS_STATUS_TYPE_NOT_MODIFIED
|
||||
};
|
||||
|
||||
enum SceNpTssIfType
|
||||
{
|
||||
SCE_NP_TSS_IFTYPE_IF_MODIFIED_SINCE,
|
||||
SCE_NP_TSS_IFTYPE_IF_RANGE
|
||||
};
|
||||
|
||||
using SceNpTssSlotId = s32;
|
||||
using SceNpTusSlotId = s32;
|
||||
using SceNpTusVirtualUserId = SceNpOnlineId;
|
||||
|
||||
// Structure for representing a TUS variable
|
||||
struct SceNpTusVariable
|
||||
@ -52,9 +69,84 @@ struct SceNpTusDataStatus
|
||||
SceNpTusDataInfo info;
|
||||
};
|
||||
|
||||
struct SceNpTusAddAndGetVariableOptParam
|
||||
{
|
||||
u64 size; // TODO: correct type?
|
||||
vm::ptr<CellRtcTick> isLastChangedDate;
|
||||
vm::ptr<SceNpId> isLastChangedAuthorId;
|
||||
};
|
||||
|
||||
struct SceNpTusTryAndSetVariableOptParam
|
||||
{
|
||||
u64 size; // TODO: correct type?
|
||||
vm::ptr<CellRtcTick> isLastChangedDate;
|
||||
vm::ptr<SceNpId> isLastChangedAuthorId;
|
||||
vm::ptr<s64> compareValue;
|
||||
};
|
||||
|
||||
struct SceNpTusSetDataOptParam
|
||||
{
|
||||
u64 size; // TODO: correct type?
|
||||
vm::ptr<CellRtcTick> isLastChangedDate;
|
||||
vm::ptr<SceNpId> isLastChangedAuthorId;
|
||||
};
|
||||
|
||||
struct SceNpTssDataStatus
|
||||
{
|
||||
CellRtcTick lastModified;
|
||||
s32 statusCodeType;
|
||||
u64 contentLength;
|
||||
};
|
||||
|
||||
struct SceNpTssIfModifiedSinceParam
|
||||
{
|
||||
s32 ifType;
|
||||
u8 padding[4];
|
||||
CellRtcTick lastModified;
|
||||
};
|
||||
|
||||
struct SceNpTssGetDataOptParam
|
||||
{
|
||||
u64 size; // TODO: correct type?
|
||||
vm::ptr<uint64_t> offset;
|
||||
vm::ptr<uint64_t> lastByte;
|
||||
vm::ptr<SceNpTssIfModifiedSinceParam> ifParam;
|
||||
};
|
||||
|
||||
// fxm objects
|
||||
|
||||
struct sce_np_tus_transaction_context
|
||||
{
|
||||
s32 id = 0;
|
||||
u32 timeout = 0;
|
||||
bool abort = false;
|
||||
};
|
||||
|
||||
struct sce_np_tus_title_context
|
||||
{
|
||||
std::map<s32 /*transaction_context_id*/, sce_np_tus_transaction_context> transaction_contexts;
|
||||
};
|
||||
|
||||
struct sce_np_tus_manager
|
||||
{
|
||||
private:
|
||||
s32 next_title_context_id = 1;
|
||||
s32 next_transaction_context_id = 1;
|
||||
std::map<s32 /*title_context_id*/, sce_np_tus_title_context> title_contexts;
|
||||
|
||||
public:
|
||||
std::mutex mtx;
|
||||
std::atomic<bool> is_initialized = false;
|
||||
|
||||
s32 add_title_context();
|
||||
bool check_title_context_id(s32 titleCtxId);
|
||||
bool remove_title_context_id(s32 titleCtxId);
|
||||
sce_np_tus_title_context* get_title_context(s32 titleCtxId);
|
||||
|
||||
s32 add_transaction_context(s32 titleCtxId);
|
||||
bool check_transaction_context_id(s32 transId);
|
||||
bool remove_transaction_context_id(s32 transId);
|
||||
sce_np_tus_transaction_context* get_transaction_context(s32 transId);
|
||||
|
||||
void terminate();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user