mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-06 00:39:04 +02:00
misc: chore: Use collection expressions
This commit is contained in:
@@ -1086,7 +1086,7 @@ namespace Ryujinx.HLE.FileSystem
|
||||
|
||||
public bool AreKeysAlredyPresent(string pathToCheck)
|
||||
{
|
||||
string[] fileNames = { "prod.keys", "title.keys", "console.keys", "dev.keys" };
|
||||
string[] fileNames = ["prod.keys", "title.keys", "console.keys", "dev.keys"];
|
||||
foreach (var file in fileNames)
|
||||
{
|
||||
if (File.Exists(Path.Combine(pathToCheck, file)))
|
||||
|
||||
@@ -439,7 +439,7 @@ namespace Ryujinx.HLE.FileSystem
|
||||
|
||||
var mountName = "system".ToU8Span();
|
||||
DirectoryHandle handle = default;
|
||||
List<ulong> localList = new();
|
||||
List<ulong> localList = [];
|
||||
|
||||
try
|
||||
{
|
||||
@@ -636,7 +636,7 @@ namespace Ryujinx.HLE.FileSystem
|
||||
}
|
||||
|
||||
private static readonly ExtraDataFixInfo[] _systemExtraDataFixInfo =
|
||||
{
|
||||
[
|
||||
new ExtraDataFixInfo()
|
||||
{
|
||||
StaticSaveDataId = 0x8000000000000030,
|
||||
@@ -652,8 +652,8 @@ namespace Ryujinx.HLE.FileSystem
|
||||
Flags = SaveDataFlags.None,
|
||||
DataSize = 0xC000,
|
||||
JournalSize = 0xC000,
|
||||
},
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
@@ -39,10 +39,10 @@ namespace Ryujinx.HLE.HOS.Applets.Browser
|
||||
|
||||
if ((_commonArguments.AppletVersion >= 0x80000 && _shimKind == ShimKind.Web) || (_commonArguments.AppletVersion >= 0x30000 && _shimKind == ShimKind.Share))
|
||||
{
|
||||
List<BrowserOutput> result = new()
|
||||
{
|
||||
new BrowserOutput(BrowserOutputType.ExitReason, (uint)WebExitReason.ExitButton),
|
||||
};
|
||||
List<BrowserOutput> result =
|
||||
[
|
||||
new BrowserOutput(BrowserOutputType.ExitReason, (uint)WebExitReason.ExitButton)
|
||||
];
|
||||
|
||||
_normalSession.Push(BuildResponseNew(result));
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
||||
{
|
||||
string buttonsText = GetMessageText(module, description, key);
|
||||
|
||||
return (buttonsText == "") ? null : buttonsText.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
return (buttonsText == "") ? null : buttonsText.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
|
||||
}
|
||||
|
||||
private void ParseErrorCommonArg()
|
||||
@@ -189,7 +189,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
||||
string messageText = Encoding.ASCII.GetString(messageTextBuffer.TakeWhile(b => !b.Equals(0)).ToArray());
|
||||
string detailsText = Encoding.ASCII.GetString(detailsTextBuffer.TakeWhile(b => !b.Equals(0)).ToArray());
|
||||
|
||||
List<string> buttons = new();
|
||||
List<string> buttons = [];
|
||||
|
||||
// TODO: Handle the LanguageCode to return the translated "OK" and "Details".
|
||||
|
||||
|
||||
@@ -121,13 +121,14 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
||||
{
|
||||
// Try a list of fonts in case any of them is not available in the system.
|
||||
|
||||
string[] availableFonts = {
|
||||
string[] availableFonts =
|
||||
[
|
||||
uiThemeFontFamily,
|
||||
"Liberation Sans",
|
||||
"FreeSans",
|
||||
"DejaVu Sans",
|
||||
"Lucida Grande",
|
||||
};
|
||||
"Lucida Grande"
|
||||
];
|
||||
|
||||
foreach (string fontFamily in availableFonts)
|
||||
{
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Ryujinx.HLE.HOS
|
||||
|
||||
PerformanceState = new PerformanceState();
|
||||
|
||||
NfpDevices = new List<NfpDevice>();
|
||||
NfpDevices = [];
|
||||
|
||||
// Note: This is not really correct, but with HLE of services, the only memory
|
||||
// region used that is used is Application, so we can use the other ones for anything.
|
||||
@@ -283,14 +283,15 @@ namespace Ryujinx.HLE.HOS
|
||||
|
||||
ProcessCreationInfo creationInfo = new("Service", 1, 0, 0x8000000, 1, Flags, 0, 0);
|
||||
|
||||
uint[] defaultCapabilities = {
|
||||
uint[] defaultCapabilities =
|
||||
[
|
||||
(((uint)KScheduler.CpuCoresCount - 1) << 24) + (((uint)KScheduler.CpuCoresCount - 1) << 16) + 0x63F7u,
|
||||
0x1FFFFFCF,
|
||||
0x207FFFEF,
|
||||
0x47E0060F,
|
||||
0x0048BFFF,
|
||||
0x01007FFF,
|
||||
};
|
||||
0x01007FFF
|
||||
];
|
||||
|
||||
// TODO:
|
||||
// - Pass enough information (capabilities, process creation info, etc) on ServiceEntry for proper initialization.
|
||||
@@ -341,7 +342,7 @@ namespace Ryujinx.HLE.HOS
|
||||
{
|
||||
if (VirtualAmiibo.ApplicationBytes.Length > 0)
|
||||
{
|
||||
VirtualAmiibo.ApplicationBytes = Array.Empty<byte>();
|
||||
VirtualAmiibo.ApplicationBytes = [];
|
||||
VirtualAmiibo.InputBin = string.Empty;
|
||||
}
|
||||
if (NfpDevices[nfpDeviceId].State == NfpDeviceState.SearchingForTag)
|
||||
@@ -356,7 +357,7 @@ namespace Ryujinx.HLE.HOS
|
||||
VirtualAmiibo.InputBin = path;
|
||||
if (VirtualAmiibo.ApplicationBytes.Length > 0)
|
||||
{
|
||||
VirtualAmiibo.ApplicationBytes = Array.Empty<byte>();
|
||||
VirtualAmiibo.ApplicationBytes = [];
|
||||
}
|
||||
byte[] encryptedData = File.ReadAllBytes(path);
|
||||
VirtualAmiiboFile newFile = AmiiboBinReader.ReadBinFile(encryptedData);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Ipc
|
||||
PId = HasPId ? reader.ReadUInt64() : 0;
|
||||
|
||||
int toCopySize = (word >> 1) & 0xf;
|
||||
int[] toCopy = toCopySize == 0 ? Array.Empty<int>() : new int[toCopySize];
|
||||
int[] toCopy = toCopySize == 0 ? [] : new int[toCopySize];
|
||||
|
||||
for (int index = 0; index < toCopy.Length; index++)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Ipc
|
||||
ToCopy = toCopy;
|
||||
|
||||
int toMoveSize = (word >> 5) & 0xf;
|
||||
int[] toMove = toMoveSize == 0 ? Array.Empty<int>() : new int[toMoveSize];
|
||||
int[] toMove = toMoveSize == 0 ? [] : new int[toMoveSize];
|
||||
|
||||
for (int index = 0; index < toMove.Length; index++)
|
||||
{
|
||||
@@ -59,12 +59,12 @@ namespace Ryujinx.HLE.HOS.Ipc
|
||||
|
||||
public static IpcHandleDesc MakeCopy(params int[] handles)
|
||||
{
|
||||
return new IpcHandleDesc(handles, Array.Empty<int>());
|
||||
return new IpcHandleDesc(handles, []);
|
||||
}
|
||||
|
||||
public static IpcHandleDesc MakeMove(params int[] handles)
|
||||
{
|
||||
return new IpcHandleDesc(Array.Empty<int>(), handles);
|
||||
return new IpcHandleDesc([], handles);
|
||||
}
|
||||
|
||||
public RecyclableMemoryStream GetStream()
|
||||
|
||||
@@ -72,13 +72,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
|
||||
|
||||
servicePool = new MemoryRegion(DramMemoryMap.SlabHeapEnd, servicePoolSize);
|
||||
|
||||
return new[]
|
||||
{
|
||||
return
|
||||
[
|
||||
GetMemoryRegion(applicationPool),
|
||||
GetMemoryRegion(appletPool),
|
||||
GetMemoryRegion(servicePool),
|
||||
GetMemoryRegion(nvServicesPool),
|
||||
};
|
||||
GetMemoryRegion(nvServicesPool)
|
||||
];
|
||||
}
|
||||
|
||||
private static KMemoryRegionManager GetMemoryRegion(MemoryRegion region)
|
||||
|
||||
@@ -10,12 +10,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
|
||||
{
|
||||
class KServerSession : KSynchronizationObject
|
||||
{
|
||||
private static readonly MemoryState[] _ipcMemoryStates = {
|
||||
private static readonly MemoryState[] _ipcMemoryStates =
|
||||
[
|
||||
MemoryState.IpcBuffer3,
|
||||
MemoryState.IpcBuffer0,
|
||||
MemoryState.IpcBuffer1,
|
||||
(MemoryState)0xfffce5d4, //This is invalid, shouldn't be accessed.
|
||||
};
|
||||
(MemoryState)0xfffce5d4 //This is invalid, shouldn't be accessed.
|
||||
];
|
||||
|
||||
private readonly struct Message
|
||||
{
|
||||
@@ -176,7 +177,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
|
||||
{
|
||||
_parent = parent;
|
||||
|
||||
_requests = new LinkedList<KSessionRequest>();
|
||||
_requests = [];
|
||||
}
|
||||
|
||||
public Result EnqueueRequest(KSessionRequest request)
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly int[] _memoryBlockPageShifts = { 12, 16, 21, 22, 25, 29, 30 };
|
||||
private static readonly int[] _memoryBlockPageShifts = [12, 16, 21, 22, 25, 29, 30];
|
||||
|
||||
#pragma warning disable IDE0052 // Remove unread private member
|
||||
private readonly ulong _heapAddress;
|
||||
|
||||
@@ -13,14 +13,15 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
{
|
||||
abstract class KPageTableBase
|
||||
{
|
||||
private static readonly int[] _mappingUnitSizes = {
|
||||
private static readonly int[] _mappingUnitSizes =
|
||||
[
|
||||
0x1000,
|
||||
0x10000,
|
||||
0x200000,
|
||||
0x400000,
|
||||
0x2000000,
|
||||
0x40000000,
|
||||
};
|
||||
0x40000000
|
||||
];
|
||||
|
||||
private const ulong RegionAlignment = 0x200000;
|
||||
|
||||
|
||||
@@ -100,20 +100,20 @@ namespace Ryujinx.HLE.HOS
|
||||
AccessControlBits.Bits.MoveCacheStorage;
|
||||
|
||||
// Sdb has save data access control info so we can't store just its access control bits
|
||||
private static ReadOnlySpan<byte> SdbFacData => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> SdbFacData =>
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x03, 0x03, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x09, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x01
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> SdbFacDescriptor => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> SdbFacDescriptor =>
|
||||
[
|
||||
0x01, 0x00, 0x02, 0x00, 0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x09, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
};
|
||||
0x01, 0x09, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ namespace Ryujinx.HLE.HOS
|
||||
|
||||
public ModCache()
|
||||
{
|
||||
RomfsContainers = new List<Mod<FileInfo>>();
|
||||
ExefsContainers = new List<Mod<FileInfo>>();
|
||||
RomfsDirs = new List<Mod<DirectoryInfo>>();
|
||||
ExefsDirs = new List<Mod<DirectoryInfo>>();
|
||||
Cheats = new List<Cheat>();
|
||||
RomfsContainers = [];
|
||||
ExefsContainers = [];
|
||||
RomfsDirs = [];
|
||||
ExefsDirs = [];
|
||||
Cheats = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,9 +107,9 @@ namespace Ryujinx.HLE.HOS
|
||||
|
||||
public PatchCache()
|
||||
{
|
||||
NsoPatches = new List<Mod<DirectoryInfo>>();
|
||||
NroPatches = new List<Mod<DirectoryInfo>>();
|
||||
KipPatches = new List<Mod<DirectoryInfo>>();
|
||||
NsoPatches = [];
|
||||
NroPatches = [];
|
||||
KipPatches = [];
|
||||
|
||||
Initialized = false;
|
||||
}
|
||||
@@ -373,8 +373,8 @@ namespace Ryujinx.HLE.HOS
|
||||
private static IEnumerable<Cheat> GetCheatsInFile(FileInfo cheatFile)
|
||||
{
|
||||
string cheatName = DefaultCheatName;
|
||||
List<string> instructions = new();
|
||||
List<Cheat> cheats = new();
|
||||
List<string> instructions = [];
|
||||
List<Cheat> cheats = [];
|
||||
|
||||
using StreamReader cheatData = cheatFile.OpenText();
|
||||
while (cheatData.ReadLine() is { } line)
|
||||
@@ -401,7 +401,7 @@ namespace Ryujinx.HLE.HOS
|
||||
|
||||
// Start a new cheat section.
|
||||
cheatName = line[1..^1];
|
||||
instructions = new List<string>();
|
||||
instructions = [];
|
||||
}
|
||||
else if (line.Length > 0)
|
||||
{
|
||||
@@ -434,7 +434,7 @@ namespace Ryujinx.HLE.HOS
|
||||
{
|
||||
foreach ((ulong applicationId, ModCache cache) in modCaches)
|
||||
{
|
||||
QueryContentsDir(cache, searchDir, applicationId, Array.Empty<ulong>());
|
||||
QueryContentsDir(cache, searchDir, applicationId, []);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
||||
_horizonClient = horizonClient;
|
||||
|
||||
_profiles = new ConcurrentDictionary<string, UserProfile>();
|
||||
_storedOpenedUsers = Array.Empty<UserProfile>();
|
||||
_storedOpenedUsers = [];
|
||||
|
||||
_accountSaveDataManager = new AccountSaveDataManager(_profiles);
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Ryujinx.HLE.HOS.Services
|
||||
{
|
||||
Logger.Trace?.Print(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Name}");
|
||||
|
||||
result = (ResultCode)processRequest.Invoke(service, new object[] { context });
|
||||
result = (ResultCode)processRequest.Invoke(service, [context]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -176,7 +176,7 @@ namespace Ryujinx.HLE.HOS.Services
|
||||
{
|
||||
Logger.Debug?.Print(LogClass.KernelIpc, $"{GetType().Name}: {processRequest.Name}");
|
||||
|
||||
result = (ResultCode)processRequest.Invoke(this, new object[] { context });
|
||||
result = (ResultCode)processRequest.Invoke(this, [context]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
|
||||
NetworkConfig = networkConfig,
|
||||
};
|
||||
|
||||
bool success = _parent.NetworkClient.CreateNetwork(request, _advertiseData ?? Array.Empty<byte>());
|
||||
bool success = _parent.NetworkClient.CreateNetwork(request, _advertiseData ?? []);
|
||||
|
||||
return success ? ResultCode.Success : ResultCode.InvalidState;
|
||||
}
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
|
||||
}
|
||||
else
|
||||
{
|
||||
return Array.Empty<NodeLatestUpdate>();
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator
|
||||
public NetworkInfo[] Scan(ushort channel, ScanFilter scanFilter)
|
||||
{
|
||||
Logger.Warning?.PrintMsg(LogClass.ServiceLdn, "Attempted to scan for networks, but Multiplayer is disabled!");
|
||||
return Array.Empty<NetworkInfo>();
|
||||
return [];
|
||||
}
|
||||
|
||||
public void SetAdvertiseData(byte[] data) { }
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
||||
private readonly Ssid _fakeSsid;
|
||||
private ILdnTcpSocket _tcp;
|
||||
private LdnProxyUdpServer _udp, _udp2;
|
||||
private readonly List<LdnProxyTcpSession> _stations = new();
|
||||
private readonly List<LdnProxyTcpSession> _stations = [];
|
||||
private readonly Lock _lock = new();
|
||||
|
||||
private readonly AutoResetEvent _apConnected = new(false);
|
||||
@@ -340,10 +340,10 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
||||
|
||||
if (_protocol.SendBroadcast(_udp, LanPacketType.Scan, DefaultPort) < 0)
|
||||
{
|
||||
return Array.Empty<NetworkInfo>();
|
||||
return [];
|
||||
}
|
||||
|
||||
List<NetworkInfo> outNetworkInfo = new();
|
||||
List<NetworkInfo> outNetworkInfo = [];
|
||||
|
||||
foreach (KeyValuePair<ulong, NetworkInfo> item in _udp.GetScanResults())
|
||||
{
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
||||
|
||||
public int SendBroadcast(ILdnSocket s, LanPacketType type, int port)
|
||||
{
|
||||
return SendPacket(s, type, Array.Empty<byte>(), new IPEndPoint(_discovery.LocalBroadcastAddr, port));
|
||||
return SendPacket(s, type, [], new IPEndPoint(_discovery.LocalBroadcastAddr, port));
|
||||
}
|
||||
|
||||
public int SendPacket(ILdnSocket s, LanPacketType type, byte[] data, EndPoint endPoint = null)
|
||||
@@ -230,7 +230,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
||||
|
||||
private int Compress(byte[] input, out byte[] output)
|
||||
{
|
||||
List<byte> outputList = new();
|
||||
List<byte> outputList = [];
|
||||
int i = 0;
|
||||
int maxCount = 0xFF;
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
||||
|
||||
private int Decompress(byte[] input, out byte[] output)
|
||||
{
|
||||
List<byte> outputList = new();
|
||||
List<byte> outputList = [];
|
||||
int i = 0;
|
||||
|
||||
while (i < input.Length && outputList.Count < BufferSize)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
private readonly RyuLdnProtocol _protocol;
|
||||
private readonly NetworkTimeout _timeout;
|
||||
|
||||
private readonly List<NetworkInfo> _availableGames = new List<NetworkInfo>();
|
||||
private readonly List<NetworkInfo> _availableGames = [];
|
||||
private DisconnectReason _disconnectReason;
|
||||
|
||||
private P2pProxyServer _hostedProxy;
|
||||
@@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
|
||||
ConnectAsync();
|
||||
|
||||
int index = WaitHandle.WaitAny(new WaitHandle[] { _connected, _error }, FailureTimeout);
|
||||
int index = WaitHandle.WaitAny([_connected, _error], FailureTimeout);
|
||||
|
||||
if (IsConnected)
|
||||
{
|
||||
@@ -326,7 +326,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
|
||||
SendAsync(_protocol.Encode(PacketId.Reject, new RejectRequest(disconnectReason, nodeId)));
|
||||
|
||||
int index = WaitHandle.WaitAny(new WaitHandle[] { _reject, _error }, InactiveTimeout);
|
||||
int index = WaitHandle.WaitAny([_reject, _error], InactiveTimeout);
|
||||
|
||||
if (index == 0)
|
||||
{
|
||||
@@ -566,13 +566,13 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
|
||||
SendAsync(_protocol.Encode(PacketId.Scan, scanFilter));
|
||||
|
||||
index = WaitHandle.WaitAny(new WaitHandle[] { _scan, _error }, ScanTimeout);
|
||||
index = WaitHandle.WaitAny([_scan, _error], ScanTimeout);
|
||||
}
|
||||
|
||||
if (index != 0)
|
||||
{
|
||||
// An error occurred or timeout. Write 0 games.
|
||||
return Array.Empty<NetworkInfo>();
|
||||
return [];
|
||||
}
|
||||
|
||||
return _availableGames.ToArray();
|
||||
|
||||
@@ -40,11 +40,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0055 // Disable formatting
|
||||
public static ReadOnlySpan<byte> Ver3FacelineColorTable => new byte[] { 0, 1, 2, 3, 4, 5 };
|
||||
public static ReadOnlySpan<byte> Ver3HairColorTable => new byte[] { 8, 1, 2, 3, 4, 5, 6, 7 };
|
||||
public static ReadOnlySpan<byte> Ver3EyeColorTable => new byte[] { 8, 9, 10, 11, 12, 13 };
|
||||
public static ReadOnlySpan<byte> Ver3MouthColorTable => new byte[] { 19, 20, 21, 22, 23 };
|
||||
public static ReadOnlySpan<byte> Ver3GlassColorTable => new byte[] { 8, 14, 15, 16, 17, 18, 0 };
|
||||
public static ReadOnlySpan<byte> Ver3FacelineColorTable => [0, 1, 2, 3, 4, 5];
|
||||
public static ReadOnlySpan<byte> Ver3HairColorTable => [8, 1, 2, 3, 4, 5, 6, 7];
|
||||
public static ReadOnlySpan<byte> Ver3EyeColorTable => [8, 9, 10, 11, 12, 13];
|
||||
public static ReadOnlySpan<byte> Ver3MouthColorTable => [19, 20, 21, 22, 23];
|
||||
public static ReadOnlySpan<byte> Ver3GlassColorTable => [8, 14, 15, 16, 17, 18, 0];
|
||||
#pragma warning restore IDE0055
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,8 +830,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
}
|
||||
|
||||
#region "Element Info Array"
|
||||
private readonly ReadOnlySpan<byte> ElementInfoArray => new byte[]
|
||||
{
|
||||
private readonly ReadOnlySpan<byte> ElementInfoArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x83, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -905,8 +905,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x1b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
|
||||
];
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
// The first 2 Mii in the default table are used as base for Male/Female in editor but not exposed via IPC.
|
||||
public static int TableLength => _fromIndex.Length;
|
||||
|
||||
private static readonly int[] _fromIndex = { 2, 3, 4, 5, 6, 7 };
|
||||
private static readonly int[] _fromIndex = [2, 3, 4, 5, 6, 7];
|
||||
|
||||
public static DefaultMii GetDefaultMii(uint index)
|
||||
{
|
||||
@@ -81,8 +81,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
}
|
||||
|
||||
#region "Raw Table Array"
|
||||
private static ReadOnlySpan<byte> TableRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> TableRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
@@ -190,8 +190,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x6f, 0x00,
|
||||
0x20, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x20, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,17 +6,19 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
{
|
||||
static class RandomMiiConstants
|
||||
{
|
||||
public static readonly int[] EyeRotateTable = {
|
||||
public static readonly int[] EyeRotateTable =
|
||||
[
|
||||
0x03, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04,
|
||||
0x04, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04,
|
||||
0x04, 0x03, 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03,
|
||||
0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04,
|
||||
};
|
||||
0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04
|
||||
];
|
||||
|
||||
public static readonly int[] EyebrowRotateTable = {
|
||||
public static readonly int[] EyebrowRotateTable =
|
||||
[
|
||||
0x06, 0x06, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07, 0x04, 0x07, 0x06, 0x08, 0x05, 0x05, 0x06, 0x06,
|
||||
0x07, 0x07, 0x06, 0x06, 0x05, 0x06, 0x07, 0x05,
|
||||
};
|
||||
0x07, 0x07, 0x06, 0x06, 0x05, 0x06, 0x07, 0x05
|
||||
];
|
||||
|
||||
[Flags]
|
||||
public enum BeardAndMustacheFlag
|
||||
@@ -89,8 +91,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
|
||||
#region "Random Mii Data Arrays"
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
@@ -320,11 +322,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineColorRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineColorRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
@@ -399,11 +401,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineWrinkleRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineWrinkleRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -633,11 +635,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineMakeRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiFacelineMakeRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -867,11 +869,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiHairTypeRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiHairTypeRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
|
||||
@@ -1101,11 +1103,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiHairColorRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiHairColorRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -1218,11 +1220,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiEyeTypeRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiEyeTypeRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
|
||||
@@ -1452,11 +1454,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x2e, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiEyeColorRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiEyeColorRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
@@ -1493,11 +1495,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiEyebrowTypeRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiEyebrowTypeRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
@@ -1727,11 +1729,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiNoseTypeRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiNoseTypeRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
@@ -1961,11 +1963,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiMouthTypeRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiMouthTypeRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
@@ -2195,11 +2197,11 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> RandomMiiGlassTypeRawArray => new byte[]
|
||||
{
|
||||
private static ReadOnlySpan<byte> RandomMiiGlassTypeRawArray =>
|
||||
[
|
||||
0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00,
|
||||
0x60, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -2236,8 +2238,8 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
static class VirtualAmiibo
|
||||
{
|
||||
public static uint OpenedApplicationAreaId;
|
||||
public static byte[] ApplicationBytes = Array.Empty<byte>();
|
||||
public static byte[] ApplicationBytes = [];
|
||||
public static string InputBin = string.Empty;
|
||||
public static string NickName = string.Empty;
|
||||
private static readonly AmiiboJsonSerializerContext _serializerContext = AmiiboJsonSerializerContext.Default;
|
||||
@@ -137,7 +137,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
if (ApplicationBytes.Length > 0)
|
||||
{
|
||||
byte[] bytes = ApplicationBytes;
|
||||
ApplicationBytes = Array.Empty<byte>();
|
||||
ApplicationBytes = [];
|
||||
return bytes;
|
||||
}
|
||||
VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId);
|
||||
@@ -150,7 +150,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
}
|
||||
}
|
||||
|
||||
return Array.Empty<byte>();
|
||||
return [];
|
||||
}
|
||||
|
||||
public static bool CreateApplicationArea(string amiiboId, uint applicationAreaId, byte[] applicationAreaData)
|
||||
@@ -219,12 +219,12 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
virtualAmiiboFile = new VirtualAmiiboFile()
|
||||
{
|
||||
FileVersion = 0,
|
||||
TagUuid = Array.Empty<byte>(),
|
||||
TagUuid = [],
|
||||
AmiiboId = amiiboId,
|
||||
FirstWriteDate = DateTime.Now,
|
||||
LastWriteDate = DateTime.Now,
|
||||
WriteCounter = 0,
|
||||
ApplicationAreas = new List<VirtualAmiiboApplicationArea>(),
|
||||
ApplicationAreas = [],
|
||||
};
|
||||
|
||||
SaveAmiiboFile(virtualAmiiboFile);
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace Ryujinx.HLE.HOS.Services.Nv
|
||||
[Service("nvdrv:t")]
|
||||
class INvDrvServices : IpcService
|
||||
{
|
||||
private static readonly List<string> _deviceFileDebugRegistry = new()
|
||||
{
|
||||
private static readonly List<string> _deviceFileDebugRegistry =
|
||||
[
|
||||
"/dev/nvhost-dbg-gpu",
|
||||
"/dev/nvhost-prof-gpu",
|
||||
};
|
||||
"/dev/nvhost-prof-gpu"
|
||||
];
|
||||
|
||||
private static readonly Dictionary<string, Type> _deviceFileRegistry = new()
|
||||
{
|
||||
@@ -73,9 +73,10 @@ namespace Ryujinx.HLE.HOS.Services.Nv
|
||||
|
||||
if (_deviceFileRegistry.TryGetValue(path, out Type deviceFileClass))
|
||||
{
|
||||
ConstructorInfo constructor = deviceFileClass.GetConstructor(new[] { typeof(ServiceCtx), typeof(IVirtualMemoryManager), typeof(ulong) });
|
||||
ConstructorInfo constructor = deviceFileClass.GetConstructor([typeof(ServiceCtx), typeof(IVirtualMemoryManager), typeof(ulong)
|
||||
]);
|
||||
|
||||
NvDeviceFile deviceFile = (NvDeviceFile)constructor.Invoke(new object[] { context, _clientMemory, _owner });
|
||||
NvDeviceFile deviceFile = (NvDeviceFile)constructor.Invoke([context, _clientMemory, _owner]);
|
||||
|
||||
deviceFile.Path = path;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
||||
private const uint SmallPageSize = 0x1000;
|
||||
private const uint BigPageSize = 0x10000;
|
||||
|
||||
private static readonly uint[] _pageSizes = { SmallPageSize, BigPageSize };
|
||||
private static readonly uint[] _pageSizes = [SmallPageSize, BigPageSize];
|
||||
|
||||
private const ulong SmallRegionLimit = 0x400000000UL; // 16 GiB
|
||||
private const ulong DefaultUserSize = 1UL << 37;
|
||||
@@ -32,10 +32,11 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly VmRegion[] _vmRegions = {
|
||||
private static readonly VmRegion[] _vmRegions =
|
||||
[
|
||||
new VmRegion((ulong)BigPageSize << 16, SmallRegionLimit),
|
||||
new VmRegion(SmallRegionLimit, DefaultUserSize),
|
||||
};
|
||||
new VmRegion(SmallRegionLimit, DefaultUserSize)
|
||||
];
|
||||
|
||||
private readonly AddressSpaceContext _asContext;
|
||||
private readonly NvMemoryAllocator _memoryAllocator;
|
||||
|
||||
@@ -12,15 +12,16 @@ namespace Ryujinx.HLE.HOS.Services.Pcv.Clkrst.ClkrstManager
|
||||
#pragma warning restore IDE0052
|
||||
private uint _clockRate;
|
||||
|
||||
private readonly DeviceCode[] _allowedDeviceCodeTable = {
|
||||
private readonly DeviceCode[] _allowedDeviceCodeTable =
|
||||
[
|
||||
DeviceCode.Cpu, DeviceCode.Gpu, DeviceCode.Disp1, DeviceCode.Disp2,
|
||||
DeviceCode.Tsec, DeviceCode.Mselect, DeviceCode.Sor1, DeviceCode.Host1x,
|
||||
DeviceCode.Vic, DeviceCode.Nvenc, DeviceCode.Nvjpg, DeviceCode.Nvdec,
|
||||
DeviceCode.Ape, DeviceCode.AudioDsp, DeviceCode.Emc, DeviceCode.Dsi,
|
||||
DeviceCode.SysBus, DeviceCode.XusbSs, DeviceCode.XusbHost, DeviceCode.XusbDevice,
|
||||
DeviceCode.Gpuaux, DeviceCode.Pcie, DeviceCode.Apbdma, DeviceCode.Sdmmc1,
|
||||
DeviceCode.Sdmmc2, DeviceCode.Sdmmc4,
|
||||
};
|
||||
DeviceCode.Sdmmc2, DeviceCode.Sdmmc4
|
||||
];
|
||||
|
||||
public IClkrstSession(DeviceCode deviceCode, uint unknown)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
static class KeyCodeMaps
|
||||
{
|
||||
public static byte[] Default =
|
||||
{
|
||||
[
|
||||
0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -345,11 +345,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] EnglishUsInternational =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -691,11 +691,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] EnglishUk =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -1037,11 +1037,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] French =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -1383,11 +1383,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] FrenchCa =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -1729,11 +1729,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] Spanish =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -2075,11 +2075,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] SpanishLatin =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -2421,11 +2421,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] German =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -2767,11 +2767,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] Italian =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -3113,11 +3113,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] Portuguese =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -3459,11 +3459,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] Russian =
|
||||
{
|
||||
[
|
||||
0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -3805,11 +3805,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] Korean =
|
||||
{
|
||||
[
|
||||
0x11, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -4151,11 +4151,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] ChineseSimplified =
|
||||
{
|
||||
[
|
||||
0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -4497,11 +4497,11 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
|
||||
public static byte[] ChineseTraditional =
|
||||
{
|
||||
[
|
||||
0x61, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -4843,7 +4843,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
||||
[Service("bsd:u", false)]
|
||||
class IClient : IpcService
|
||||
{
|
||||
private static readonly List<IPollManager> _pollManagers = new()
|
||||
{
|
||||
private static readonly List<IPollManager> _pollManagers =
|
||||
[
|
||||
EventFileDescriptorPollManager.Instance,
|
||||
ManagedSocketPollManager.Instance,
|
||||
};
|
||||
ManagedSocketPollManager.Instance
|
||||
];
|
||||
|
||||
private BsdContext _context;
|
||||
private readonly bool _isPrivileged;
|
||||
@@ -281,7 +281,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
||||
|
||||
for (int i = 0; i < eventsByPollManager.Length; i++)
|
||||
{
|
||||
eventsByPollManager[i] = new List<PollEvent>();
|
||||
eventsByPollManager[i] = [];
|
||||
|
||||
foreach (PollEvent evnt in events)
|
||||
{
|
||||
@@ -377,12 +377,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
||||
events[i] = new PollEvent(pollEventData, fileDescriptor);
|
||||
}
|
||||
|
||||
List<PollEvent> discoveredEvents = new();
|
||||
List<PollEvent> discoveredEvents = [];
|
||||
List<PollEvent>[] eventsByPollManager = new List<PollEvent>[_pollManagers.Count];
|
||||
|
||||
for (int i = 0; i < eventsByPollManager.Length; i++)
|
||||
{
|
||||
eventsByPollManager[i] = new List<PollEvent>();
|
||||
eventsByPollManager[i] = [];
|
||||
|
||||
foreach (PollEvent evnt in events)
|
||||
{
|
||||
|
||||
@@ -19,14 +19,15 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Proxy
|
||||
[GeneratedRegex(@"^accounts\.nintendo\.com$", RegexOpts)]
|
||||
private static partial Regex BlockedHost6();
|
||||
|
||||
private static readonly Regex[] _blockedHosts = {
|
||||
private static readonly Regex[] _blockedHosts =
|
||||
[
|
||||
BlockedHost1(),
|
||||
BlockedHost2(),
|
||||
BlockedHost3(),
|
||||
BlockedHost4(),
|
||||
BlockedHost5(),
|
||||
BlockedHost6(),
|
||||
};
|
||||
BlockedHost6()
|
||||
];
|
||||
|
||||
public static bool IsHostBlocked(string host)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Proxy
|
||||
continue;
|
||||
}
|
||||
|
||||
string[] entry = line.Split(new[] { ' ', '\t' }, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
||||
string[] entry = line.Split([' ', '\t'], StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
// Hosts file example entry:
|
||||
// 127.0.0.1 localhost loopback
|
||||
@@ -92,9 +92,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Proxy
|
||||
|
||||
return new IPHostEntry
|
||||
{
|
||||
AddressList = new[] { hostEntry.Value },
|
||||
AddressList = [hostEntry.Value],
|
||||
HostName = hostEntry.Key,
|
||||
Aliases = Array.Empty<string>(),
|
||||
Aliases = [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,11 +32,12 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
||||
private const long AverageSecondsPerYear = 31556952;
|
||||
private const long SecondsPerRepeat = YearsPerRepeat * AverageSecondsPerYear;
|
||||
|
||||
private static readonly int[] _yearLengths = { DaysPerNYear, DaysPerLYear };
|
||||
private static readonly int[][] _monthsLengths = {
|
||||
new[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
|
||||
new[] { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
|
||||
};
|
||||
private static readonly int[] _yearLengths = [DaysPerNYear, DaysPerLYear];
|
||||
private static readonly int[][] _monthsLengths =
|
||||
[
|
||||
[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
||||
[31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
||||
];
|
||||
|
||||
private static ReadOnlySpan<byte> TimeZoneDefaultRule => ",M4.1.0,M10.5.0"u8;
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
||||
|
||||
StreamReader reader = new(binaryListFile.Get.AsStream());
|
||||
|
||||
List<string> locationNameList = new();
|
||||
List<string> locationNameList = [];
|
||||
|
||||
string locationName;
|
||||
while ((locationName = reader.ReadLine()) != null)
|
||||
@@ -112,7 +112,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
||||
}
|
||||
else
|
||||
{
|
||||
LocationNameCache = new[] { "UTC" };
|
||||
LocationNameCache = ["UTC"];
|
||||
|
||||
Logger.Error?.Print(LogClass.ServiceTime, TimeZoneSystemTitleMissingErrorMessage);
|
||||
}
|
||||
@@ -124,10 +124,10 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
||||
|
||||
if (string.IsNullOrEmpty(tzBinaryContentPath))
|
||||
{
|
||||
return new[] { (0, "UTC", "UTC") };
|
||||
return [(0, "UTC", "UTC")];
|
||||
}
|
||||
|
||||
List<(int Offset, string Location, string Abbr)> outList = new();
|
||||
List<(int Offset, string Location, string Abbr)> outList = [];
|
||||
var now = DateTimeOffset.Now.ToUnixTimeSeconds();
|
||||
using (IStorage ncaStorage = new LocalStorage(VirtualFileSystem.SwitchPathToSystemPath(tzBinaryContentPath), FileAccess.Read, FileMode.Open))
|
||||
using (IFileSystem romfs = new Nca(_virtualFileSystem.KeySet, ncaStorage).OpenFileSystem(NcaSectionType.Data, _fsIntegrityCheckLevel))
|
||||
@@ -217,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
||||
|
||||
public ResultCode LoadLocationNameList(uint index, out string[] outLocationNameArray, uint maxLength)
|
||||
{
|
||||
List<string> locationNameList = new();
|
||||
List<string> locationNameList = [];
|
||||
|
||||
for (int i = 0; i < LocationNameCache.Length && i < maxLength; i++)
|
||||
{
|
||||
@@ -231,7 +231,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
||||
// If the location name is too long, error out.
|
||||
if (locationName.Length > 0x24)
|
||||
{
|
||||
outLocationNameArray = Array.Empty<string>();
|
||||
outLocationNameArray = [];
|
||||
|
||||
return ResultCode.LocationNameTooLong;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ namespace Ryujinx.HLE.HOS.SystemState
|
||||
{
|
||||
public class SystemStateMgr
|
||||
{
|
||||
internal static string[] LanguageCodes = {
|
||||
internal static string[] LanguageCodes =
|
||||
[
|
||||
"ja",
|
||||
"en-US",
|
||||
"fr",
|
||||
@@ -22,8 +23,8 @@ namespace Ryujinx.HLE.HOS.SystemState
|
||||
"es-419",
|
||||
"zh-Hans",
|
||||
"zh-Hant",
|
||||
"pt-BR",
|
||||
};
|
||||
"pt-BR"
|
||||
];
|
||||
|
||||
internal long DesiredKeyboardLayout { get; private set; }
|
||||
|
||||
|
||||
@@ -26,12 +26,13 @@ namespace Ryujinx.HLE.HOS.Tamper
|
||||
|
||||
public ITamperProgram Compile(string name, IEnumerable<string> rawInstructions)
|
||||
{
|
||||
string[] addresses = {
|
||||
string[] addresses =
|
||||
[
|
||||
$" Executable address: 0x{_exeAddress:X16}",
|
||||
$" Heap address : 0x{_heapAddress:X16}",
|
||||
$" Alias address : 0x{_aliasAddress:X16}",
|
||||
$" Aslr address : 0x{_aslrAddress:X16}",
|
||||
};
|
||||
$" Aslr address : 0x{_aslrAddress:X16}"
|
||||
];
|
||||
|
||||
Logger.Debug?.Print(LogClass.TamperMachine, $"Compiling Atmosphere cheat {name}...\n{string.Join('\n', addresses)}");
|
||||
|
||||
|
||||
@@ -73,11 +73,11 @@ namespace Ryujinx.HLE.HOS.Tamper.CodeEmitters
|
||||
|
||||
void Emit(Type operationType, IOperand rhs = null)
|
||||
{
|
||||
List<IOperand> operandList = new()
|
||||
{
|
||||
List<IOperand> operandList =
|
||||
[
|
||||
destinationRegister,
|
||||
leftHandSideRegister,
|
||||
};
|
||||
leftHandSideRegister
|
||||
];
|
||||
|
||||
if (rhs != null)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
||||
var nacpData = new BlitStruct<ApplicationControlProperty>(1);
|
||||
ulong programId = metaLoader.GetProgramId();
|
||||
|
||||
device.Configuration.VirtualFileSystem.ModLoader.CollectMods(new[] { programId });
|
||||
device.Configuration.VirtualFileSystem.ModLoader.CollectMods([programId]);
|
||||
|
||||
if (programId != 0)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
||||
{
|
||||
// Binaries from exefs are loaded into mem in this order. Do not change.
|
||||
public static readonly string[] ExeFsPrefixes =
|
||||
{
|
||||
[
|
||||
"rtld",
|
||||
"main",
|
||||
"subsdk0",
|
||||
@@ -17,8 +17,8 @@ namespace Ryujinx.HLE.Loaders.Processes
|
||||
"subsdk7",
|
||||
"subsdk8",
|
||||
"subsdk9",
|
||||
"sdk",
|
||||
};
|
||||
"sdk"
|
||||
];
|
||||
|
||||
public const string MainNpdmPath = "/main.npdm";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user