diff --git a/Ryujinx.Audio/Renderer/Utils/FileHardwareDevice.cs b/Ryujinx.Audio/Renderer/Utils/FileHardwareDevice.cs index 830b36eeb3..d49313ea19 100644 --- a/Ryujinx.Audio/Renderer/Utils/FileHardwareDevice.cs +++ b/Ryujinx.Audio/Renderer/Utils/FileHardwareDevice.cs @@ -34,10 +34,10 @@ namespace Ryujinx.Audio.Renderer.Utils writer.Seek(0, SeekOrigin.Begin); - writer.Write(Encoding.ASCII.GetBytes("RIFF")); + writer.Write("RIFF"u8); writer.Write((int)(writer.BaseStream.Length - 8)); - writer.Write(Encoding.ASCII.GetBytes("WAVE")); - writer.Write(Encoding.ASCII.GetBytes("fmt ")); + writer.Write("WAVE"u8); + writer.Write("fmt "u8); writer.Write(16); writer.Write((short)1); writer.Write((short)GetChannelCount()); @@ -45,7 +45,7 @@ namespace Ryujinx.Audio.Renderer.Utils writer.Write(GetSampleRate() * GetChannelCount() * sizeof(short)); writer.Write((short)(GetChannelCount() * sizeof(short))); writer.Write((short)(sizeof(short) * 8)); - writer.Write(Encoding.ASCII.GetBytes("data")); + writer.Write("data"u8); writer.Write((int)(writer.BaseStream.Length - HeaderSize)); writer.Seek((int)currentPos, SeekOrigin.Begin); diff --git a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs index 4e445c4fcd..4fdeadcb22 100644 --- a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs +++ b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs @@ -85,7 +85,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp Reserved1 = new Array64(), Reserved2 = new Array58() }; - Encoding.ASCII.GetBytes("Ryujinx").CopyTo(registerInfo.Nickname.AsSpan()); + "Ryujinx"u8.CopyTo(registerInfo.Nickname.AsSpan()); return registerInfo; } diff --git a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs index 4a0259e600..bc70750d9d 100644 --- a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs +++ b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs @@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService networkProfile.IpSettingData.IpAddressSetting = new IpAddressSetting(interfaceProperties, unicastAddress); networkProfile.IpSettingData.DnsSetting = new DnsSetting(interfaceProperties); - Encoding.ASCII.GetBytes("RyujinxNetwork").CopyTo(networkProfile.Name.AsSpan()); + "RyujinxNetwork"u8.CopyTo(networkProfile.Name.AsSpan()); context.Memory.Write(networkProfileDataPosition, networkProfile); diff --git a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs index 3b13b583a7..12f6e90d43 100644 --- a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs +++ b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZone.cs @@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone new int[] { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; - private static readonly byte[] TimeZoneDefaultRule = Encoding.ASCII.GetBytes(",M4.1.0,M10.5.0"); + private static ReadOnlySpan TimeZoneDefaultRule => ",M4.1.0,M10.5.0"u8; [StructLayout(LayoutKind.Sequential, Pack = 0x4, Size = 0x10)] private struct CalendarTimeInternal diff --git a/Ryujinx.HLE/Loaders/Mods/IPSPatcher.cs b/Ryujinx.HLE/Loaders/Mods/IPSPatcher.cs index de50c6eb41..510fec0590 100644 --- a/Ryujinx.HLE/Loaders/Mods/IPSPatcher.cs +++ b/Ryujinx.HLE/Loaders/Mods/IPSPatcher.cs @@ -20,10 +20,10 @@ namespace Ryujinx.HLE.Loaders.Mods private static MemPatch ParseIps(BinaryReader reader) { - Span IpsHeaderMagic = Encoding.ASCII.GetBytes("PATCH").AsSpan(); - Span IpsTailMagic = Encoding.ASCII.GetBytes("EOF").AsSpan(); - Span Ips32HeaderMagic = Encoding.ASCII.GetBytes("IPS32").AsSpan(); - Span Ips32TailMagic = Encoding.ASCII.GetBytes("EEOF").AsSpan(); + ReadOnlySpan IpsHeaderMagic = "PATCH"u8; + ReadOnlySpan IpsTailMagic = "EOF"u8; + ReadOnlySpan Ips32HeaderMagic = "IPS32"u8; + ReadOnlySpan Ips32TailMagic = "EEOF"u8; MemPatch patches = new MemPatch(); var header = reader.ReadBytes(IpsHeaderMagic.Length).AsSpan(); @@ -34,7 +34,7 @@ namespace Ryujinx.HLE.Loaders.Mods } bool is32; - Span tailSpan; + ReadOnlySpan tailSpan; if (header.SequenceEqual(IpsHeaderMagic)) {