diff --git a/Directory.Packages.props b/Directory.Packages.props index 50004350a..37dcd292a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -40,7 +40,7 @@ - + diff --git a/nuget.config b/nuget.config index 80f5bd7fc..821d83c99 100644 --- a/nuget.config +++ b/nuget.config @@ -1,7 +1,22 @@  + - - - - + + + + + + + + + + + + + + + + + diff --git a/src/Ryujinx.HLE/FileSystem/EncryptedFileSystemCreator.cs b/src/Ryujinx.HLE/FileSystem/EncryptedFileSystemCreator.cs index 64b02a282..d9f7d5dcf 100644 --- a/src/Ryujinx.HLE/FileSystem/EncryptedFileSystemCreator.cs +++ b/src/Ryujinx.HLE/FileSystem/EncryptedFileSystemCreator.cs @@ -9,7 +9,7 @@ namespace Ryujinx.HLE.FileSystem public class EncryptedFileSystemCreator : IEncryptedFileSystemCreator { public Result Create(ref SharedRef outEncryptedFileSystem, - ref SharedRef baseFileSystem, IEncryptedFileSystemCreator.KeyId idIndex, + ref readonly SharedRef baseFileSystem, IEncryptedFileSystemCreator.KeyId idIndex, in EncryptionSeed encryptionSeed) { if (idIndex < IEncryptedFileSystemCreator.KeyId.Save || idIndex > IEncryptedFileSystemCreator.KeyId.CustomStorage) @@ -18,7 +18,7 @@ namespace Ryujinx.HLE.FileSystem } // TODO: Reenable when AesXtsFileSystem is fixed. - outEncryptedFileSystem = SharedRef.CreateMove(ref baseFileSystem); + outEncryptedFileSystem = SharedRef.CreateMove(ref baseFileSystem.Ref); return Result.Success; } diff --git a/src/Ryujinx.HLE/HOS/ModLoader.cs b/src/Ryujinx.HLE/HOS/ModLoader.cs index 2e8798009..6d6da6240 100644 --- a/src/Ryujinx.HLE/HOS/ModLoader.cs +++ b/src/Ryujinx.HLE/HOS/ModLoader.cs @@ -791,7 +791,7 @@ namespace Ryujinx.HLE.HOS { string buildId = p switch { - NsoExecutable nso => Convert.ToHexString(nso.BuildId.ItemsRo.ToArray()).TrimEnd('0'), + NsoExecutable nso => Convert.ToHexString(nso.BuildId).TrimEnd('0'), NroExecutable nro => Convert.ToHexString(nro.Header.BuildId).TrimEnd('0'), _ => string.Empty, }; diff --git a/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index d353ce64f..dcd55d579 100644 --- a/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/src/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -753,17 +753,9 @@ namespace Ryujinx.HLE.HOS.Services.Fs public ResultCode OpenCloudBackupWorkStorageFileSystem(ServiceCtx context) { CloudBackupWorkStorageId storageId = (CloudBackupWorkStorageId)context.RequestData.ReadInt32(); - using SharedRef fileSystem = new(); - - Result result = _baseFileSystemProxy.Get.OpenCloudBackupWorkStorageFileSystem(ref fileSystem.Ref, storageId); - if (result.IsFailure()) - { - return (ResultCode)result.Value; - } - - MakeObject(context, new FileSystemProxy.IFileSystem(ref fileSystem.Ref)); - - return ResultCode.Success; + + Logger.Stub?.PrintStub(LogClass.ServiceFs, new { storageId }); + throw new NotImplementedException(); // reimplementing behavior from LibHac 0.19.0 } [CommandCmif(130)] @@ -1028,7 +1020,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context); - Result result = _baseFileSystemProxy.Get.GetRightsIdByPath(out RightsId rightsId, in path); + Result result = _baseFileSystemProxy.Get.GetRightsIdAndKeyGenerationByPath(out RightsId rightsId, out _, in path, ContentAttributes.None); if (result.IsFailure()) { return (ResultCode)result.Value; @@ -1044,7 +1036,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs { ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context); - Result result = _baseFileSystemProxy.Get.GetRightsIdAndKeyGenerationByPath(out RightsId rightsId, out byte keyGeneration, in path); + Result result = _baseFileSystemProxy.Get.GetRightsIdAndKeyGenerationByPath(out RightsId rightsId, out byte keyGeneration, in path, ContentAttributes.None); if (result.IsFailure()) { return (ResultCode)result.Value; @@ -1240,8 +1232,10 @@ namespace Ryujinx.HLE.HOS.Services.Fs { BisPartitionId partitionId = (BisPartitionId)context.RequestData.ReadInt32(); ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context); - - return (ResultCode)_baseFileSystemProxy.Get.SetBisRootForHost(partitionId, in path).Value; + + Logger.Stub?.PrintStub(LogClass.ServiceFs, new { partitionId, path }); + + throw new NotImplementedException(); // reimplementing behavior from LibHac 0.19.0 } [CommandCmif(1001)] diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/INetworkClient.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/INetworkClient.cs index 028ab6cfc..4254ba887 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/INetworkClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/INetworkClient.cs @@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator NetworkError ConnectPrivate(ConnectPrivateRequest request); ResultCode Reject(DisconnectReason disconnectReason, uint nodeId); NetworkInfo[] Scan(ushort channel, ScanFilter scanFilter); - void SetGameVersion(byte[] versionString); + void SetGameVersion(ReadOnlySpan versionString); void SetStationAcceptPolicy(AcceptPolicy acceptPolicy); void SetAdvertiseData(byte[] data); bool CreateNetwork(CreateAccessPointRequest request, byte[] advertiseData); diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index 9f7e6206b..ef898a611 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator // TODO: Call nn::arp::GetApplicationControlProperty here when implemented. ApplicationControlProperty controlProperty = context.Device.Processes.ActiveApplication.ApplicationControlProperties; - foreach (ulong localCommunicationId in controlProperty.LocalCommunicationId.ItemsRo) + foreach (ulong localCommunicationId in controlProperty.LocalCommunicationId) { if (localCommunicationId == localCommunicationIdChecked) { @@ -1114,7 +1114,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator } // TODO: Call nn::arp::GetApplicationLaunchProperty here when implemented. - NetworkClient.SetGameVersion(context.Device.Processes.ActiveApplication.ApplicationControlProperties.DisplayVersion.Items.ToArray()); + NetworkClient.SetGameVersion(context.Device.Processes.ActiveApplication.ApplicationControlProperties.DisplayVersion); resultCode = ResultCode.Success; diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnDisabledClient.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnDisabledClient.cs index cb9f47359..e7a874895 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnDisabledClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnDisabledClient.cs @@ -61,7 +61,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator public void SetAdvertiseData(byte[] data) { } - public void SetGameVersion(byte[] versionString) { } + public void SetGameVersion(ReadOnlySpan versionString) { } public void SetStationAcceptPolicy(AcceptPolicy acceptPolicy) { } diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LdnMitmClient.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LdnMitmClient.cs index 35fc783c2..12a15e491 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LdnMitmClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LdnMitmClient.cs @@ -85,7 +85,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm _lanDiscovery.SetAdvertiseData(data); } - public void SetGameVersion(byte[] versionString) + public void SetGameVersion(ReadOnlySpan versionString) { // NOTE: This method is not implemented in ldn_mitm Logger.Stub?.PrintMsg(LogClass.ServiceLdn, "LdnMitmClient SetGameVersion"); diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs index c2bbcb471..91af49d14 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/LdnMasterProxyClient.cs @@ -346,9 +346,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu } } - public void SetGameVersion(byte[] versionString) + public void SetGameVersion(ReadOnlySpan versionString) { - _gameVersion = versionString; + _gameVersion = versionString.ToArray(); if (_gameVersion.Length < 0x10) { diff --git a/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs b/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs index 9b026a1c3..c6e89b417 100644 --- a/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs @@ -55,7 +55,13 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory _titleId = titleId; // TODO: Call nn::arp::GetApplicationControlProperty here when implemented, if it return ResultCode.Success we assign fields. - _ratingAge = Array.ConvertAll(context.Device.Processes.ActiveApplication.ApplicationControlProperties.RatingAge.ItemsRo.ToArray(), Convert.ToInt32); + _ratingAge = new int[context.Device.Processes.ActiveApplication.ApplicationControlProperties.RatingAge.Length]; + + for (int i = 0; i < _ratingAge.Length; i++) + { + _ratingAge[i] = Convert.ToInt32(context.Device.Processes.ActiveApplication.ApplicationControlProperties.RatingAge[i]); + } + _parentalControlFlag = context.Device.Processes.ActiveApplication.ApplicationControlProperties.ParentalControlFlag; } } diff --git a/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs b/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs index 701cdd94e..b34ff0476 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs @@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pdm.QueryService // Check if input title ids are in the whitelist. foreach (ulong titleId in titleIds) { - if (!context.Device.Processes.ActiveApplication.ApplicationControlProperties.PlayLogQueryableApplicationId.ItemsRo.Contains(titleId)) + if (!context.Device.Processes.ActiveApplication.ApplicationControlProperties.PlayLogQueryableApplicationId.AsReadOnlySpan().Contains(titleId)) { return (ResultCode)Am.ResultCode.ObjectInvalid; } diff --git a/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs b/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs index dec52e2e3..23faca9d1 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/Extensions/FileSystemExtensions.cs @@ -91,7 +91,13 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions if (string.IsNullOrWhiteSpace(programName)) { - programName = Array.Find(nacpData.Value.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString(); + foreach (ApplicationControlProperty.ApplicationTitle appTitle in nacpData.Value.Title) + { + if (appTitle.Name[0] != 0) + continue; + + programName = appTitle.NameString.ToString(); + } } } diff --git a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs index 3ff26196f..16dc1ae82 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs @@ -202,7 +202,13 @@ namespace Ryujinx.HLE.Loaders.Processes if (string.IsNullOrWhiteSpace(programName)) { - programName = Array.Find(nacpData.Value.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString(); + foreach (ApplicationControlProperty.ApplicationTitle nacpTitles in nacpData.Value.Title) + { + if (nacpTitles.Name[0] != 0) + continue; + + programName = nacpTitles.NameString.ToString(); + } } if (nacpData.Value.PresenceGroupId != 0) diff --git a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs index cedd11ae9..5729052e8 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoaderHelper.cs @@ -258,7 +258,7 @@ namespace Ryujinx.HLE.Loaders.Processes { buildIds[i] = (executables[i] switch { - NsoExecutable nso => Convert.ToHexString(nso.BuildId.ItemsRo.ToArray()), + NsoExecutable nso => Convert.ToHexString(nso.BuildId), NroExecutable nro => Convert.ToHexString(nro.Header.BuildId), _ => string.Empty }).ToUpper(); diff --git a/src/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs b/src/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs index 6fd9408ed..53ccddc68 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs @@ -59,7 +59,13 @@ namespace Ryujinx.HLE.Loaders.Processes if (string.IsNullOrWhiteSpace(Name)) { - Name = Array.Find(ApplicationControlProperties.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString(); + foreach (ApplicationControlProperty.ApplicationTitle appTitle in ApplicationControlProperties.Title) + { + if (appTitle.Name[0] != 0) + continue; + + Name = appTitle.NameString.ToString(); + } } DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString(); diff --git a/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs b/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs index 0819b86b8..9e288e9a1 100644 --- a/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs +++ b/src/Ryujinx/Systems/AppLibrary/ApplicationData.cs @@ -221,7 +221,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary NsoReader reader = new(); reader.Initialize(nsoFile.Release().AsStorage().AsFile(OpenMode.Read)).ThrowIfFailure(); - return Convert.ToHexString(reader.Header.ModuleId.ItemsRo.ToArray()).Replace("-", string.Empty).ToUpper()[..16]; + return Convert.ToHexString(reader.Header.ModuleId).Replace("-", string.Empty).ToUpper()[..16]; } } } diff --git a/src/Ryujinx/Systems/AppLibrary/ApplicationLibrary.cs b/src/Ryujinx/Systems/AppLibrary/ApplicationLibrary.cs index 8d4b38a81..618bc2b66 100644 --- a/src/Ryujinx/Systems/AppLibrary/ApplicationLibrary.cs +++ b/src/Ryujinx/Systems/AppLibrary/ApplicationLibrary.cs @@ -1367,7 +1367,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary { _ = Enum.TryParse(DesiredLanguage.ToString(), out TitleLanguage desiredTitleLanguage); - if (controlData.Title.ItemsRo.Length > (int)desiredTitleLanguage) + if (controlData.Title.Length > (int)desiredTitleLanguage) { data.Name = controlData.Title[(int)desiredTitleLanguage].NameString.ToString(); data.Developer = controlData.Title[(int)desiredTitleLanguage].PublisherString.ToString(); @@ -1380,7 +1380,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary if (string.IsNullOrWhiteSpace(data.Name)) { - foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title.ItemsRo) + foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title) { if (!controlTitle.NameString.IsEmpty()) { @@ -1393,7 +1393,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary if (string.IsNullOrWhiteSpace(data.Developer)) { - foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title.ItemsRo) + foreach (ref readonly ApplicationControlProperty.ApplicationTitle controlTitle in controlData.Title) { if (!controlTitle.PublisherString.IsEmpty()) { diff --git a/src/Ryujinx/Systems/AppLibrary/LdnGameData.cs b/src/Ryujinx/Systems/AppLibrary/LdnGameData.cs index 6750983d6..895aec222 100644 --- a/src/Ryujinx/Systems/AppLibrary/LdnGameData.cs +++ b/src/Ryujinx/Systems/AppLibrary/LdnGameData.cs @@ -23,7 +23,7 @@ namespace Ryujinx.Ava.Systems.AppLibrary LibHac.Common.FixedArrays.Array8 communicationId = acp.LocalCommunicationId; return new Array(receivedData.Where(game => - communicationId.Items.Contains(game.TitleId.ToULong()) + communicationId.AsReadOnlySpan().Contains(game.TitleId.ToULong()) )); }