From bfa635f7817bd6d9571e0f3ad5a6c9492d6a28e2 Mon Sep 17 00:00:00 2001
From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com>
Date: Sun, 25 Oct 2026 17:00:03 -0400
Subject: [PATCH] chore: cleanup
---
4J_Input/4J_Input.vcxproj | 8 +-
4J_Input/PS3/INP_Main.cpp | 36 +++---
4J_Input/PS3/INP_Main.h | 2 -
4J_Input/PS3/INP_MsgBox.h | 1 -
4J_Input/PS3/INP_OnScreenKeyboard.h | 5 -
4J_Input/Windows64/INP_Main.cpp | 1 -
4J_Input/Xbox/INP_Main.cpp | 1 -
4J_Input/stdafx.h | 36 +++---
Headers/OrbisTypes.h | 174 ++++++++++++++++++++++++++++
Headers/{Ps3Types.h => PS3Types.h} | 58 +---------
Headers/extraX64.h | 79 +------------
11 files changed, 221 insertions(+), 180 deletions(-)
create mode 100644 Headers/OrbisTypes.h
rename Headers/{Ps3Types.h => PS3Types.h} (71%)
diff --git a/4J_Input/4J_Input.vcxproj b/4J_Input/4J_Input.vcxproj
index f967243..328826c 100644
--- a/4J_Input/4J_Input.vcxproj
+++ b/4J_Input/4J_Input.vcxproj
@@ -1339,25 +1339,29 @@
Unicode
- v140
+ v110
- v140
+ v110
Clang
+ false
StaticLibrary
SNC
+ false
StaticLibrary
Clang
+ false
StaticLibrary
SNC
+ false
StaticLibrary
diff --git a/4J_Input/PS3/INP_Main.cpp b/4J_Input/PS3/INP_Main.cpp
index 4d7cef1..5d03e03 100644
--- a/4J_Input/PS3/INP_Main.cpp
+++ b/4J_Input/PS3/INP_Main.cpp
@@ -1,12 +1,5 @@
#include "INP_Main.h"
-#include
-#include
-
-#include // sys_time_get_current_time
-#include // cellSysutilGetSystemParamInt
-#include // cellSysutilGetSystemParamInt
-
CInput InternalInputManager;
CInput::CInput()
@@ -47,20 +40,21 @@ void CInput::DebugPrintf(const char *szFormat, ...)
printf(buf);
}
-bool CInput::QueryPerformanceFrequency(_LARGE_INTEGER *)
+//str1k3r - Taken from Ps3Stubs.cpp
+bool CInput::QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
{
-#if TO_BE_IMPLEMENTED
- *(_QWORD *)a2 = 1000000;
-#endif
+ // microseconds
+ lpFrequency->QuadPart = (1000 * 1000);
return false;
}
-bool CInput::QueryPerformanceCounter(_LARGE_INTEGER *)
+bool CInput::QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
{
-#if TO_BE_IMPLEMENTED
- sys_time_get_current_time(&v3, &v4);
- *(_QWORD *)a2 = 1000000 * v3 + v4 / 1000;
-#endif
+ sys_time_sec_t sec;
+ sys_time_nsec_t nsec;
+ sys_time_get_current_time(&sec, &nsec);
+ // microseconds
+ lpPerformanceCount->QuadPart = (sec * (1000 * 1000)) + (nsec / 1000);
return true;
}
@@ -704,12 +698,10 @@ FLOAT CInput::GetIdleSeconds(int iPad)
{
LARGE_INTEGER qwDeltaTime;
QueryPerformanceCounter(&qwDeltaTime);
-#if TO_BE_IMPLEMENTED
- uint64_t v4 = qwDeltaTime.QuadPart - *(_QWORD *)(v5 + 4696 + 8 * a2);
- return (float)(*(float *)((char *)&loc_644 + v5) * (float)v4)
-#else
- return 0.0f;
-#endif
+
+ LARGE_INTEGER fElapsedTime = this->m_LastActivityTime[iPad];
+
+ return this->m_fTickToSeconds * (qwDeltaTime.LowPart - fElapsedTime.LowPart);
}
void CInput::SetLostInputControlCallback(void( *Func)(LPVOID, bool),LPVOID lpParam)
diff --git a/4J_Input/PS3/INP_Main.h b/4J_Input/PS3/INP_Main.h
index ecdd84a..1bcec7d 100644
--- a/4J_Input/PS3/INP_Main.h
+++ b/4J_Input/PS3/INP_Main.h
@@ -4,8 +4,6 @@
#include "INP_OnScreenKeyboard.h"
#include "INP_MsgBox.h"
-#include
-
#define MAX_JOYPADS 4
class CInput
diff --git a/4J_Input/PS3/INP_MsgBox.h b/4J_Input/PS3/INP_MsgBox.h
index 5ee9d98..ac83db3 100644
--- a/4J_Input/PS3/INP_MsgBox.h
+++ b/4J_Input/PS3/INP_MsgBox.h
@@ -1,7 +1,6 @@
#pragma once
#include "4J_Input.h"
-#include // cellMsgDialogOpen2
class CMsgBox
{
diff --git a/4J_Input/PS3/INP_OnScreenKeyboard.h b/4J_Input/PS3/INP_OnScreenKeyboard.h
index 65853db..5d29b8d 100644
--- a/4J_Input/PS3/INP_OnScreenKeyboard.h
+++ b/4J_Input/PS3/INP_OnScreenKeyboard.h
@@ -1,11 +1,6 @@
#pragma once
#include "4J_Input.h"
-#include // cellSysutilRegisterCallback
-#include // cellOskDialogUnloadAsync
-#include // cellOskDialogExtRegisterKeyboardEventHookCallback
-#include // cellSysutilGetSystemParamInt
-#include // SYS_MEMORY_CONTAINER_ID_INVALID
class CKeyboard
{
diff --git a/4J_Input/Windows64/INP_Main.cpp b/4J_Input/Windows64/INP_Main.cpp
index 5318931..1fe25a5 100644
--- a/4J_Input/Windows64/INP_Main.cpp
+++ b/4J_Input/Windows64/INP_Main.cpp
@@ -646,7 +646,6 @@ FLOAT CInput::GetIdleSeconds(int iPad)
QueryPerformanceCounter(&qwDeltaTime);
LARGE_INTEGER fElapsedTime = this->m_LastActivityTime[iPad];
- uint64_t qwNewTime = qwDeltaTime.QuadPart - fElapsedTime.QuadPart;
return this->m_fTickToSeconds * (qwDeltaTime.LowPart - fElapsedTime.LowPart);
}
diff --git a/4J_Input/Xbox/INP_Main.cpp b/4J_Input/Xbox/INP_Main.cpp
index aca38b7..9cec49b 100644
--- a/4J_Input/Xbox/INP_Main.cpp
+++ b/4J_Input/Xbox/INP_Main.cpp
@@ -556,7 +556,6 @@ FLOAT CInput::GetIdleSeconds(int iPad)
QueryPerformanceCounter(&qwDeltaTime);
LARGE_INTEGER fElapsedTime = this->m_LastActivityTime[iPad];
- uint64_t qwNewTime = qwDeltaTime.QuadPart - fElapsedTime.QuadPart;
return this->m_fTickToSeconds * (qwDeltaTime.LowPart - fElapsedTime.LowPart);
}
diff --git a/4J_Input/stdafx.h b/4J_Input/stdafx.h
index da12b25..e31a687 100644
--- a/4J_Input/stdafx.h
+++ b/4J_Input/stdafx.h
@@ -1,35 +1,43 @@
-#ifndef PCH_H
-#define PCH_H
+//str1k3r - These top ones are shared across platforms
+
+#include
+#include
+#include
+#include
#ifdef _WIN64
#define WIN32_LEAN_AND_MEAN
#include
-
#include
-#include
#endif
#ifdef __ORBIS__
-#include
-#include
-#include
-#include
-#include
+#include "OrbisTypes.h"
+#include "4J_Profile.h"
+#include
#include
+#include
+#include
+#include
#include
#endif
#ifdef _XBOX
#include
-#include
-#include
#include "4J_Storage.h"
#else
#include "extraX64.h"
#endif
#ifdef __PS3__
-#include "Ps3Types.h"
+#include "PS3Types.h"
+#include
+#include
+#include |
+#include
+#include
+#include
+#include
+#include
+#include
#endif
-
-#endif //PCH_H
diff --git a/Headers/OrbisTypes.h b/Headers/OrbisTypes.h
new file mode 100644
index 0000000..639bd26
--- /dev/null
+++ b/Headers/OrbisTypes.h
@@ -0,0 +1,174 @@
+#pragma once
+
+typedef unsigned int 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 int *PLONG;
+typedef int *LPLONG;
+typedef DWORD *PDWORD;
+typedef DWORD *LPDWORD;
+typedef void *LPVOID;
+typedef const void *LPCVOID;
+typedef void *PVOID;
+typedef unsigned int ULONG;
+
+typedef unsigned char boolean;
+
+typedef int INT;
+typedef unsigned int UINT;
+typedef unsigned int *PUINT;
+
+
+typedef unsigned char byte;
+typedef long __int64;
+typedef unsigned long __uint64;
+typedef unsigned int DWORD;
+typedef int INT;
+typedef unsigned long ULONG_PTR, *PULONG_PTR;
+typedef ULONG_PTR SIZE_T, *PSIZE_T;
+
+typedef long LONG64, *PLONG64;
+
+#define VOID void
+typedef char CHAR;
+typedef short SHORT;
+typedef int LONG;
+typedef long LONGLONG;
+typedef unsigned long 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 int32_t 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)
+
+#ifndef AUTO_VAR
+#define AUTO_VAR(_var, _val) auto _var = _val
+#endif
\ No newline at end of file
diff --git a/Headers/Ps3Types.h b/Headers/PS3Types.h
similarity index 71%
rename from Headers/Ps3Types.h
rename to Headers/PS3Types.h
index 5381add..7ed97db 100644
--- a/Headers/Ps3Types.h
+++ b/Headers/PS3Types.h
@@ -5,38 +5,12 @@
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_ENABLE_ASSERT_HANDLER
-#include
+#include
#include
-
#define __forceinline inline
-//#include "winerror.h"
-
-
-// user the pool_allocator for all unordered_set and unordered_map instances
-// template < class T, class H = hash, class P = std::equal_to, class A = boost::pool_allocator >
-// class unordered_set : public std::tr1::unordered_set
-// {};
-//
-// template , class P = std::equal_to, class A = boost::pool_allocator > >
-// class unordered_map : public std::tr1::unordered_map
-// {};
-
-
-
-// template < class T, class H = hash, class P = std::equal_to, class A = C4JPoolAllocator >
-// class unordered_set : public std::tr1::unordered_set
-// {};
-//
-// template , class P = std::equal_to, class A = C4JPoolAllocator > >
-// class unordered_map : public std::tr1::unordered_map
-// {};
-
-
-// using boost::ublas::vector;
-
#define static_assert(a,b) BOOST_STATIC_ASSERT(a)
#define AUTO_VAR BOOST_AUTO
@@ -51,16 +25,8 @@
#define FillMemory RtlFillMemory
#define ZeroMemory RtlZeroMemory
-
-
-
-// #include
-// #include "DirectX\DirectXMath.h"
-// using namespace DirectX;
-
#define S_OK 0
-
typedef unsigned long DWORD;
typedef int BOOL;
typedef unsigned char BYTE;
@@ -228,31 +194,9 @@ typedef struct _OVERLAPPED {
typedef LPVOID PSECURITY_ATTRIBUTES;
typedef LPVOID LPSECURITY_ATTRIBUTES;
-
-
#define __in_ecount(a)
#define __in_bcount(a)
-
-
-
-
-// const int XUSER_MAX_COUNT = 4;
-
#include
-#include
#include
#include
-
-#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
diff --git a/Headers/extraX64.h b/Headers/extraX64.h
index 8f1f415..de06910 100644
--- a/Headers/extraX64.h
+++ b/Headers/extraX64.h
@@ -23,42 +23,21 @@ const int MINECRAFT_NET_MAX_PLAYERS = 8;
#include
#include
#include
-#include "..\..\Minecraft.Client\Orbis\Orbis_PlayerUID.h"
-#include "..\..\Minecraft.Client\Orbis\Network\SQRNetworkManager_Orbis.h"
-typedef SQRNetworkManager_Orbis::SessionID SessionID;
-typedef SQRNetworkManager_Orbis::PresenceSyncInfo INVITE_INFO;
-
-#elif defined __PS3__ // defined in the profile lib
+#elif __PS3__
#include
#include
#include
-#include
#include "Ps3Types.h"
-
-#elif defined __PSVITA__
+#elif __PSVITA__
#include
-#include
#include
-#include "..\..\Minecraft.Client\PSVita\PSVita_PlayerUID.h"
-#include "..\..\Minecraft.Client\PSVita\Network\SQRNetworkManager_Vita.h"
-#include "..\..\Minecraft.Client\PSVita\Network\SQRNetworkManager_AdHoc_Vita.h"
-typedef SQRNetworkManager_Vita::SessionID SessionID;
-typedef SQRNetworkManager_Vita::PresenceSyncInfo INVITE_INFO;
+#endif
-#elif defined _DURANGO
-#include "..\..\Minecraft.Client\Durango\4JLibs\inc\4J_Profile.h"
-#include "..\..\Minecraft.Client\Durango\Network\DQRNetworkManager.h"
-typedef ULONGLONG SessionID;
-typedef ULONGLONG GameSessionUID;
-typedef DQRNetworkManager::SessionInfo INVITE_INFO;
-#else
typedef ULONGLONG PlayerUID;
typedef ULONGLONG SessionID;
typedef PlayerUID GameSessionUID;
class INVITE_INFO;
-#endif // __PS3__
-
#if !(defined _DURANGO || __PS3__)
typedef PlayerUID *PPlayerUID;
#endif
@@ -252,13 +231,6 @@ const int QNET_SENDDATA_SECONDARY = 0;
#else
const int INVALID_XUID = 0;
#endif
-// const int MOJANG_DATA = 0;
-
-// typedef struct _STRING_VERIFY_RESPONSE
-// {
-// WORD wNumStrings;
-// HRESULT *pStringResult;
-// } STRING_VERIFY_RESPONSE;
const int XCONTENT_MAX_DISPLAYNAME_LENGTH = 256;
const int XCONTENT_MAX_FILENAME_LENGTH = 256;
@@ -409,35 +381,6 @@ typedef struct {
XUSER_DATA value;
} XUSER_PROPERTY, *PXUSER_PROPERTY;
-// these need to match apwstrLocaleCode
-// const int XC_LANGUAGE_ENGLISH =1;
-// const int XC_LANGUAGE_JAPANESE =2;
-// const int XC_LANGUAGE_GERMAN =3;
-// const int XC_LANGUAGE_FRENCH =4;
-// const int XC_LANGUAGE_SPANISH =5;
-// const int XC_LANGUAGE_ITALIAN =6;
-// const int XC_LANGUAGE_KOREAN =7;
-// const int XC_LANGUAGE_TCHINESE =8;
-// const int XC_LANGUAGE_PORTUGUESE =9;
-// const int XC_LANGUAGE_BRAZILIAN =10;
-// #if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
-// const int XC_LANGUAGE_RUSSIAN =11;
-// // more PS3
-// const int XC_LANGUAGE_DUTCH =12;
-// const int XC_LANGUAGE_FINISH =13;
-// const int XC_LANGUAGE_SWEDISH =14;
-// const int XC_LANGUAGE_DANISH =15;
-// const int XC_LANGUAGE_NORWEGIAN =16;
-// const int XC_LANGUAGE_POLISH =17;
-// const int XC_LANGUAGE_TURKISH =18;
-// const int XC_LANGUAGE_LATINAMERICANSPANISH =19;
-//
-// const int XC_LANGUAGE_GREEK =20;
-// #else
-// const int XC_LANGUAGE_UKENGLISH =11;
-// const int XC_LANGUAGE_MEXICANSPANISH=12;
-// #endif
-
// matching Xbox 360
const int XC_LANGUAGE_ENGLISH =0x01;
const int XC_LANGUAGE_JAPANESE =0x02;
@@ -511,15 +454,7 @@ const int XC_LOCALE_ISRAEL =42;
const int XC_LOCALE_UNITED_ARAB_EMIRATES =43;
// for Sony
-const int XC_LOCALE_LATIN_AMERICA =240;
-
-
-
-#if !(defined _DURANGO || defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
-DWORD XGetLanguage();
-DWORD XGetLocale();
-DWORD XEnableGuestSignin(BOOL fEnable);
-#endif
+const int XC_LOCALE_LATIN_AMERICA =240;
class D3DXVECTOR3
{
@@ -529,9 +464,3 @@ public:
float x,y,z,pad;
D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& add );
};
-
-#define QNET_E_SESSION_FULL 0
-#define QNET_USER_MASK_USER0 1
-#define QNET_USER_MASK_USER1 2
-#define QNET_USER_MASK_USER2 4
-#define QNET_USER_MASK_USER3 8
| | | |