From 7f71a9b980f2af4e40e118fe97e881f7f6319494 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Wed, 1 Apr 2026 01:16:47 -0500 Subject: [PATCH] remove more x64 stubs --- .../Common/Source Files/Colours/ColourTable.cpp | 2 +- .../Source Files/Extrax64Stubs.cpp | 10 ---------- .../ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp | 2 +- .../ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp | 2 +- .../world/level/chunk/CompressedTileStorage.cpp | 14 +++++++------- .../net/minecraft/world/level/chunk/LevelChunk.cpp | 4 ++-- .../world/level/chunk/SparseDataStorage.cpp | 14 +++++++------- .../world/level/chunk/SparseLightStorage.cpp | 14 +++++++------- .../world/level/levelgen/CustomLevelSource.cpp | 2 +- .../world/level/levelgen/FlatLevelSource.cpp | 2 +- .../world/level/levelgen/HellFlatLevelSource.cpp | 2 +- .../world/level/levelgen/HellRandomLevelSource.cpp | 2 +- .../world/level/levelgen/RandomLevelSource.cpp | 2 +- .../levelgen/TheEndLevelRandomLevelSource.cpp | 2 +- minecraft/Minecraft.World/x64headers/extraX64.h | 2 -- 15 files changed, 32 insertions(+), 44 deletions(-) diff --git a/minecraft/Minecraft.Client/Common/Source Files/Colours/ColourTable.cpp b/minecraft/Minecraft.Client/Common/Source Files/Colours/ColourTable.cpp index b105bd4d1..05ef7ec5b 100644 --- a/minecraft/Minecraft.Client/Common/Source Files/Colours/ColourTable.cpp +++ b/minecraft/Minecraft.Client/Common/Source Files/Colours/ColourTable.cpp @@ -343,7 +343,7 @@ ColourTable::ColourTable(std::uint8_t* pbData, std::uint32_t dataLength) { ColourTable::ColourTable(ColourTable* defaultColours, std::uint8_t* pbData, std::uint32_t dataLength) { // 4J Stu - Default the colours that of the table passed in - XMemCpy((void*)m_colourValues, (void*)defaultColours->m_colourValues, + memcpy((void*)m_colourValues, (void*)defaultColours->m_colourValues, sizeof(int) * eMinecraftColour_COUNT); loadColoursFromData(pbData, dataLength); } diff --git a/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp b/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp index 2b3b9f8ec..7c2c98360 100644 --- a/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp +++ b/minecraft/Minecraft.Client/Source Files/Extrax64Stubs.cpp @@ -34,25 +34,15 @@ void ATG::XMLParser::RegisterSAXCallbackInterface(ISAXCallback* pISAXCallback) { } #endif -uint32_t XShowPartyUI(uint32_t dwUserIndex) { return 0; } -uint32_t XShowFriendsUI(uint32_t dwUserIndex) { return 0; } int32_t XPartyGetUserList(void* pUserList) { return 0; } -uint32_t XContentGetThumbnail(uint32_t dwUserIndex, - const XCONTENT_DATA* pContentData, - uint8_t* pbThumbnail, uint32_t* pcbThumbnail, - PXOVERLAPPED* pOverlapped) { - return 0; -} bool IsEqualXUID(PlayerUID a, PlayerUID b) { return false; } -void XMemCpy(void* a, const void* b, size_t s) { memcpy(a, b, s); } void XMemSet(void* a, int t, size_t s) { memset(a, t, s); } void XMemSet128(void* a, int t, size_t s) { memset(a, t, s); } void* XPhysicalAlloc(size_t a, uintptr_t b, uintptr_t c, uint32_t d) { return malloc(a); } -void XPhysicalFree(void* a) { free(a); } D3DXVECTOR3::D3DXVECTOR3() {} D3DXVECTOR3::D3DXVECTOR3(float x, float y, float z) : x(x), y(y), z(z) {} diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp index 69918be42..72caf5007 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOriginal.cpp @@ -501,7 +501,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond( // Needs to be clamped to the end of our region uiCopyEnd = uiFromEnd; } - XMemCpy((void*)(uiCopyStart + nNumberOfBytesToWrite), + memcpy((void*)(uiCopyStart + nNumberOfBytesToWrite), (void*)uiCopyStart, uiCopyEnd - uiCopyStart); } } diff --git a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp index e6f703651..8c59c9f4c 100644 --- a/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp +++ b/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileSplit.cpp @@ -1100,7 +1100,7 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry* file, // Needs to be clamped to the end of our region uiCopyEnd = uiFromEnd; } - XMemCpy((void*)(uiCopyStart + nNumberOfBytesToWrite), + memcpy((void*)(uiCopyStart + nNumberOfBytesToWrite), (void*)uiCopyStart, uiCopyEnd - uiCopyStart); } } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.cpp index 67d769e8e..89c877c92 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/CompressedTileStorage.cpp @@ -50,7 +50,7 @@ CompressedTileStorage::CompressedTileStorage(CompressedTileStorage* copyFrom) { indicesAndData = (unsigned char*)XPhysicalAlloc( allocatedSize, MAXULONG_PTR, 4096, PAGE_READWRITE); //(unsigned char *)malloc(allocatedSize); - XMemCpy(indicesAndData, copyFrom->indicesAndData, allocatedSize); + memcpy(indicesAndData, copyFrom->indicesAndData, allocatedSize); } else { indicesAndData = nullptr; } @@ -195,7 +195,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage* other) { } CompressedTileStorage::~CompressedTileStorage() { - if (indicesAndData) XPhysicalFree(indicesAndData); + if (indicesAndData) free(indicesAndData); } // Get an index into the normal ordering of tiles for the java game, given a @@ -767,7 +767,7 @@ void CompressedTileStorage::tick() { do { toFree = deleteQueue[freeIndex].Pop(); // if( toFree ) printf("Deleting 0x%x\n", toFree); - if (toFree) XPhysicalFree(toFree); + if (toFree) free(toFree); } while (toFree); deleteQueueIndex = (deleteQueueIndex + 1) % 3; @@ -981,7 +981,7 @@ void CompressedTileStorage::compress(int upgradeBlock /*=-1*/) { INDEX_OFFSET_SHIFT) & INDEX_OFFSET_MASK); usDataOffset = (usDataOffset + 3) & 0xfffc; - XMemCpy(pucData + usDataOffset, packed_data, 64); + memcpy(pucData + usDataOffset, packed_data, 64); newIndices[i] |= (usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; usDataOffset += 64; @@ -1000,7 +1000,7 @@ void CompressedTileStorage::compress(int upgradeBlock /*=-1*/) { // store each tile type newIndices[i] |= (usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; - XMemCpy(pucData + usDataOffset, packed_data, dataSize); + memcpy(pucData + usDataOffset, packed_data, dataSize); usDataOffset += dataSize; done = true; } @@ -1072,7 +1072,7 @@ void CompressedTileStorage::compress(int upgradeBlock /*=-1*/) { usDataOffset = (usDataOffset + 3) & 0xfffc; // Make sure offset is 4 byte aligned - XMemCpy(pucData + usDataOffset, unpacked_data, 64); + memcpy(pucData + usDataOffset, unpacked_data, 64); newIndices[i] |= (usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; usDataOffset += 64; @@ -1229,7 +1229,7 @@ void CompressedTileStorage::read(DataInputStream* dis) { // chunk is fully read before any external reference is available to it // from another thread if (indicesAndData) { - XPhysicalFree(indicesAndData); + free(indicesAndData); } indicesAndData = (unsigned char*)XPhysicalAlloc( allocatedSize, MAXULONG_PTR, 4096, PAGE_READWRITE); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp index 49f9c4731..b3e078028 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/LevelChunk.cpp @@ -295,11 +295,11 @@ void LevelChunk::stopSharingTilesAndData() { /* newDataLayer = new DataLayer(skyLight->data.size()*2, level->depthBits); - XMemCpy(newDataLayer->data.data(), skyLight->data.data(), + memcpy(newDataLayer->data.data(), skyLight->data.data(), skyLight->data.size()); skyLight = newDataLayer; newDataLayer = new DataLayer(blockLight->data.size()*2, - level->depthBits); XMemCpy(newDataLayer->data.data(), + level->depthBits); memcpy(newDataLayer->data.data(), blockLight->data.data(), blockLight->data.size()); blockLight = newDataLayer; */ diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.cpp index da0b4b332..6323d1e7e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.cpp @@ -40,7 +40,7 @@ SparseDataStorage::SparseDataStorage() { // from the pool of 4KB pages, the address will in the range of // MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the // allocation later, and so free it with the corresponding call to - // XPhysicalFree. + // free. unsigned char* planeIndices = (unsigned char*)malloc(128 * 128); unsigned char* data = planeIndices + 128; planeIndices[0] = ALL_0_INDEX; @@ -65,7 +65,7 @@ SparseDataStorage::SparseDataStorage(bool isUpper) { // from the pool of 4KB pages, the address will in the range of // MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the // allocation later, and so free it with the corresponding call to - // XPhysicalFree. + // free. unsigned char* planeIndices = (unsigned char*)malloc(128); for (int i = 0; i < 128; i++) { planeIndices[i] = ALL_0_INDEX; @@ -114,7 +114,7 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage* copyFrom) { dataAndCount = (sourceDataAndCount & 0xffff000000000000L) | (((int64_t)destIndicesAndData) & 0x0000ffffffffffffL); - XMemCpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128); + memcpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128); #if defined(DATA_COMPRESSION_STATS) count = sourceCount; @@ -162,7 +162,7 @@ void SparseDataStorage::setData(std::vector& dataIn, unsigned int inOff unsigned char* planeIndices = (unsigned char*)malloc(128 * allocatedPlaneCount + 128); unsigned char* data = planeIndices + 128; - XMemCpy(planeIndices, _planeIndices, 128); + memcpy(planeIndices, _planeIndices, 128); // Second pass through to actually copy the data in to the storage allocated // for the required planes @@ -408,7 +408,7 @@ void SparseDataStorage::addNewPlane(int y) { // initialise remainder unsigned char* dataPointer = (unsigned char*)malloc(linesUsed * 128 + 128); - XMemCpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128); + memcpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128); XMemSet(dataPointer + (128 * lastLinesUsed) + 128, 0, 128); dataPointer[y] = lastLinesUsed; @@ -551,11 +551,11 @@ int SparseDataStorage::compress() { unsigned char* newIndicesAndData = (unsigned char*)malloc(128 + 128 * planesToAlloc); unsigned char* pucData = newIndicesAndData + 128; - XMemCpy(newIndicesAndData, _planeIndices, 128); + memcpy(newIndicesAndData, _planeIndices, 128); for (int i = 0; i < 128; i++) { if (newIndicesAndData[i] < ALL_0_INDEX) { - XMemCpy(pucData, &data[128 * planeIndices[i]], 128); + memcpy(pucData, &data[128 * planeIndices[i]], 128); pucData += 128; } } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.cpp index eabc8246b..0acb3002e 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.cpp @@ -41,7 +41,7 @@ SparseLightStorage::SparseLightStorage(bool sky) { // from the pool of 4KB pages, the address will in the range of // MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the // allocation later, and so free it with the corresponding call to - // XPhysicalFree. + // free. unsigned char* planeIndices = (unsigned char*)malloc(128 * 128); unsigned char* data = planeIndices + 128; planeIndices[127] = sky ? ALL_15_INDEX : ALL_0_INDEX; @@ -66,7 +66,7 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper) { // from the pool of 4KB pages, the address will in the range of // MM_PHYSICAL_4KB_BASE upwards. We can use this fact to identify the // allocation later, and so free it with the corresponding call to - // XPhysicalFree. + // free. unsigned char* planeIndices = (unsigned char*)malloc(128); for (int i = 0; i < 128; i++) { planeIndices[i] = sky ? ALL_15_INDEX : ALL_0_INDEX; @@ -115,7 +115,7 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage* copyFrom) { dataAndCount = (sourceDataAndCount & 0xffff000000000000L) | (((int64_t)destIndicesAndData) & 0x0000ffffffffffffL); - XMemCpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128); + memcpy(destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128); #if defined(LIGHT_COMPRESSION_STATS) count = sourceCount; @@ -164,7 +164,7 @@ void SparseLightStorage::setData(std::vector& dataIn, unsigned int inOf unsigned char* planeIndices = (unsigned char*)malloc(128 * allocatedPlaneCount + 128); unsigned char* data = planeIndices + 128; - XMemCpy(planeIndices, _planeIndices, 128); + memcpy(planeIndices, _planeIndices, 128); // Second pass through to actually copy the data in to the storage allocated // for the required planes @@ -411,7 +411,7 @@ void SparseLightStorage::addNewPlane(int y) { // initialise remainder unsigned char* dataPointer = (unsigned char*)malloc(linesUsed * 128 + 128); - XMemCpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128); + memcpy(dataPointer, lastDataPointer, 128 * lastLinesUsed + 128); XMemSet(dataPointer + (128 * lastLinesUsed) + 128, prefill, 128); dataPointer[y] = lastLinesUsed; @@ -561,11 +561,11 @@ int SparseLightStorage::compress() { unsigned char* newIndicesAndData = (unsigned char*)malloc(128 + 128 * planesToAlloc); unsigned char* pucData = newIndicesAndData + 128; - XMemCpy(newIndicesAndData, _planeIndices, 128); + memcpy(newIndicesAndData, _planeIndices, 128); for (int i = 0; i < 128; i++) { if (newIndicesAndData[i] < ALL_0_INDEX) { - XMemCpy(pucData, &data[128 * planeIndices[i]], 128); + memcpy(pucData, &data[128 * planeIndices[i]], 128); pucData += 128; } } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.cpp index 7b4d351ee..2d1b506e2 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/CustomLevelSource.cpp @@ -395,7 +395,7 @@ LevelChunk* CustomLevelSource::getChunk(int xOffs, int zOffs) { // now need to free the passed in blocks as the LevelChunk doesn't use the // passed in allocation anymore. LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); - XPhysicalFree(tileData); + free(tileData); return levelChunk; #else diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.cpp index 2953aeb72..17ce4ffa6 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/FlatLevelSource.cpp @@ -79,7 +79,7 @@ LevelChunk* FlatLevelSource::getChunk(int xOffs, int zOffs) { // now need to free the passed in blocks as the LevelChunk doesn't use the // passed in allocation anymore. LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); - XPhysicalFree(tileData); + free(tileData); levelChunk->recalcHeightmap(); diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.cpp index a0fe53766..c48e3b71a 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellFlatLevelSource.cpp @@ -125,7 +125,7 @@ LevelChunk* HellFlatLevelSource::getChunk(int xOffs, int zOffs) { // passed in blocks as the LevelChunk doesn't use the passed in allocation // anymore. LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); - XPhysicalFree(tileData); + free(tileData); return levelChunk; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp index 28b3c45c2..d2294c9da 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.cpp @@ -322,7 +322,7 @@ LevelChunk* HellRandomLevelSource::getChunk(int xOffs, int zOffs) { // anymore. LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); levelChunk->setCheckAllLight(); - XPhysicalFree(tileData); + free(tileData); return levelChunk; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.cpp index 6b79b74ca..6be3f9773 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/RandomLevelSource.cpp @@ -520,7 +520,7 @@ LevelChunk* RandomLevelSource::getChunk(int xOffs, int zOffs) { // now need to free the passed in blocks as the LevelChunk doesn't use the // passed in allocation anymore. LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); - XPhysicalFree(tileData); + free(tileData); return levelChunk; } diff --git a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.cpp b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.cpp index 4c76a4e99..7eb9ba07f 100644 --- a/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.cpp +++ b/minecraft/Minecraft.World/net/minecraft/world/level/levelgen/TheEndLevelRandomLevelSource.cpp @@ -196,7 +196,7 @@ LevelChunk* TheEndLevelRandomLevelSource::getChunk(int xOffs, int zOffs) { // now need to free the passed in blocks as the LevelChunk doesn't use the // passed in allocation anymore. LevelChunk* levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); - XPhysicalFree(tileData); + free(tileData); levelChunk->recalcHeightmap(); diff --git a/minecraft/Minecraft.World/x64headers/extraX64.h b/minecraft/Minecraft.World/x64headers/extraX64.h index 6b5162da6..cbadaf7a5 100644 --- a/minecraft/Minecraft.World/x64headers/extraX64.h +++ b/minecraft/Minecraft.World/x64headers/extraX64.h @@ -56,11 +56,9 @@ public: } }; -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); void* XPhysicalAlloc(size_t a, uintptr_t b, uintptr_t c, uint32_t d); -void XPhysicalFree(void* a); class DLCManager; class LevelRuleset;