diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Audio/Types/OpusPacketHeader.cs | 5 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Audio/Types/OpusPacketHeader.cs b/Ryujinx.HLE/HOS/Services/Audio/Types/OpusPacketHeader.cs index bb4b6d16..0a50a5c8 100644 --- a/Ryujinx.HLE/HOS/Services/Audio/Types/OpusPacketHeader.cs +++ b/Ryujinx.HLE/HOS/Services/Audio/Types/OpusPacketHeader.cs @@ -1,5 +1,6 @@ using Ryujinx.Common; using System; +using System.Buffers.Binary; using System.IO; using System.Runtime.InteropServices; @@ -15,8 +16,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio.Types { OpusPacketHeader header = reader.ReadStruct<OpusPacketHeader>(); - header.length = EndianSwap.FromBigEndianToPlatformEndian(header.length); - header.finalRange = EndianSwap.FromBigEndianToPlatformEndian(header.finalRange); + header.length = BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness(header.length) : header.length; + header.finalRange = BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness(header.finalRange) : header.finalRange; return header; } diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs index 7db8066a..af9b3881 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs @@ -1,6 +1,7 @@ using Ryujinx.Common; using Ryujinx.Common.Logging; using Ryujinx.HLE.Utilities; +using System.Buffers.Binary; using System.Collections.Generic; using System.Net; using System.Net.Sockets; @@ -199,7 +200,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { int size = context.Memory.ReadByte(bufferPosition); int family = context.Memory.ReadByte(bufferPosition + 1); - int port = EndianSwap.Swap16(context.Memory.ReadUInt16(bufferPosition + 2)); + int port = BinaryPrimitives.ReverseEndianness(context.Memory.ReadUInt16(bufferPosition + 2)); byte[] rawIp = context.Memory.ReadBytes(bufferPosition + 4, 4); @@ -210,7 +211,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { context.Memory.WriteByte(bufferPosition, 0); context.Memory.WriteByte(bufferPosition + 1, (byte)endPoint.AddressFamily); - context.Memory.WriteUInt16(bufferPosition + 2, EndianSwap.Swap16((ushort)endPoint.Port)); + context.Memory.WriteUInt16(bufferPosition + 2, BinaryPrimitives.ReverseEndianness((ushort)endPoint.Port)); context.Memory.WriteBytes(bufferPosition + 4, endPoint.Address.GetAddressBytes()); } |
