From ba4a20531d296e05037581e093958d1e1aac50ac Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:27:12 +1100 Subject: [PATCH 01/12] Remove WinAPI buffer types from 4J.Render --- 4J.Render/4J_Render.cpp | 3 ++- 4J.Render/4J_Render.h | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/4J.Render/4J_Render.cpp b/4J.Render/4J_Render.cpp index 8bd80daa5..99b7879d6 100644 --- a/4J.Render/4J_Render.cpp +++ b/4J.Render/4J_Render.cpp @@ -695,7 +695,8 @@ HRESULT C4JRender::LoadTextureData(const char* szFilename, return hr; } -HRESULT C4JRender::LoadTextureData(BYTE* pbData, DWORD dwBytes, +HRESULT C4JRender::LoadTextureData(std::uint8_t* pbData, + std::uint32_t dwBytes, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut) { int width, height, channels; diff --git a/4J.Render/4J_Render.h b/4J.Render/4J_Render.h index bf8a4c6c1..05a43958b 100644 --- a/4J.Render/4J_Render.h +++ b/4J.Render/4J_Render.h @@ -30,10 +30,10 @@ typedef struct { } D3DXIMAGE_INFO; typedef struct _XSOCIAL_PREVIEWIMAGE { - BYTE* pBytes; - DWORD Pitch; - DWORD Width; - DWORD Height; + std::uint8_t* pBytes; + std::uint32_t Pitch; + std::uint32_t Width; + std::uint32_t Height; // D3DFORMAT Format; } XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE; @@ -171,7 +171,7 @@ public: void TextureDynamicUpdateEnd(); HRESULT LoadTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut); - HRESULT LoadTextureData(BYTE* pbData, DWORD dwBytes, + HRESULT LoadTextureData(std::uint8_t* pbData, std::uint32_t dwBytes, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut); HRESULT SaveTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, int* ppDataOut); From 73a8cf8f8ee635defc56acd349ae218129b78685 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:27:49 +1100 Subject: [PATCH 02/12] Remove WinAPI primitive types from 4J.Profile --- 4J.Profile/4J_Profile.cpp | 31 +++++++++++---------- 4J.Profile/4J_Profile.h | 31 +++++++++++---------- Minecraft.Client/Platform/Extrax64Stubs.cpp | 16 +++++------ 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/4J.Profile/4J_Profile.cpp b/4J.Profile/4J_Profile.cpp index d71426de2..08322cf8d 100644 --- a/4J.Profile/4J_Profile.cpp +++ b/4J.Profile/4J_Profile.cpp @@ -5,10 +5,12 @@ C_4JProfile ProfileManager; static void* s_profileData[4] = {}; -void C_4JProfile::Initialise(DWORD dwTitleID, DWORD dwOfferID, +void C_4JProfile::Initialise(std::uint32_t dwTitleID, + std::uint32_t dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, UINT uiProfileSettingsC, - DWORD* pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + std::uint32_t* pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int* puiGameDefinedDataChangedBitmask) { for (int i = 0; i < 4; i++) { @@ -25,22 +27,21 @@ void C_4JProfile::SetLockedProfile(int iProf) {} bool C_4JProfile::IsSignedIn(int iQuadrant) { return iQuadrant == 0; } bool C_4JProfile::IsSignedInLive(int iProf) { return false; } bool C_4JProfile::IsGuest(int iQuadrant) { return false; } -UINT C_4JProfile::RequestSignInUI(bool bFromInvite, bool bLocalGame, - bool bNoGuestsAllowed, - bool bMultiplayerSignIn, bool bAddUser, - int (*Func)(void*, const bool, - const int iPad), - void* lpParam, int iQuadrant) { +unsigned int C_4JProfile::RequestSignInUI( + bool bFromInvite, bool bLocalGame, bool bNoGuestsAllowed, + bool bMultiplayerSignIn, bool bAddUser, + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant) { return 0; } -UINT C_4JProfile::DisplayOfflineProfile(int (*Func)(void*, const bool, - const int iPad), - void* lpParam, int iQuadrant) { +unsigned int C_4JProfile::DisplayOfflineProfile( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant) { return 0; } -UINT C_4JProfile::RequestConvertOfflineToGuestUI(int (*Func)(void*, const bool, - const int iPad), - void* lpParam, int iQuadrant) { +unsigned int C_4JProfile::RequestConvertOfflineToGuestUI( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant) { return 0; } void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {} diff --git a/4J.Profile/4J_Profile.h b/4J.Profile/4J_Profile.h index 0bd8a4b9e..baadff82f 100644 --- a/4J.Profile/4J_Profile.h +++ b/4J.Profile/4J_Profile.h @@ -36,9 +36,11 @@ public: // 4 players have game defined data, puiGameDefinedDataChangedBitmask needs // to be checked by the game side to see if there's an update needed - it'll // have the bits set for players to be updated - void Initialise(DWORD dwTitleID, DWORD dwOfferID, - unsigned short usProfileVersion, UINT uiProfileValuesC, - UINT uiProfileSettingsC, DWORD* pdwProfileSettingsA, + void Initialise(std::uint32_t dwTitleID, std::uint32_t dwOfferID, + unsigned short usProfileVersion, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + std::uint32_t* pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int* puiGameDefinedDataChangedBitmask); void SetTrialTextStringTable(CXuiStringTable* pStringTable, int iAccept, @@ -50,17 +52,18 @@ public: bool IsSignedIn(int iQuadrant); bool IsSignedInLive(int iProf); bool IsGuest(int iQuadrant); - UINT RequestSignInUI(bool bFromInvite, bool bLocalGame, - bool bNoGuestsAllowed, bool bMultiplayerSignIn, - bool bAddUser, - int (*Func)(void*, const bool, const int iPad), - void* lpParam, int iQuadrant = XUSER_INDEX_ANY); - UINT DisplayOfflineProfile(int (*Func)(void*, const bool, const int iPad), - void* lpParam, int iQuadrant = XUSER_INDEX_ANY); - UINT RequestConvertOfflineToGuestUI(int (*Func)(void*, const bool, - const int iPad), - void* lpParam, - int iQuadrant = XUSER_INDEX_ANY); + unsigned int RequestSignInUI(bool bFromInvite, bool bLocalGame, + bool bNoGuestsAllowed, + bool bMultiplayerSignIn, bool bAddUser, + int (*Func)(void*, const bool, const int iPad), + void* lpParam, + int iQuadrant = XUSER_INDEX_ANY); + unsigned int DisplayOfflineProfile( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant = XUSER_INDEX_ANY); + unsigned int RequestConvertOfflineToGuestUI( + int (*Func)(void*, const bool, const int iPad), void* lpParam, + int iQuadrant = XUSER_INDEX_ANY); void SetPrimaryPlayerChanged(bool bVal); bool QuerySigninStatus(void); void GetXUID(int iPad, PlayerUID* pXuid, bool bOnlineXuid); diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index 683ef6f94..d462efd35 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -395,12 +395,12 @@ DWORD XEnableGuestSignin(BOOL fEnable) { return 0; } #ifdef _WINDOWS64 static void *profileData[4]; static bool s_bProfileIsFullVersion; -void C_4JProfile::Initialise( DWORD dwTitleID, - DWORD dwOfferID, +void C_4JProfile::Initialise( std::uint32_t dwTitleID, + std::uint32_t dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, - UINT uiProfileSettingsC, - DWORD *pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + std::uint32_t *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask) { @@ -467,9 +467,9 @@ void C_4JProfile::SetLockedProfile(int iProf) {} bool C_4JProfile::IsSignedIn(int iQuadrant) { return ( iQuadrant == 0); } bool C_4JProfile::IsSignedInLive(int iProf) { return true; } bool C_4JProfile::IsGuest(int iQuadrant) { return false; } -UINT C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } -UINT C_4JProfile::DisplayOfflineProfile(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } -UINT C_4JProfile::RequestConvertOfflineToGuestUI(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } +unsigned int C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } +unsigned int C_4JProfile::DisplayOfflineProfile(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } +unsigned int C_4JProfile::RequestConvertOfflineToGuestUI(int( *Func)(void *,const bool, const int iPad),void *lpParam,int iQuadrant) { return 0; } void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {} bool C_4JProfile::QuerySigninStatus(void) { return true; } void C_4JProfile::GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid) {*pXuid = 0xe000d45248242f2e; } From 719b89c7b5ca689e372933570a968a555f8f289d Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:34:28 +1100 Subject: [PATCH 03/12] Remove WinAPI byte types from 4J.Storage --- 4J.Storage/4J_Storage.cpp | 22 ++++++---- 4J.Storage/4J_Storage.h | 48 +++++++++++---------- Minecraft.Client/Platform/Extrax64Stubs.cpp | 6 +-- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/4J.Storage/4J_Storage.cpp b/4J.Storage/4J_Storage.cpp index f5a7b922a..9db14bde5 100644 --- a/4J.Storage/4J_Storage.cpp +++ b/4J.Storage/4J_Storage.cpp @@ -57,15 +57,19 @@ void C4JStorage::GetSaveData(void* pvData, unsigned int* puiBytes) { PVOID C4JStorage::AllocateSaveData(unsigned int uiBytes) { return malloc(uiBytes); } -void C4JStorage::SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes, - PBYTE pbImage, DWORD dwImageBytes, - PBYTE pbTextData, DWORD dwTextDataBytes) {} +void C4JStorage::SetSaveImages(std::uint8_t* pbThumbnail, + unsigned int dwThumbnailBytes, + std::uint8_t* pbImage, + unsigned int dwImageBytes, + std::uint8_t* pbTextData, + unsigned int dwTextDataBytes) {} C4JStorage::ESaveGameState C4JStorage::SaveSaveData(int (*Func)(void*, const bool), void* lpParam) { return ESaveGame_Idle; } -void C4JStorage::CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail, +void C4JStorage::CopySaveDataToNewSave(std::uint8_t* pbThumbnail, + unsigned int cbThumbnail, WCHAR* wchNewName, int (*Func)(void* lpParam, bool), void* lpParam) {} @@ -153,14 +157,14 @@ void C4JStorage::GetMountedDLCFileList(const char* szMountDrive, std::string C4JStorage::GetMountedPath(std::string szMount) { return ""; } C4JStorage::ETMSStatus C4JStorage::ReadTMSFile( int iQuadrant, eGlobalStorage eStorageFacility, - C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename, BYTE** ppBuffer, - DWORD* pdwBufferSize, int (*Func)(void*, WCHAR*, int, bool, int), - void* lpParam, int iAction) { + C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename, + std::uint8_t** ppBuffer, unsigned int* pdwBufferSize, + int (*Func)(void*, WCHAR*, int, bool, int), void* lpParam, int iAction) { return ETMSStatus_Fail; } bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, - WCHAR* pwchFilename, BYTE* pBuffer, - DWORD dwBufferSize) { + WCHAR* pwchFilename, std::uint8_t* pBuffer, + unsigned int dwBufferSize) { return false; } bool C4JStorage::DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, diff --git a/4J.Storage/4J_Storage.h b/4J.Storage/4J_Storage.h index b52c4fa8e..a49968463 100644 --- a/4J.Storage/4J_Storage.h +++ b/4J.Storage/4J_Storage.h @@ -20,7 +20,7 @@ typedef struct { char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH]; char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH]; CONTAINER_METADATA metaData; - PBYTE thumbnailData; + std::uint8_t* thumbnailData; } SAVE_INFO, *PSAVE_INFO; typedef struct { @@ -40,14 +40,14 @@ public: // Structs defined in the DLC_Creator, but added here to be used in the app typedef struct { unsigned int uiFileSize; - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array + std::uint32_t dwType; + std::uint32_t dwWchCount; // count of WCHAR in next array WCHAR wchFile[1]; } DLC_FILE_DETAILS, *PDLC_FILE_DETAILS; typedef struct { - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array; + std::uint32_t dwType; + std::uint32_t dwWchCount; // count of WCHAR in next array; WCHAR wchData[1]; // will be an array of size dwBytes } DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs @@ -55,17 +55,18 @@ public: typedef struct { WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; - DWORD dwImageOffset; - DWORD dwImageBytes; + std::uint32_t dwImageOffset; + std::uint32_t dwImageBytes; } CACHEINFOSTRUCT; // structure to hold DLC info in TMS typedef struct { - DWORD dwVersion; - DWORD dwNewOffers; - DWORD dwTotalOffers; - DWORD dwInstalledTotalOffers; - BYTE bPadding[1024 - sizeof(DWORD) * 4]; // future expansion + std::uint32_t dwVersion; + std::uint32_t dwNewOffers; + std::uint32_t dwTotalOffers; + std::uint32_t dwInstalledTotalOffers; + std::uint8_t bPadding[1024 - sizeof(std::uint32_t) * 4]; + // future expansion } DLC_TMS_DETAILS; enum eGTS_FileTypes { eGTS_Type_Skin = 0, eGTS_Type_Cape, eGTS_Type_MAX }; @@ -188,8 +189,8 @@ public: } TMSPP_FILE_LIST, *PTMSPP_FILE_LIST; typedef struct { - DWORD dwSize; - PBYTE pbData; + unsigned int dwSize; + std::uint8_t* pbData; } TMSPP_FILEDATA, *PTMSPP_FILEDATA; C4JStorage(); @@ -230,14 +231,16 @@ public: void GetSaveData(void* pvData, unsigned int* puiBytes); PVOID AllocateSaveData(unsigned int uiBytes); void SetSaveImages( - PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE pbImage, - DWORD dwImageBytes, PBYTE pbTextData, - DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, - // optionally setting the metadata in the png + std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes, + std::uint8_t* pbImage, unsigned int dwImageBytes, + std::uint8_t* pbTextData, + unsigned int dwTextDataBytes); // Sets the thumbnail & image for the + // save, optionally setting the + // metadata in the png C4JStorage::ESaveGameState SaveSaveData(int (*Func)(void*, const bool), void* lpParam); - void CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail, - WCHAR* wchNewName, + void CopySaveDataToNewSave(std::uint8_t* pbThumbnail, + unsigned int cbThumbnail, WCHAR* wchNewName, int (*Func)(void* lpParam, bool), void* lpParam); void SetSaveDeviceSelected(unsigned int uiPad, bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); @@ -309,11 +312,12 @@ public: C4JStorage::ETMSStatus ReadTMSFile( int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename, - BYTE** ppBuffer, DWORD* pdwBufferSize, + std::uint8_t** ppBuffer, unsigned int* pdwBufferSize, int (*Func)(void*, WCHAR*, int, bool, int) = NULL, void* lpParam = NULL, int iAction = 0); bool WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, - WCHAR* pwchFilename, BYTE* pBuffer, DWORD dwBufferSize); + WCHAR* pwchFilename, std::uint8_t* pBuffer, + unsigned int dwBufferSize); bool DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR* pwchFilename); void StoreTMSPathName(WCHAR* pwchName = NULL); diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index d462efd35..5f7b78667 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -576,7 +576,7 @@ unsigned int C4JStorage::GetSaveSize() { return 0; } void C4JStorage::GetSaveData(void *pvData,unsigned int *pulBytes) {} PVOID C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; } void C4JStorage::SaveSaveData(unsigned int ulBytes,PBYTE pbThumbnail,DWORD cbThumbnail,PBYTE pbTextData, DWORD dwTextLen) {} -void C4JStorage::CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam) {} +void C4JStorage::CopySaveDataToNewSave(std::uint8_t *pbThumbnail,unsigned int cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam) {} void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {} bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return true; } C4JStorage::ELoadGameStatus C4JStorage::DoesSaveExist(bool *pbExists) { return C4JStorage::ELoadGame_Idle; } @@ -604,8 +604,8 @@ XCONTENT_DATA& C4JStorage::GetDLC(DWORD dw) { static XCONTENT_DATA retval = C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam) { return C4JStorage::EDLC_Idle; } std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,LPCSTR szMountDrive) { return 0; } DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; } -C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } -bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize) { return true; } +C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } +bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int dwBufferSize) { return true; } bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; } void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {} unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; } From 24e10876ffa98584b38fbbf42087c6876a590e02 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:36:30 +1100 Subject: [PATCH 04/12] Remove WinAPI primitive aliases from 4J.Input --- 4J.Input/4J_Input.cpp | 2 +- 4J.Input/4J_Input.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/4J.Input/4J_Input.cpp b/4J.Input/4J_Input.cpp index f66f90d27..def8bdc75 100644 --- a/4J.Input/4J_Input.cpp +++ b/4J.Input/4J_Input.cpp @@ -571,7 +571,7 @@ void C_4JInput::SetJoypadStickAxisMap(int, unsigned int, unsigned int) {} void C_4JInput::SetJoypadStickTriggerMap(int, unsigned int, unsigned int) {} void C_4JInput::SetKeyRepeatRate(float, float) {} void C_4JInput::SetDebugSequence(const char*, int (*)(void*), void*) {} -FLOAT C_4JInput::GetIdleSeconds(int) { return 0.f; } +float C_4JInput::GetIdleSeconds(int) { return 0.f; } bool C_4JInput::IsPadConnected(int iPad) { return iPad == 0; } // Silly check, we check if we have a keyboard. diff --git a/4J.Input/4J_Input.h b/4J.Input/4J_Input.h index 85ee8b5bd..cdaef7292 100644 --- a/4J.Input/4J_Input.h +++ b/4J.Input/4J_Input.h @@ -53,7 +53,7 @@ enum EKeyboardResult { }; typedef struct _STRING_VERIFY_RESPONSE { - WORD wNumStrings; + std::uint16_t wNumStrings; HRESULT* pStringResult; } STRING_VERIFY_RESPONSE; @@ -96,7 +96,7 @@ public: void SetKeyRepeatRate(float fRepeatDelaySecs, float fRepeatRateSecs); void SetDebugSequence(const char* chSequenceA, int (*Func)(void*), void* lpParam); - FLOAT GetIdleSeconds(int iPad); + float GetIdleSeconds(int iPad); bool IsPadConnected(int iPad); // In-Game values which may have been remapped due to Southpaw, swap From d5d507ae1f279958c85483dbf8f6f441429f964a Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:37:56 +1100 Subject: [PATCH 05/12] Remove FLOAT aliases from timing paths --- Minecraft.Client/MinecraftServer.cpp | 4 ++-- Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp | 4 ++-- Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp | 4 ++-- Minecraft.World/Level/Level.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index cf6bf483b..6411e4446 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -903,7 +903,7 @@ void MinecraftServer::Suspend() { QueryPerformanceCounter(&qwNewTime); qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; - fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); + fElapsedTime = fSecsPerTick * static_cast(qwDeltaTime.QuadPart); // 4J-JEV: Flush stats and call PlayerSessionExit. for (int iPad = 0; iPad < XUSER_MAX_COUNT; iPad++) { @@ -1272,7 +1272,7 @@ void MinecraftServer::run(__int64 seed, void* lpParameter) { qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; fElapsedTime = - fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); + fSecsPerTick * static_cast(qwDeltaTime.QuadPart); app.DebugPrintf("Autosave: Elapsed time %f\n", fElapsedTime); } break; diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp index f8bbd6d57..2abb157aa 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp @@ -728,7 +728,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) { QueryPerformanceCounter(&qwNewTime); qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; - fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); + fElapsedTime = fSecsPerTick * static_cast(qwDeltaTime.QuadPart); app.DebugPrintf("Check buffer size: Elapsed time %f\n", fElapsedTime); PIXEndNamedEvent(); @@ -759,7 +759,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail) { QueryPerformanceCounter(&qwNewTime); qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; - fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); + fElapsedTime = fSecsPerTick * static_cast(qwDeltaTime.QuadPart); app.DebugPrintf("Compress: Elapsed time %f\n", fElapsedTime); PIXEndNamedEvent(); diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp index a78000f75..310bcb994 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp @@ -1344,7 +1344,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) { QueryPerformanceCounter(&qwNewTime); qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; - fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); + fElapsedTime = fSecsPerTick * static_cast(qwDeltaTime.QuadPart); app.DebugPrintf("Check buffer size: Elapsed time %f\n", fElapsedTime); PIXEndNamedEvent(); @@ -1367,7 +1367,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) { QueryPerformanceCounter(&qwNewTime); qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; - fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); + fElapsedTime = fSecsPerTick * static_cast(qwDeltaTime.QuadPart); app.DebugPrintf("Compress: Elapsed time %f\n", fElapsedTime); PIXEndNamedEvent(); diff --git a/Minecraft.World/Level/Level.cpp b/Minecraft.World/Level/Level.cpp index f625a4297..ebd444b9a 100644 --- a/Minecraft.World/Level/Level.cpp +++ b/Minecraft.World/Level/Level.cpp @@ -3450,8 +3450,8 @@ void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, { QueryPerformanceCounter( &qwNewTime ); qwDeltaTime2.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart; - fElapsedTime1 = fSecsPerTick * ((FLOAT)(qwDeltaTime1.QuadPart)); - fElapsedTime2 = fSecsPerTick * ((FLOAT)(qwDeltaTime2.QuadPart)); + fElapsedTime1 = fSecsPerTick * static_cast(qwDeltaTime1.QuadPart); + fElapsedTime2 = fSecsPerTick * static_cast(qwDeltaTime2.QuadPart); if( ( darktcc > 0 ) | ( tcc > 0 ) ) { printf("%d %d %d %f + %f = %f\n", darktcc, tcc, darktcc + tcc, fElapsedTime1 * 1000.0f, fElapsedTime2 * 1000.0f, ( fElapsedTime1 + fElapsedTime2 ) * 1000.0f); From 0605748543979f84ab0b2e774e8a6fcf74970a99 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:40:39 +1100 Subject: [PATCH 06/12] Remove WinAPI primitive types from storage helpers --- 4J.Storage/4J_Storage.cpp | 12 +++++++----- 4J.Storage/4J_Storage.h | 13 +++++++------ Minecraft.Client/Platform/Extrax64Stubs.cpp | 6 +++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/4J.Storage/4J_Storage.cpp b/4J.Storage/4J_Storage.cpp index 9db14bde5..13524a91d 100644 --- a/4J.Storage/4J_Storage.cpp +++ b/4J.Storage/4J_Storage.cpp @@ -13,10 +13,11 @@ C4JStorage::C4JStorage() : m_pStringTable(nullptr) {} void C4JStorage::Tick(void) {} C4JStorage::EMessageResult C4JStorage::RequestMessageBox( - UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad, + unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA, + unsigned int uiOptionC, unsigned int dwPad, int (*Func)(void*, int, const C4JStorage::EMessageResult), void* lpParam, C4JStringTable* pStringTable, WCHAR* pwchFormatString, - DWORD dwFocusButton) { + unsigned int dwFocusButton) { return EMessage_ResultAccept; } @@ -96,12 +97,13 @@ C4JStorage::ESaveGameState C4JStorage::LoadSaveDataThumbnail( void* lpParam) { return ESaveGame_Idle; } -void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, +void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile, XCONTENT_DATA& xContentData) { memset(&xContentData, 0, sizeof(xContentData)); } -void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE* ppbImageData, - DWORD* pdwImageBytes) { +void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile, + std::uint8_t** ppbImageData, + unsigned int* pdwImageBytes) { if (ppbImageData) *ppbImageData = nullptr; if (pdwImageBytes) *pdwImageBytes = 0; } diff --git a/4J.Storage/4J_Storage.h b/4J.Storage/4J_Storage.h index a49968463..8bc90ceb7 100644 --- a/4J.Storage/4J_Storage.h +++ b/4J.Storage/4J_Storage.h @@ -199,11 +199,11 @@ public: // Messages C4JStorage::EMessageResult RequestMessageBox( - UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, - DWORD dwPad = XUSER_INDEX_ANY, + unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA, + unsigned int uiOptionC, unsigned int dwPad = XUSER_INDEX_ANY, int (*Func)(void*, int, const C4JStorage::EMessageResult) = NULL, void* lpParam = NULL, C4JStringTable* pStringTable = NULL, - WCHAR* pwchFormatString = NULL, DWORD dwFocusButton = 0); + WCHAR* pwchFormatString = NULL, unsigned int dwFocusButton = 0); C4JStorage::EMessageResult GetMessageBoxResult(); @@ -264,9 +264,10 @@ public: void* lpParam); // Get the thumbnail for an individual save referenced // by pSaveInfo - void GetSaveCacheFileInfo(DWORD dwFile, XCONTENT_DATA& xContentData); - void GetSaveCacheFileInfo(DWORD dwFile, PBYTE* ppbImageData, - DWORD* pdwImageBytes); + void GetSaveCacheFileInfo(unsigned int dwFile, XCONTENT_DATA& xContentData); + void GetSaveCacheFileInfo(unsigned int dwFile, + std::uint8_t** ppbImageData, + unsigned int* pdwImageBytes); // Load the save. Need to call GetSaveData once the callback is called C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo, diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index 5f7b78667..18bfb1415 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -558,7 +558,7 @@ void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {} #if defined(__linux__) C4JStorage::C4JStorage() {} void C4JStorage::Tick() {} -C4JStorage::EMessageResult C4JStorage::RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,DWORD dwFocusButton) { return C4JStorage::EMessage_Undefined; } +C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int dwPad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int dwFocusButton) { return C4JStorage::EMessage_Undefined; } C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() { return C4JStorage::EMessage_Undefined; } bool C4JStorage::SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice) { return true; } void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam) {} @@ -585,8 +585,8 @@ void C4JStorage::SetSaveMessageVPosition(float fY) {} //C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad,bool ( *Func)(LPVOID, int, CACHEINFOSTRUCT *, int, HRESULT),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESGIStatus_Idle; } C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_Idle; } -void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData) {} -void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes) {} +void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile,XCONTENT_DATA &xContentData) {} +void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile, std::uint8_t * *ppbImageData, unsigned int *pdwImageBytes) {} C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam) {return C4JStorage::ESaveGame_Idle;} C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam) { return C4JStorage::EDeleteGame_Idle; } PSAVE_DETAILS C4JStorage::ReturnSavesInfo() {return NULL;} From a0202d55c99cdeb4dd3c36dd60006953d04d4997 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:46:00 +1100 Subject: [PATCH 07/12] Remove WinAPI control types from DLC storage APIs --- 4J.Storage/4J_Storage.cpp | 18 +++++++++--------- 4J.Storage/4J_Storage.h | 19 ++++++++++--------- Minecraft.Client/Platform/Extrax64Stubs.cpp | 14 +++++++------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/4J.Storage/4J_Storage.cpp b/4J.Storage/4J_Storage.cpp index 13524a91d..156552f9d 100644 --- a/4J.Storage/4J_Storage.cpp +++ b/4J.Storage/4J_Storage.cpp @@ -124,34 +124,34 @@ void C4JStorage::RegisterMarketplaceCountsCallback( void C4JStorage::SetDLCPackageRoot(char* pszDLCRoot) {} C4JStorage::EDLCStatus C4JStorage::GetDLCOffers( int iPad, int (*Func)(void*, int, std::uint32_t, int), void* lpParam, - DWORD dwOfferTypesBitmask) { + std::uint32_t dwOfferTypesBitmask) { return EDLC_NoOffers; } -DWORD C4JStorage::CancelGetDLCOffers() { return 0; } +unsigned int C4JStorage::CancelGetDLCOffers() { return 0; } void C4JStorage::ClearDLCOffers() {} -XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(DWORD dw) { +XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) { return s_dummyOffer; } int C4JStorage::GetOfferCount() { return 0; } -DWORD C4JStorage::InstallOffer(int iOfferIDC, __uint64* ullOfferIDA, - int (*Func)(void*, int, int), void* lpParam, - bool bTrial) { +unsigned int C4JStorage::InstallOffer(int iOfferIDC, __uint64* ullOfferIDA, + int (*Func)(void*, int, int), + void* lpParam, bool bTrial) { return 0; } -DWORD C4JStorage::GetAvailableDLCCount(int iPad) { return 0; } +unsigned int C4JStorage::GetAvailableDLCCount(int iPad) { return 0; } C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad, int (*Func)(void*, int, int), void* lpParam) { return EDLC_NoInstalledDLC; } -XCONTENT_DATA& C4JStorage::GetDLC(DWORD dw) { return s_dummyContentData; } +XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { return s_dummyContentData; } std::uint32_t C4JStorage::MountInstalledDLC( int iPad, std::uint32_t dwDLC, int (*Func)(void*, int, std::uint32_t, std::uint32_t), void* lpParam, LPCSTR szMountDrive) { return 0; } -DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; } +unsigned int C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; } void C4JStorage::GetMountedDLCFileList(const char* szMountDrive, std::vector& fileList) { fileList.clear(); diff --git a/4J.Storage/4J_Storage.h b/4J.Storage/4J_Storage.h index 8bc90ceb7..c5680846c 100644 --- a/4J.Storage/4J_Storage.h +++ b/4J.Storage/4J_Storage.h @@ -286,25 +286,26 @@ public: void SetDLCPackageRoot(char* pszDLCRoot); C4JStorage::EDLCStatus GetDLCOffers( int iPad, int (*Func)(void*, int, std::uint32_t, int), void* lpParam, - DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT); - DWORD CancelGetDLCOffers(); + std::uint32_t dwOfferTypesBitmask = + XMARKETPLACE_OFFERING_TYPE_CONTENT); + unsigned int CancelGetDLCOffers(); void ClearDLCOffers(); - XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); + XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned int dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC, __uint64* ullOfferIDA, - int (*Func)(void*, int, int), void* lpParam, - bool bTrial = false); - DWORD GetAvailableDLCCount(int iPad); + unsigned int InstallOffer(int iOfferIDC, __uint64* ullOfferIDA, + int (*Func)(void*, int, int), void* lpParam, + bool bTrial = false); + unsigned int GetAvailableDLCCount(int iPad); C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int (*Func)(void*, int, int), void* lpParam); - XCONTENT_DATA& GetDLC(DWORD dw); + XCONTENT_DATA& GetDLC(unsigned int dw); std::uint32_t MountInstalledDLC(int iPad, std::uint32_t dwDLC, int (*Func)(void*, int, std::uint32_t, std::uint32_t), void* lpParam, LPCSTR szMountDrive = NULL); - DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL); + unsigned int UnmountInstalledDLC(LPCSTR szMountDrive = NULL); void GetMountedDLCFileList(const char* szMountDrive, std::vector& fileList); std::string GetMountedPath(std::string szMount); diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index 18bfb1415..b7304721e 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -593,17 +593,17 @@ PSAVE_DETAILS C4JStorage::ReturnSavesInfo() {return NULL;} void C4JStorage::RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ) {} void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot) {} -C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad,int( *Func)(void *, int, std::uint32_t, int),void *lpParam, DWORD dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; } -DWORD C4JStorage::CancelGetDLCOffers() { return 0; } +C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad,int( *Func)(void *, int, std::uint32_t, int),void *lpParam, std::uint32_t dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; } +unsigned int C4JStorage::CancelGetDLCOffers() { return 0; } void C4JStorage::ClearDLCOffers() {} -XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(DWORD dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; } +XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; } int C4JStorage::GetOfferCount() { return 0; } -DWORD C4JStorage::InstallOffer(int iOfferIDC,ULONGLONG *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial) { return 0; } -DWORD C4JStorage::GetAvailableDLCCount( int iPad) { return 0; } -XCONTENT_DATA& C4JStorage::GetDLC(DWORD dw) { static XCONTENT_DATA retval = {0}; return retval; } +unsigned int C4JStorage::InstallOffer(int iOfferIDC,ULONGLONG *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial) { return 0; } +unsigned int C4JStorage::GetAvailableDLCCount( int iPad) { return 0; } +XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { static XCONTENT_DATA retval = {0}; return retval; } C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam) { return C4JStorage::EDLC_Idle; } std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,LPCSTR szMountDrive) { return 0; } -DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; } +unsigned int C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; } C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int dwBufferSize) { return true; } bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; } From 3a98ff640c0579ad29197f25ee07bf6bc68f6397 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:49:34 +1100 Subject: [PATCH 08/12] Remove WinAPI primitives from common app helpers --- 4J.Storage/4J_Storage.h | 2 +- Minecraft.Client/Platform/Common/Consoles_App.cpp | 6 +++--- Minecraft.Client/Platform/Common/Consoles_App.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/4J.Storage/4J_Storage.h b/4J.Storage/4J_Storage.h index c5680846c..31da79d91 100644 --- a/4J.Storage/4J_Storage.h +++ b/4J.Storage/4J_Storage.h @@ -329,7 +329,7 @@ public: C4JStorage::ETMSStatus WriteTMSFile( int iPad, C4JStorage::eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType, CHAR* pchFilePath, CHAR* pchBuffer, - DWORD dwBufferSize, TMSCLIENT_CALLBACK Func, LPVOID lpParam); + unsigned int dwBufferSize, TMSCLIENT_CALLBACK Func, LPVOID lpParam); HRESULT GetUserQuotaInfo(int iPad, TMSCLIENT_CALLBACK Func, LPVOID lpParam); #endif diff --git a/Minecraft.Client/Platform/Common/Consoles_App.cpp b/Minecraft.Client/Platform/Common/Consoles_App.cpp index 33d0f34f5..31356c7ae 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.cpp +++ b/Minecraft.Client/Platform/Common/Consoles_App.cpp @@ -5285,8 +5285,8 @@ int CMinecraftApp::DLCMountedCallback(void *pParam,int iPad,std::uint32_t dwErr, m_Time.qwAppTime.QuadPart += qwDeltaTime.QuadPart; m_Time.qwTime.QuadPart = qwNewTime.QuadPart; - m_Time.fElapsedTime = m_Time.fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); - m_Time.fAppTime = m_Time.fSecsPerTick * ((FLOAT)(m_Time.qwAppTime.QuadPart)); + m_Time.fElapsedTime = m_Time.fSecsPerTick * static_cast(qwDeltaTime.QuadPart); + m_Time.fAppTime = m_Time.fSecsPerTick * static_cast(m_Time.qwAppTime.QuadPart); } @@ -6099,7 +6099,7 @@ std::wstring CMinecraftApp::FormatHTMLString(int iPad, const std::wstring &desc, #endif // _XBOX // Fix for #8903 - UI: Localization: KOR/JPN/CHT: Button Icons are rendered with padding space, which looks no good - DWORD dwLanguage = XGetLanguage( ); + std::uint32_t dwLanguage = XGetLanguage( ); switch(dwLanguage) { case XC_LANGUAGE_KOREAN: diff --git a/Minecraft.Client/Platform/Common/Consoles_App.h b/Minecraft.Client/Platform/Common/Consoles_App.h index e044f7a19..c96534ec5 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.h +++ b/Minecraft.Client/Platform/Common/Consoles_App.h @@ -291,7 +291,7 @@ public: static void NotificationsCallback(void *pParam,std::uint32_t dwNotification, unsigned int uiParam); // for the ethernet being disconnected - static void LiveLinkChangeCallback(void *pParam,BOOL bConnected); + static void LiveLinkChangeCallback(void *pParam, bool bConnected); bool GetLiveLinkRequired() {return m_bLiveLinkRequired;} void SetLiveLinkRequired(bool required) {m_bLiveLinkRequired=required;} From 506964f2b423706cebaf3280d84aa5f29a30afcc Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:52:17 +1100 Subject: [PATCH 09/12] Remove WinAPI byte allocation in common app --- Minecraft.Client/Platform/Common/Consoles_App.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Minecraft.Client/Platform/Common/Consoles_App.cpp b/Minecraft.Client/Platform/Common/Consoles_App.cpp index 31356c7ae..efd60a871 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.cpp +++ b/Minecraft.Client/Platform/Common/Consoles_App.cpp @@ -5353,8 +5353,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t // add this texture to the list of memory texture files - it will then be picked up by the level renderer's AddEntity - pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)]; - ZeroMemory( pData, sizeof(MEMDATA) ); + pData = new MEMDATA(); pData->pbData=pbData; pData->dwBytes=dwBytes; pData->ucRefCount = 1; @@ -5382,7 +5381,7 @@ void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring &wName) #ifndef _CONTENT_PACKAGE wprintf(L"Erasing the memory texture file data for %ls\n", wName.c_str()); #endif - delete [] pData; + delete pData; m_MEM_Files.erase(wName); } } @@ -5435,8 +5434,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned AUTO_VAR(it, m_MEM_TPD.find(iConfig)); if(it == m_MEM_TPD.end()) { - pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)]; - ZeroMemory( pData, sizeof(MEMDATA) ); + pData = new MEMDATA(); pData->pbData=pbData; pData->dwBytes=dwBytes; pData->ucRefCount = 1; @@ -5456,7 +5454,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) if(it != m_MEM_TPD.end()) { pData=m_MEM_TPD[iConfig]; - delete [] pData; + delete pData; m_MEM_TPD.erase(iConfig); } From 4f5695d4afa113d46cee3551919aa469df2aaff7 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:55:38 +1100 Subject: [PATCH 10/12] Use standard wait result types in C4JThread --- Minecraft.World/Util/C4JThread.cpp | 18 +++++++++--------- Minecraft.World/Util/C4JThread.h | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Minecraft.World/Util/C4JThread.cpp b/Minecraft.World/Util/C4JThread.cpp index dbf88da0d..54e856a2a 100644 --- a/Minecraft.World/Util/C4JThread.cpp +++ b/Minecraft.World/Util/C4JThread.cpp @@ -383,7 +383,7 @@ void C4JThread::SetPriority(int priority) { #endif // __PS3__ } -DWORD C4JThread::WaitForCompletion(int timeoutMs) { +std::uint32_t C4JThread::WaitForCompletion(int timeoutMs) { #ifdef __PS3__ if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT; return m_completionFlag->WaitForSignal(timeoutMs); @@ -543,7 +543,7 @@ void C4JThread::Event::Clear() { #endif //__PS3__ } -DWORD C4JThread::Event::WaitForSignal(int timeoutMs) { +std::uint32_t C4JThread::Event::WaitForSignal(int timeoutMs) { #ifdef __PS3__ if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT; int timoutMicrosecs = timeoutMs * 1000; @@ -685,8 +685,8 @@ void C4JThread::EventArray::ClearAll() { for (int i = 0; i < m_size; i++) Clear(i); } -DWORD C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) { - DWORD retVal; +std::uint32_t C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) { + std::uint32_t retVal; #ifdef __PS3__ int timeoutMicrosecs; if (timeoutMs == INFINITE) @@ -777,8 +777,8 @@ DWORD C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) { return retVal; } -DWORD C4JThread::EventArray::WaitForAll(int timeoutMs) { - DWORD retVal; +std::uint32_t C4JThread::EventArray::WaitForAll(int timeoutMs) { + std::uint32_t retVal; #ifdef __PS3__ if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT; int timoutMicrosecs = timeoutMs * 1000; @@ -871,7 +871,7 @@ DWORD C4JThread::EventArray::WaitForAll(int timeoutMs) { return retVal; } -DWORD C4JThread::EventArray::WaitForAny(int timeoutMs) { +std::uint32_t C4JThread::EventArray::WaitForAny(int timeoutMs) { #ifdef __PS3__ if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT; int timoutMicrosecs = timeoutMs * 1000; @@ -1015,7 +1015,7 @@ void C4JThread::EventQueue::threadPoll() { if (m_threadInitFunc) m_threadInitFunc(); while (ShutdownManager::ShouldRun(ShutdownManager::eEventQueueThreads)) { - DWORD err = m_startEvent->WaitForAny(INFINITE); + std::uint32_t err = m_startEvent->WaitForAny(INFINITE); if (err == WAIT_OBJECT_0) { bool bListEmpty = true; do { @@ -1060,4 +1060,4 @@ void C4JThread::PopAffinity() { assert(err == SCE_OK); } -#endif // __ORBIS__ \ No newline at end of file +#endif // __ORBIS__ diff --git a/Minecraft.World/Util/C4JThread.h b/Minecraft.World/Util/C4JThread.h index cf0d6e43e..725fe5db3 100644 --- a/Minecraft.World/Util/C4JThread.h +++ b/Minecraft.World/Util/C4JThread.h @@ -64,7 +64,7 @@ public: ~Event(); void Set(); void Clear(); - DWORD WaitForSignal(int timeoutMs); + std::uint32_t WaitForSignal(int timeoutMs); private: EMode m_mode; @@ -89,9 +89,9 @@ public: void Clear(int index); void SetAll(); void ClearAll(); - DWORD WaitForAll(int timeoutMs); - DWORD WaitForAny(int timeoutMs); - DWORD WaitForSingle(int index, int timeoutMs); + std::uint32_t WaitForAll(int timeoutMs); + std::uint32_t WaitForAny(int timeoutMs); + std::uint32_t WaitForSingle(int index, int timeoutMs); #ifdef __PS3__ void Cancel(); #endif @@ -153,7 +153,7 @@ public: bool hasStarted() { return m_hasStarted; } void SetProcessor(int proc); void SetPriority(int priority); - DWORD WaitForCompletion(int timeoutMs); + std::uint32_t WaitForCompletion(int timeoutMs); int GetExitCode(); char* getName() { return m_threadName; } static void Sleep(int millisecs); From 7feae96ceb0227a078ec41a0d9f77d4f745dcd58 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 04:57:54 +1100 Subject: [PATCH 11/12] Use standard thread IDs in C4JThread --- Minecraft.World/Util/C4JThread.cpp | 6 ++++-- Minecraft.World/Util/C4JThread.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Minecraft.World/Util/C4JThread.cpp b/Minecraft.World/Util/C4JThread.cpp index 54e856a2a..7577e8d4d 100644 --- a/Minecraft.World/Util/C4JThread.cpp +++ b/Minecraft.World/Util/C4JThread.cpp @@ -113,8 +113,10 @@ C4JThread::C4JThread(C4JThreadStartFunc* startFunc, void* param, #else m_threadID = 0; m_threadHandle = 0; + DWORD threadID = 0; m_threadHandle = CreateThread(NULL, m_stackSize, entryPoint, this, - CREATE_SUSPENDED, &m_threadID); + CREATE_SUSPENDED, &threadID); + m_threadID = threadID; #endif EnterCriticalSection(&ms_threadListCS); ms_threadList.push_back(this); @@ -454,7 +456,7 @@ C4JThread* C4JThread::getCurrentThread() { #elif defined __PSVITA__ SceUID currThreadID = sceKernelGetThreadId(); #else - DWORD currThreadID = GetCurrentThreadId(); + std::uint32_t currThreadID = GetCurrentThreadId(); #endif //__PS3__ EnterCriticalSection(&ms_threadListCS); diff --git a/Minecraft.World/Util/C4JThread.h b/Minecraft.World/Util/C4JThread.h index 725fe5db3..c2a1b9b34 100644 --- a/Minecraft.World/Util/C4JThread.h +++ b/Minecraft.World/Util/C4JThread.h @@ -210,7 +210,7 @@ private: int m_priority; static SceInt32 entryPoint(SceSize argSize, void* pArgBlock); #else - DWORD m_threadID; + std::uint32_t m_threadID; HANDLE m_threadHandle; Event* m_completionFlag; static DWORD WINAPI entryPoint(LPVOID lpParam); From 4866a895dce95aa7bd56268dd1059afbd1ec210e Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Mon, 16 Mar 2026 05:30:42 +1100 Subject: [PATCH 12/12] Rename misleading DWORD-style count parameters --- 4J.Render/4J_Render.cpp | 4 +- 4J.Render/4J_Render.h | 2 +- 4J.Storage/4J_Storage.cpp | 22 +++++------ 4J.Storage/4J_Storage.h | 24 ++++++------ .../Platform/Common/App_structs.h | 4 +- .../Platform/Common/Consoles_App.cpp | 38 +++++++++---------- .../Platform/Common/Consoles_App.h | 12 +++--- Minecraft.Client/Platform/Extrax64Stubs.cpp | 10 ++--- 8 files changed, 58 insertions(+), 58 deletions(-) diff --git a/4J.Render/4J_Render.cpp b/4J.Render/4J_Render.cpp index 99b7879d6..841e3a7af 100644 --- a/4J.Render/4J_Render.cpp +++ b/4J.Render/4J_Render.cpp @@ -696,12 +696,12 @@ HRESULT C4JRender::LoadTextureData(const char* szFilename, } HRESULT C4JRender::LoadTextureData(std::uint8_t* pbData, - std::uint32_t dwBytes, + std::uint32_t byteCount, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut) { int width, height, channels; unsigned char* data = - stbi_load_from_memory(pbData, dwBytes, &width, &height, &channels, 4); + stbi_load_from_memory(pbData, byteCount, &width, &height, &channels, 4); if (!data) return E_FAIL; HRESULT hr = LoadFromSTB(data, width, height, pSrcInfo, ppDataOut); diff --git a/4J.Render/4J_Render.h b/4J.Render/4J_Render.h index 05a43958b..520fe165a 100644 --- a/4J.Render/4J_Render.h +++ b/4J.Render/4J_Render.h @@ -171,7 +171,7 @@ public: void TextureDynamicUpdateEnd(); HRESULT LoadTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut); - HRESULT LoadTextureData(std::uint8_t* pbData, std::uint32_t dwBytes, + HRESULT LoadTextureData(std::uint8_t* pbData, std::uint32_t byteCount, D3DXIMAGE_INFO* pSrcInfo, int** ppDataOut); HRESULT SaveTextureData(const char* szFilename, D3DXIMAGE_INFO* pSrcInfo, int* ppDataOut); diff --git a/4J.Storage/4J_Storage.cpp b/4J.Storage/4J_Storage.cpp index 156552f9d..ddd73e88f 100644 --- a/4J.Storage/4J_Storage.cpp +++ b/4J.Storage/4J_Storage.cpp @@ -14,10 +14,10 @@ void C4JStorage::Tick(void) {} C4JStorage::EMessageResult C4JStorage::RequestMessageBox( unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA, - unsigned int uiOptionC, unsigned int dwPad, + unsigned int uiOptionC, unsigned int pad, int (*Func)(void*, int, const C4JStorage::EMessageResult), void* lpParam, C4JStringTable* pStringTable, WCHAR* pwchFormatString, - unsigned int dwFocusButton) { + unsigned int focusButton) { return EMessage_ResultAccept; } @@ -59,11 +59,11 @@ PVOID C4JStorage::AllocateSaveData(unsigned int uiBytes) { return malloc(uiBytes); } void C4JStorage::SetSaveImages(std::uint8_t* pbThumbnail, - unsigned int dwThumbnailBytes, + unsigned int thumbnailBytes, std::uint8_t* pbImage, - unsigned int dwImageBytes, + unsigned int imageBytes, std::uint8_t* pbTextData, - unsigned int dwTextDataBytes) {} + unsigned int textDataBytes) {} C4JStorage::ESaveGameState C4JStorage::SaveSaveData(int (*Func)(void*, const bool), void* lpParam) { @@ -97,15 +97,15 @@ C4JStorage::ESaveGameState C4JStorage::LoadSaveDataThumbnail( void* lpParam) { return ESaveGame_Idle; } -void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile, +void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex, XCONTENT_DATA& xContentData) { memset(&xContentData, 0, sizeof(xContentData)); } -void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile, +void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex, std::uint8_t** ppbImageData, - unsigned int* pdwImageBytes) { + unsigned int* pImageBytes) { if (ppbImageData) *ppbImageData = nullptr; - if (pdwImageBytes) *pdwImageBytes = 0; + if (pImageBytes) *pImageBytes = 0; } C4JStorage::ESaveGameState C4JStorage::LoadSaveData( PSAVE_INFO pSaveInfo, int (*Func)(void* lpParam, const bool, const bool), @@ -160,13 +160,13 @@ std::string C4JStorage::GetMountedPath(std::string szMount) { return ""; } C4JStorage::ETMSStatus C4JStorage::ReadTMSFile( int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename, - std::uint8_t** ppBuffer, unsigned int* pdwBufferSize, + std::uint8_t** ppBuffer, unsigned int* pBufferSize, int (*Func)(void*, WCHAR*, int, bool, int), void* lpParam, int iAction) { return ETMSStatus_Fail; } bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR* pwchFilename, std::uint8_t* pBuffer, - unsigned int dwBufferSize) { + unsigned int bufferSize) { return false; } bool C4JStorage::DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, diff --git a/4J.Storage/4J_Storage.h b/4J.Storage/4J_Storage.h index 31da79d91..199128b73 100644 --- a/4J.Storage/4J_Storage.h +++ b/4J.Storage/4J_Storage.h @@ -189,7 +189,7 @@ public: } TMSPP_FILE_LIST, *PTMSPP_FILE_LIST; typedef struct { - unsigned int dwSize; + unsigned int size; std::uint8_t* pbData; } TMSPP_FILEDATA, *PTMSPP_FILEDATA; @@ -200,10 +200,10 @@ public: // Messages C4JStorage::EMessageResult RequestMessageBox( unsigned int uiTitle, unsigned int uiText, unsigned int* uiOptionA, - unsigned int uiOptionC, unsigned int dwPad = XUSER_INDEX_ANY, + unsigned int uiOptionC, unsigned int pad = XUSER_INDEX_ANY, int (*Func)(void*, int, const C4JStorage::EMessageResult) = NULL, void* lpParam = NULL, C4JStringTable* pStringTable = NULL, - WCHAR* pwchFormatString = NULL, unsigned int dwFocusButton = 0); + WCHAR* pwchFormatString = NULL, unsigned int focusButton = 0); C4JStorage::EMessageResult GetMessageBoxResult(); @@ -231,10 +231,10 @@ public: void GetSaveData(void* pvData, unsigned int* puiBytes); PVOID AllocateSaveData(unsigned int uiBytes); void SetSaveImages( - std::uint8_t* pbThumbnail, unsigned int dwThumbnailBytes, - std::uint8_t* pbImage, unsigned int dwImageBytes, + std::uint8_t* pbThumbnail, unsigned int thumbnailBytes, + std::uint8_t* pbImage, unsigned int imageBytes, std::uint8_t* pbTextData, - unsigned int dwTextDataBytes); // Sets the thumbnail & image for the + unsigned int textDataBytes); // Sets the thumbnail & image for the // save, optionally setting the // metadata in the png C4JStorage::ESaveGameState SaveSaveData(int (*Func)(void*, const bool), @@ -264,10 +264,10 @@ public: void* lpParam); // Get the thumbnail for an individual save referenced // by pSaveInfo - void GetSaveCacheFileInfo(unsigned int dwFile, XCONTENT_DATA& xContentData); - void GetSaveCacheFileInfo(unsigned int dwFile, + void GetSaveCacheFileInfo(unsigned int fileIndex, XCONTENT_DATA& xContentData); + void GetSaveCacheFileInfo(unsigned int fileIndex, std::uint8_t** ppbImageData, - unsigned int* pdwImageBytes); + unsigned int* pImageBytes); // Load the save. Need to call GetSaveData once the callback is called C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo, @@ -314,12 +314,12 @@ public: C4JStorage::ETMSStatus ReadTMSFile( int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType, WCHAR* pwchFilename, - std::uint8_t** ppBuffer, unsigned int* pdwBufferSize, + std::uint8_t** ppBuffer, unsigned int* pBufferSize, int (*Func)(void*, WCHAR*, int, bool, int) = NULL, void* lpParam = NULL, int iAction = 0); bool WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR* pwchFilename, std::uint8_t* pBuffer, - unsigned int dwBufferSize); + unsigned int bufferSize); bool DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR* pwchFilename); void StoreTMSPathName(WCHAR* pwchName = NULL); @@ -329,7 +329,7 @@ public: C4JStorage::ETMSStatus WriteTMSFile( int iPad, C4JStorage::eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType, CHAR* pchFilePath, CHAR* pchBuffer, - unsigned int dwBufferSize, TMSCLIENT_CALLBACK Func, LPVOID lpParam); + unsigned int bufferSize, TMSCLIENT_CALLBACK Func, LPVOID lpParam); HRESULT GetUserQuotaInfo(int iPad, TMSCLIENT_CALLBACK Func, LPVOID lpParam); #endif diff --git a/Minecraft.Client/Platform/Common/App_structs.h b/Minecraft.Client/Platform/Common/App_structs.h index e73248d9e..40bca2709 100644 --- a/Minecraft.Client/Platform/Common/App_structs.h +++ b/Minecraft.Client/Platform/Common/App_structs.h @@ -16,7 +16,7 @@ TMS_FILE; typedef struct { std::uint8_t *pbData; - unsigned int dwBytes; + unsigned int byteCount; std::uint8_t ucRefCount; } MEMDATA,*PMEMDATA; @@ -197,7 +197,7 @@ FEATURE_DATA; typedef struct { std::uint8_t *pBannedList; - unsigned int dwBytes; + unsigned int byteCount; } BANNEDLIST; diff --git a/Minecraft.Client/Platform/Common/Consoles_App.cpp b/Minecraft.Client/Platform/Common/Consoles_App.cpp index efd60a871..dc6d4e281 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.cpp +++ b/Minecraft.Client/Platform/Common/Consoles_App.cpp @@ -5319,7 +5319,7 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid) return false; } -void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes) +void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int byteCount) { EnterCriticalSection(&csMemFilesLock); // check it's not already in @@ -5332,13 +5332,13 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t #endif pData = (*it).second; - if(pData->dwBytes == 0 && dwBytes != 0) + if(pData->byteCount == 0 && byteCount != 0) { - // This should never be NULL if dwBytes is 0 + // This should never be NULL if byteCount is 0 if(pData->pbData!=NULL) delete [] pData->pbData; pData->pbData=pbData; - pData->dwBytes=dwBytes; + pData->byteCount=byteCount; } ++pData->ucRefCount; @@ -5355,7 +5355,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t pData = new MEMDATA(); pData->pbData=pbData; - pData->dwBytes=dwBytes; + pData->byteCount=byteCount; pData->ucRefCount = 1; // use the xuid to access the skin data @@ -5413,7 +5413,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring &wName) return val; } -void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes) +void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pByteCount) { EnterCriticalSection(&csMemFilesLock); AUTO_VAR(it, m_MEM_Files.find(wName)); @@ -5421,12 +5421,12 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t ** { PMEMDATA pData = (*it).second; *ppbData=pData->pbData; - *pdwBytes=pData->dwBytes; + *pByteCount=pData->byteCount; } LeaveCriticalSection(&csMemFilesLock); } -void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes) +void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int byteCount) { EnterCriticalSection(&csMemTPDLock); // check it's not already in @@ -5436,7 +5436,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned { pData = new MEMDATA(); pData->pbData=pbData; - pData->dwBytes=dwBytes; + pData->byteCount=byteCount; pData->ucRefCount = 1; m_MEM_TPD[iConfig]=pData; @@ -5514,7 +5514,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) return val; } -void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes) +void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pByteCount) { EnterCriticalSection(&csMemTPDLock); AUTO_VAR(it, m_MEM_TPD.find(iConfig)); @@ -5522,7 +5522,7 @@ void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pd { PMEMDATA pData = (*it).second; *ppbData=pData->pbData; - *pdwBytes=pData->dwBytes; + *pByteCount=pData->byteCount; } LeaveCriticalSection(&csMemTPDLock); } @@ -8332,14 +8332,14 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor case e_DLC_TexturePackData: { // 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory - std::uint8_t *pbData = new std::uint8_t[pFileData->dwSize]; - memcpy(pbData,pFileData->pbData,pFileData->dwSize); + std::uint8_t *pbData = new std::uint8_t[pFileData->size]; + memcpy(pbData,pFileData->pbData,pFileData->size); pClass->m_vTMSPPData.push_back(pbData); app.DebugPrintf("Got texturepack data\n"); // get the config value for the texture pack int iConfig=app.GetTPConfigVal(pCurrent->wchFilename); - app.AddMemoryTPDFile(iConfig, pbData, pFileData->dwSize); + app.AddMemoryTPDFile(iConfig, pbData, pFileData->size); } break; default: @@ -8347,12 +8347,12 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor if(pFileData->pbData[0]==0x89) { // 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory - std::uint8_t *pbData = new std::uint8_t[pFileData->dwSize]; - memcpy(pbData,pFileData->pbData,pFileData->dwSize); + std::uint8_t *pbData = new std::uint8_t[pFileData->size]; + memcpy(pbData,pFileData->pbData,pFileData->size); pClass->m_vTMSPPData.push_back(pbData); app.DebugPrintf("Got image data - %ls\n",pCurrent->wchFilename); - app.AddMemoryTextureFile(pCurrent->wchFilename, pbData, pFileData->dwSize); + app.AddMemoryTextureFile(pCurrent->wchFilename, pbData, pFileData->size); } else { @@ -8369,12 +8369,12 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor app.DebugPrintf("--- Got texturepack data %ls\n",pCurrent->wchFilename); // get the config value for the texture pack int iConfig=app.GetTPConfigVal(pCurrent->wchFilename); - app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->dwSize); + app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->size); } break; default: app.DebugPrintf("--- Got image data - %ls\n",pCurrent->wchFilename); - app.AddMemoryTextureFile(pCurrent->wchFilename, pFileData->pbData, pFileData->dwSize); + app.AddMemoryTextureFile(pCurrent->wchFilename, pFileData->pbData, pFileData->size); break; } #endif diff --git a/Minecraft.Client/Platform/Common/Consoles_App.h b/Minecraft.Client/Platform/Common/Consoles_App.h index c96534ec5..4b237a805 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.h +++ b/Minecraft.Client/Platform/Common/Consoles_App.h @@ -341,16 +341,16 @@ public: bool isXuidNotch(PlayerUID xuid); bool isXuidDeadmau5(PlayerUID xuid); - void AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes); + void AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int byteCount); void RemoveMemoryTextureFile(const std::wstring &wName); - void GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes); + void GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pByteCount); bool IsFileInMemoryTextures(const std::wstring &wName); // Texture Pack Data files (icon, banner, comparison shot & text) - void AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes); + void AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int byteCount); void RemoveMemoryTPDFile(int iConfig); bool IsFileInTPD(int iConfig); - void GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes); + void GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pByteCount); int GetTPDSize() {return m_MEM_TPD.size();} #ifndef __PS3__ int GetTPConfigVal(WCHAR *pwchDataFile); @@ -839,12 +839,12 @@ public: bool GetBanListRead(int iPad) { return m_bRead_BannedListA[iPad];} void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;} - void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;} + void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].byteCount=0;} std::uint32_t GetRequiredTexturePackID() { return m_dwRequiredTexturePackID; } void SetRequiredTexturePackID(std::uint32_t texturePackId) { m_dwRequiredTexturePackID = texturePackId; } - virtual void GetFileFromTPD(eTPDFileType eType, std::uint8_t *pbData, unsigned int dwBytes, std::uint8_t **ppbData, unsigned int *pdwBytes ) {*ppbData = NULL; *pdwBytes = 0;} + virtual void GetFileFromTPD(eTPDFileType eType, std::uint8_t *pbData, unsigned int byteCount, std::uint8_t **ppbData, unsigned int *pByteCount ) {*ppbData = NULL; *pByteCount = 0;} //XTITLE_DEPLOYMENT_TYPE getDeploymentType() { return m_titleDeploymentType; } diff --git a/Minecraft.Client/Platform/Extrax64Stubs.cpp b/Minecraft.Client/Platform/Extrax64Stubs.cpp index b7304721e..a0852745e 100644 --- a/Minecraft.Client/Platform/Extrax64Stubs.cpp +++ b/Minecraft.Client/Platform/Extrax64Stubs.cpp @@ -558,7 +558,7 @@ void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {} #if defined(__linux__) C4JStorage::C4JStorage() {} void C4JStorage::Tick() {} -C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int dwPad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int dwFocusButton) { return C4JStorage::EMessage_Undefined; } +C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int pad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int focusButton) { return C4JStorage::EMessage_Undefined; } C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() { return C4JStorage::EMessage_Undefined; } bool C4JStorage::SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice) { return true; } void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam) {} @@ -585,8 +585,8 @@ void C4JStorage::SetSaveMessageVPosition(float fY) {} //C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad,bool ( *Func)(LPVOID, int, CACHEINFOSTRUCT *, int, HRESULT),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESGIStatus_Idle; } C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_Idle; } -void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile,XCONTENT_DATA &xContentData) {} -void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile, std::uint8_t * *ppbImageData, unsigned int *pdwImageBytes) {} +void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,XCONTENT_DATA &xContentData) {} +void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex, std::uint8_t * *ppbImageData, unsigned int *pImageBytes) {} C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam) {return C4JStorage::ESaveGame_Idle;} C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam) { return C4JStorage::EDeleteGame_Idle; } PSAVE_DETAILS C4JStorage::ReturnSavesInfo() {return NULL;} @@ -604,8 +604,8 @@ XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { static XCONTENT_DATA r C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam) { return C4JStorage::EDLC_Idle; } std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,LPCSTR szMountDrive) { return 0; } unsigned int C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; } -C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } -bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int dwBufferSize) { return true; } +C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } +bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int bufferSize) { return true; } bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; } void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {} unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; }