mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-10-01 12:30:00 +02:00
3615a70cae
This reverts commit 85dbb9559a
.
17 lines
518 B
C#
17 lines
518 B
C#
namespace Ryujinx.HLE.Utilities
|
|
{
|
|
static class EndianSwap
|
|
{
|
|
public static ushort Swap16(ushort Value) => (ushort)(((Value >> 8) & 0xff) | (Value << 8));
|
|
|
|
public static int Swap32(int Value)
|
|
{
|
|
uint UintVal = (uint)Value;
|
|
|
|
return (int)(((UintVal >> 24) & 0x000000ff) |
|
|
((UintVal >> 8) & 0x0000ff00) |
|
|
((UintVal << 8) & 0x00ff0000) |
|
|
((UintVal << 24) & 0xff000000));
|
|
}
|
|
}
|
|
}
|