feat: add PS3 4J_Input decomp
This commit is contained in:
21 files changed
+2596
-105
No files matched your search
@@ -0,0 +1,258 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define BOOST_NO_CXX11_NULLPTR
|
||||
#define BOOST_ENABLE_ASSERT_HANDLER
|
||||
#include <typeinfo>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#define __forceinline inline
|
||||
|
||||
//#include "winerror.h"
|
||||
|
||||
|
||||
// user the pool_allocator for all unordered_set and unordered_map instances
|
||||
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = boost::pool_allocator<T> >
|
||||
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
|
||||
// {};
|
||||
//
|
||||
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = boost::pool_allocator<std::pair<const K,T> > >
|
||||
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
|
||||
// {};
|
||||
|
||||
|
||||
|
||||
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = C4JPoolAllocator<T> >
|
||||
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
|
||||
// {};
|
||||
//
|
||||
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = C4JPoolAllocator<std::pair<const K,T> > >
|
||||
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
|
||||
// {};
|
||||
|
||||
|
||||
// using boost::ublas::vector;
|
||||
|
||||
#define static_assert(a,b) BOOST_STATIC_ASSERT(a)
|
||||
#define AUTO_VAR BOOST_AUTO
|
||||
|
||||
#define RtlEqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length)))
|
||||
#define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
|
||||
#define RtlCopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length))
|
||||
#define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
|
||||
#define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
|
||||
|
||||
#define MoveMemory RtlMoveMemory
|
||||
#define CopyMemory RtlCopyMemory
|
||||
#define FillMemory RtlFillMemory
|
||||
#define ZeroMemory RtlZeroMemory
|
||||
|
||||
|
||||
|
||||
|
||||
// #include <math.h>
|
||||
// #include "DirectX\DirectXMath.h"
|
||||
// using namespace DirectX;
|
||||
|
||||
#define S_OK 0
|
||||
|
||||
|
||||
typedef unsigned long DWORD;
|
||||
typedef int BOOL;
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned short WORD;
|
||||
typedef float FLOAT;
|
||||
|
||||
typedef int __int32;
|
||||
|
||||
typedef FLOAT *PFLOAT;
|
||||
typedef BOOL *PBOOL;
|
||||
typedef BOOL *LPBOOL;
|
||||
typedef BYTE *PBYTE;
|
||||
typedef BYTE *LPBYTE;
|
||||
typedef int *PINT;
|
||||
typedef int *LPINT;
|
||||
typedef WORD *PWORD;
|
||||
typedef WORD *LPWORD;
|
||||
typedef long *PLONG;
|
||||
typedef long *LPLONG;
|
||||
typedef DWORD *PDWORD;
|
||||
typedef DWORD *LPDWORD;
|
||||
typedef void *LPVOID;
|
||||
typedef const void *LPCVOID;
|
||||
typedef void *PVOID;
|
||||
typedef unsigned long ULONG;
|
||||
|
||||
typedef unsigned char boolean;
|
||||
|
||||
typedef int INT;
|
||||
typedef unsigned int UINT;
|
||||
typedef unsigned int *PUINT;
|
||||
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef long long __int64;
|
||||
typedef unsigned long long __uint64;
|
||||
typedef unsigned long DWORD;
|
||||
typedef int INT;
|
||||
typedef unsigned long ULONG_PTR, *PULONG_PTR;
|
||||
typedef ULONG_PTR SIZE_T, *PSIZE_T;
|
||||
|
||||
typedef __int64 LONG64, *PLONG64;
|
||||
|
||||
#define VOID void
|
||||
typedef char CHAR;
|
||||
typedef short SHORT;
|
||||
typedef long LONG;
|
||||
typedef __int64 LONGLONG;
|
||||
typedef __uint64 ULONGLONG;
|
||||
|
||||
|
||||
#define CONST const
|
||||
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
|
||||
typedef WCHAR *PWCHAR;
|
||||
typedef WCHAR *LPWCH, *PWCH;
|
||||
typedef CONST WCHAR *LPCWCH, *PCWCH;
|
||||
typedef WCHAR *NWPSTR;
|
||||
typedef WCHAR *LPWSTR, *PWSTR;
|
||||
typedef CONST WCHAR *LPCWSTR, *PCWSTR;
|
||||
|
||||
//
|
||||
// ANSI (Multi-byte Character) types
|
||||
//
|
||||
typedef CHAR *PCHAR;
|
||||
typedef CHAR *LPCH, *PCH;
|
||||
typedef CONST CHAR *LPCCH, *PCCH;
|
||||
typedef CHAR *NPSTR;
|
||||
typedef CHAR *LPSTR, *PSTR;
|
||||
typedef CONST CHAR *LPCSTR, *PCSTR;
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct _FILETIME {
|
||||
#ifdef _M_PPCBE
|
||||
DWORD dwHighDateTime;
|
||||
DWORD dwLowDateTime;
|
||||
#else
|
||||
DWORD dwLowDateTime;
|
||||
DWORD dwHighDateTime;
|
||||
#endif
|
||||
} FILETIME, *PFILETIME, *LPFILETIME;
|
||||
|
||||
|
||||
#if defined(MIDL_PASS)
|
||||
typedef struct _LARGE_INTEGER {
|
||||
#else // MIDL_PASS
|
||||
typedef union _LARGE_INTEGER {
|
||||
struct {
|
||||
#if defined(_M_PPCBE)
|
||||
LONG HighPart;
|
||||
DWORD LowPart;
|
||||
#else
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
#endif
|
||||
};
|
||||
struct {
|
||||
#if defined(_M_PPCBE)
|
||||
LONG HighPart;
|
||||
DWORD LowPart;
|
||||
#else
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
#endif
|
||||
} u;
|
||||
#endif //MIDL_PASS
|
||||
LONGLONG QuadPart;
|
||||
} LARGE_INTEGER;
|
||||
|
||||
typedef LARGE_INTEGER *PLARGE_INTEGER;
|
||||
|
||||
#if defined(MIDL_PASS)
|
||||
typedef struct _ULARGE_INTEGER {
|
||||
#else // MIDL_PASS
|
||||
typedef union _ULARGE_INTEGER {
|
||||
struct {
|
||||
#if defined(_M_PPCBE)
|
||||
DWORD HighPart;
|
||||
DWORD LowPart;
|
||||
#else
|
||||
DWORD LowPart;
|
||||
DWORD HighPart;
|
||||
#endif
|
||||
};
|
||||
struct {
|
||||
#if defined(_M_PPCBE)
|
||||
DWORD HighPart;
|
||||
DWORD LowPart;
|
||||
#else
|
||||
DWORD LowPart;
|
||||
DWORD HighPart;
|
||||
#endif
|
||||
} u;
|
||||
#endif //MIDL_PASS
|
||||
ULONGLONG QuadPart;
|
||||
} ULARGE_INTEGER;
|
||||
|
||||
typedef ULARGE_INTEGER *PULARGE_INTEGER;
|
||||
|
||||
// 360 specifics
|
||||
typedef long HRESULT;
|
||||
typedef void* HANDLE;
|
||||
|
||||
#define DECLARE_HANDLE(name) typedef HANDLE name
|
||||
DECLARE_HANDLE(HINSTANCE);
|
||||
|
||||
typedef HINSTANCE HMODULE; /* HMODULEs can be used in place of HINSTANCEs */
|
||||
|
||||
|
||||
typedef struct _OVERLAPPED {
|
||||
ULONG_PTR Internal;
|
||||
ULONG_PTR InternalHigh;
|
||||
DWORD Offset;
|
||||
DWORD OffsetHigh;
|
||||
HANDLE hEvent;
|
||||
} OVERLAPPED, *LPOVERLAPPED;
|
||||
|
||||
typedef LPVOID PSECURITY_ATTRIBUTES;
|
||||
typedef LPVOID LPSECURITY_ATTRIBUTES;
|
||||
|
||||
|
||||
|
||||
#define __in_ecount(a)
|
||||
#define __in_bcount(a)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const int XUSER_MAX_COUNT = 4;
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libsn.h>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
#ifdef _CONTENT_PACKAGE
|
||||
#define PS3_ASSERT(val)
|
||||
#define PS3_ASSERT_CELL_ERROR(errVal)
|
||||
#elif defined(_RELEASE_FOR_ART)
|
||||
#define PS3_ASSERT(val)
|
||||
#define PS3_ASSERT_CELL_ERROR(errVal)
|
||||
#else
|
||||
#define PS3_ASSERT(val) if(!(val)) { printf("----------------------\n"); printf("Assert failed!!!\n"); printf(#val); printf("\n"); printf("%s failed.\nFile %s\nline %d \n----------------------\n", __FUNCTION__, __FILE__, __LINE__); snPause(); }
|
||||
#define PS3_ASSERT_CELL_ERROR(errVal) if(errVal != CELL_OK) { printf("----------------------\n %s failed with error %d [0x%08x]\n----------------------\n", __FUNCTION__, errVal, errVal); PS3_ASSERT(0); }
|
||||
#endif
|
||||
|
||||
#define assert PS3_ASSERT
|
||||
+2
-103
@@ -19,12 +19,6 @@ const int XUSER_MAX_COUNT = 4;
|
||||
const int MINECRAFT_NET_MAX_PLAYERS = 8;
|
||||
#endif
|
||||
|
||||
// @Patoke: i'm sorry i had to do this for compat
|
||||
namespace sigma
|
||||
{
|
||||
enum class byte : unsigned char {};
|
||||
}
|
||||
|
||||
#ifdef __ORBIS__
|
||||
#include <net.h>
|
||||
#include <np/np_npid.h>
|
||||
@@ -40,10 +34,7 @@ typedef SQRNetworkManager_Orbis::PresenceSyncInfo INVITE_INFO;
|
||||
#include <netex/libnetctl.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "..\..\Minecraft.Client\PS3\PS3_PlayerUID.h"
|
||||
#include "..\..\Minecraft.Client\PS3\Network\SQRNetworkManager_PS3.h"
|
||||
typedef SQRNetworkManager::SessionID SessionID;
|
||||
typedef SQRNetworkManager::PresenceSyncInfo INVITE_INFO;
|
||||
#include "Ps3Types.h"
|
||||
|
||||
#elif defined __PSVITA__
|
||||
#include <np.h>
|
||||
@@ -69,7 +60,7 @@ class INVITE_INFO;
|
||||
|
||||
#endif // __PS3__
|
||||
|
||||
#ifndef _DURANGO
|
||||
#if !(defined _DURANGO || __PS3__)
|
||||
typedef PlayerUID *PPlayerUID;
|
||||
#endif
|
||||
typedef struct _XUIOBJ* HXUIOBJ;
|
||||
@@ -83,49 +74,8 @@ typedef struct _XUIDC* HXUIDC;
|
||||
// void GetLocalTime(SYSTEMTIME *time);
|
||||
// #endif
|
||||
|
||||
bool IsEqualXUID(PlayerUID a, PlayerUID b);
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Temporary implementation of lock free stack with quite a bit more locking than you might expect
|
||||
template <typename T> class XLockFreeStack
|
||||
{
|
||||
std::vector<T *> intStack;
|
||||
public:
|
||||
XLockFreeStack() {
|
||||
#ifdef __ORBIS__
|
||||
OrbisInit(); // For PS4, we need to make sure Ult is set up for the critical sections to be able to initialise
|
||||
#endif
|
||||
InitializeCriticalSectionAndSpinCount(&m_cs,5120);
|
||||
}
|
||||
~XLockFreeStack() { DeleteCriticalSection( &m_cs ); }
|
||||
void Initialize() {}
|
||||
void Push(T *data)
|
||||
{
|
||||
EnterCriticalSection(&m_cs);
|
||||
intStack.push_back(data);
|
||||
LeaveCriticalSection(&m_cs);
|
||||
}
|
||||
T *Pop()
|
||||
{
|
||||
EnterCriticalSection(&m_cs);
|
||||
if( intStack.size() )
|
||||
{
|
||||
T* ret = intStack.back();
|
||||
intStack.pop_back();
|
||||
LeaveCriticalSection(&m_cs);
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
LeaveCriticalSection(&m_cs);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
private:
|
||||
CRITICAL_SECTION m_cs;
|
||||
};
|
||||
|
||||
void XMemCpy(void *a, const void *b, size_t s);
|
||||
void XMemSet(void *a, int t, size_t s);
|
||||
void XMemSet128(void *a, int t, size_t s);
|
||||
@@ -204,7 +154,6 @@ public:
|
||||
bool IsHost();
|
||||
bool IsGuest();
|
||||
bool IsLocal();
|
||||
PlayerUID GetXuid();
|
||||
LPCWSTR GetGamertag();
|
||||
int GetSessionIndex();
|
||||
bool IsTalking();
|
||||
@@ -258,19 +207,6 @@ typedef struct _XSESSION_SEARCHRESULT_HEADER {
|
||||
XSESSION_SEARCHRESULT *pResults;
|
||||
} XSESSION_SEARCHRESULT_HEADER, *PXSESSION_SEARCHRESULT_HEADER;
|
||||
|
||||
typedef struct _XONLINE_FRIEND {
|
||||
PlayerUID xuid;
|
||||
CHAR szGamertag[XUSER_NAME_SIZE];
|
||||
DWORD dwFriendState;
|
||||
SessionID sessionID;
|
||||
DWORD dwTitleID;
|
||||
FILETIME ftUserTime;
|
||||
SessionID xnkidInvite;
|
||||
FILETIME gameinviteTime;
|
||||
DWORD cchRichPresence;
|
||||
// WCHAR wszRichPresence[MAX_RICHPRESENCE_SIZE];
|
||||
} XONLINE_FRIEND, *PXONLINE_FRIEND;
|
||||
|
||||
class IQNetCallbacks
|
||||
{
|
||||
};
|
||||
@@ -294,25 +230,6 @@ typedef enum _QNET_STATE
|
||||
QNET_STATE_SESSION_DELETING
|
||||
} QNET_STATE, * PQNET_STATE;
|
||||
|
||||
class IQNet
|
||||
{
|
||||
public:
|
||||
HRESULT AddLocalPlayerByUserIndex(DWORD dwUserIndex);
|
||||
IQNetPlayer *GetHostPlayer();
|
||||
IQNetPlayer *GetLocalPlayerByUserIndex(DWORD dwUserIndex);
|
||||
IQNetPlayer *GetPlayerByIndex(DWORD dwPlayerIndex);
|
||||
IQNetPlayer *GetPlayerBySmallId(BYTE SmallId);
|
||||
IQNetPlayer *GetPlayerByXuid(PlayerUID xuid);
|
||||
DWORD GetPlayerCount();
|
||||
QNET_STATE GetState();
|
||||
bool IsHost();
|
||||
HRESULT JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo);
|
||||
void HostGame();
|
||||
void EndGame();
|
||||
|
||||
static IQNetPlayer m_player[4];
|
||||
};
|
||||
|
||||
#ifdef _DURANGO
|
||||
// 4J Stu - We don't want to be doing string conversions at runtime for timing instrumentation, so do this instead
|
||||
#define PIXBeginNamedEvent(a, b, ...) PIXBeginEvent(a,L ## b, __VA_ARGS__)
|
||||
@@ -402,31 +319,13 @@ typedef enum
|
||||
const int QNET_SENDDATA_RELIABLE = 0;
|
||||
const int QNET_SENDDATA_SEQUENTIAL = 0;
|
||||
|
||||
struct XRNM_SEND_BUFFER
|
||||
{
|
||||
DWORD dwDataSize;
|
||||
sigma::byte *pbyData;
|
||||
};
|
||||
|
||||
const int D3DBLEND_CONSTANTALPHA = 0;
|
||||
const int D3DBLEND_INVCONSTANTALPHA = 0;
|
||||
const int D3DPT_QUADLIST = 0;
|
||||
|
||||
|
||||
typedef struct _XUSER_SIGNIN_INFO {
|
||||
PlayerUID xuid;
|
||||
DWORD dwGuestNumber;
|
||||
} XUSER_SIGNIN_INFO, *PXUSER_SIGNIN_INFO;
|
||||
|
||||
#define XUSER_GET_SIGNIN_INFO_ONLINE_XUID_ONLY 0x00000001
|
||||
#define XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY 0x00000002
|
||||
|
||||
DWORD XUserGetSigninInfo(
|
||||
DWORD dwUserIndex,
|
||||
DWORD dwFlags,
|
||||
PXUSER_SIGNIN_INFO pSigninInfo
|
||||
);
|
||||
|
||||
class CXuiStringTable
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in new issue
Block a user