mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Add additional bit utilities from SourceSDK
This commit is contained in:
parent
129637e8e6
commit
4ecf58f61c
1446
r5dev/mathlib/bitvec.h
Normal file
1446
r5dev/mathlib/bitvec.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -57,3 +57,55 @@ inline T QWordSwapC(T dw)
|
||||
|
||||
return *((T*)&swap);
|
||||
}
|
||||
|
||||
#if PLAT_BIG_ENDIAN
|
||||
#if defined( _PS3 )
|
||||
inline uint32 LoadLittleDWord(uint32* base, unsigned int dwordIndex)
|
||||
{
|
||||
return __lwbrx(base + dwordIndex);
|
||||
}
|
||||
|
||||
inline void StoreLittleDWord(uint32* base, unsigned int dwordIndex, uint32 dword)
|
||||
{
|
||||
__stwbrx(base + dwordIndex, dword);
|
||||
}
|
||||
inline uint64 LoadLittleInt64(uint64* base, unsigned int nWordIndex)
|
||||
{
|
||||
return __ldbrx(base + nWordIndex);
|
||||
}
|
||||
|
||||
inline void StoreLittleInt64(uint64* base, unsigned int nWordIndex, uint64 nWord)
|
||||
{
|
||||
__stdbrx(base + nWordIndex, nWord);
|
||||
}
|
||||
#else
|
||||
inline uint32 LoadLittleDWord(uint32* base, unsigned int dwordIndex)
|
||||
{
|
||||
return __loadwordbytereverse(dwordIndex << 2, base);
|
||||
}
|
||||
|
||||
inline void StoreLittleDWord(uint32* base, unsigned int dwordIndex, uint32 dword)
|
||||
{
|
||||
__storewordbytereverse(dword, dwordIndex << 2, base);
|
||||
}
|
||||
inline uint64 LoadLittleInt64(uint64* base, unsigned int nWordIndex)
|
||||
{
|
||||
return __loaddoublewordbytereverse(nWordIndex << 2, base);
|
||||
}
|
||||
|
||||
inline void StoreLittleInt64(uint64* base, unsigned int nWordIndex, uint64 nWord)
|
||||
{
|
||||
__storedoublewordbytereverse(nWord, nWordIndex << 2, base);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
inline uint32 LoadLittleDWord(uint32* base, unsigned int dwordIndex)
|
||||
{
|
||||
return LittleDWord(base[dwordIndex]);
|
||||
}
|
||||
|
||||
inline void StoreLittleDWord(uint32* base, unsigned int dwordIndex, uint32 dword)
|
||||
{
|
||||
base[dwordIndex] = LittleDWord(dword);
|
||||
}
|
||||
#endif
|
||||
|
4
r5dev/public/tier0/memdbgoff.h
Normal file
4
r5dev/public/tier0/memdbgoff.h
Normal file
@ -0,0 +1,4 @@
|
||||
#ifndef MEMDBGOFF_H
|
||||
#define MEMDBGOFF_H
|
||||
|
||||
#endif // MEMDBGOFF_H
|
@ -404,6 +404,14 @@ uint64_t Plat_MSTime();
|
||||
const char* Plat_GetProcessUpTime();
|
||||
void Plat_GetProcessUpTime(char* szBuf, size_t nSize);
|
||||
|
||||
#if defined( _X360 )
|
||||
#define Plat_FastMemset XMemSet
|
||||
#define Plat_FastMemcpy XMemCpy
|
||||
#else
|
||||
#define Plat_FastMemset memset
|
||||
#define Plat_FastMemcpy memcpy
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Silences a number of warnings on 360 compiles
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -271,6 +271,7 @@
|
||||
<ClInclude Include="..\materialsystem\cmaterialglue.h" />
|
||||
<ClInclude Include="..\materialsystem\cmaterialsystem.h" />
|
||||
<ClInclude Include="..\mathlib\adler32.h" />
|
||||
<ClInclude Include="..\mathlib\bitvec.h" />
|
||||
<ClInclude Include="..\mathlib\compressed_vector.h" />
|
||||
<ClInclude Include="..\mathlib\fbits.h" />
|
||||
<ClInclude Include="..\mathlib\color.h" />
|
||||
@ -365,6 +366,7 @@
|
||||
<ClInclude Include="..\public\tier0\frametask.h" />
|
||||
<ClInclude Include="..\public\tier0\jobthread.h" />
|
||||
<ClInclude Include="..\public\tier0\memalloc.h" />
|
||||
<ClInclude Include="..\public\tier0\memdbgoff.h" />
|
||||
<ClInclude Include="..\public\tier0\memdbgon.h" />
|
||||
<ClInclude Include="..\public\tier0\platform.h" />
|
||||
<ClInclude Include="..\public\tier0\platform_internal.h" />
|
||||
|
@ -1721,6 +1721,12 @@
|
||||
<ClInclude Include="..\public\tier2\curlutils.h">
|
||||
<Filter>sdk\public\tier2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\mathlib\bitvec.h">
|
||||
<Filter>sdk\mathlib</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\tier0\memdbgoff.h">
|
||||
<Filter>sdk\public\tier0</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\shared\resource\lockedserver.png">
|
||||
|
@ -278,6 +278,7 @@
|
||||
<ClInclude Include="..\launcher\prx.h" />
|
||||
<ClInclude Include="..\materialsystem\cmaterialsystem.h" />
|
||||
<ClInclude Include="..\mathlib\adler32.h" />
|
||||
<ClInclude Include="..\mathlib\bitvec.h" />
|
||||
<ClInclude Include="..\mathlib\compressed_vector.h" />
|
||||
<ClInclude Include="..\mathlib\fbits.h" />
|
||||
<ClInclude Include="..\mathlib\color.h" />
|
||||
@ -359,6 +360,7 @@
|
||||
<ClInclude Include="..\public\tier0\frametask.h" />
|
||||
<ClInclude Include="..\public\tier0\jobthread.h" />
|
||||
<ClInclude Include="..\public\tier0\memalloc.h" />
|
||||
<ClInclude Include="..\public\tier0\memdbgoff.h" />
|
||||
<ClInclude Include="..\public\tier0\memdbgon.h" />
|
||||
<ClInclude Include="..\public\tier0\platform.h" />
|
||||
<ClInclude Include="..\public\tier0\platform_internal.h" />
|
||||
|
@ -1131,6 +1131,12 @@
|
||||
<ClInclude Include="..\public\tier0\dbg.h">
|
||||
<Filter>sdk\public\tier0</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\mathlib\bitvec.h">
|
||||
<Filter>sdk\mathlib</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\tier0\memdbgoff.h">
|
||||
<Filter>sdk\public\tier0</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\common\opcodes.cpp">
|
||||
|
@ -315,6 +315,7 @@
|
||||
<ClInclude Include="..\materialsystem\cshaderglue.h" />
|
||||
<ClInclude Include="..\mathlib\adler32.h" />
|
||||
<ClInclude Include="..\mathlib\almostequal.cpp" />
|
||||
<ClInclude Include="..\mathlib\bitvec.h" />
|
||||
<ClInclude Include="..\mathlib\compressed_vector.h" />
|
||||
<ClInclude Include="..\mathlib\fbits.h" />
|
||||
<ClInclude Include="..\mathlib\color.h" />
|
||||
@ -419,6 +420,7 @@
|
||||
<ClInclude Include="..\public\tier0\frametask.h" />
|
||||
<ClInclude Include="..\public\tier0\jobthread.h" />
|
||||
<ClInclude Include="..\public\tier0\memalloc.h" />
|
||||
<ClInclude Include="..\public\tier0\memdbgoff.h" />
|
||||
<ClInclude Include="..\public\tier0\memdbgon.h" />
|
||||
<ClInclude Include="..\public\tier0\platform.h" />
|
||||
<ClInclude Include="..\public\tier0\platform_internal.h" />
|
||||
|
@ -1892,6 +1892,12 @@
|
||||
<ClInclude Include="..\public\tier2\curlutils.h">
|
||||
<Filter>sdk\public\tier2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\mathlib\bitvec.h">
|
||||
<Filter>sdk\mathlib</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\tier0\memdbgoff.h">
|
||||
<Filter>sdk\public\tier0</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\shared\resource\lockedserver.png">
|
||||
|
Loading…
x
Reference in New Issue
Block a user