1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-14 07:06:41 +00:00
Ryujinx/Ryujinx.HLE/OsHle/Utilities/EndianSwap.cs
Ac_K 4e430760b4 Implement NPDM files parser (#169)
* Implement NPDM files parser

(Currently not used in Ryujinx)

* Add credits

* Add Swap32

* Update Npdm.cs

* Update ACI0.cs

* Update ACID.cs

* Update Npdm.cs

* Update EndianSwap.cs

* Update ACI0.cs

* Update ACID.cs

* Update KernelAccessControl.cs

* Update NpdmInfo.cs

* Update ServiceAccessControl.cs

* Update NpdmInfo.cs
2018-06-17 23:28:11 -03:00

17 lines
529 B
C#

namespace Ryujinx.HLE.OsHle.Utilities
{
static class EndianSwap
{
public static short Swap16(short Value) => (short)(((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));
}
}
}