From 1ed524dabcecae0023d07df12c4591f788f59a89 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Wed, 16 Oct 2019 11:58:21 -0500 Subject: [PATCH] Alignment and spacing --- Ryujinx.HLE/HOS/Horizon.cs | 7 ++++--- Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs | 4 ++-- Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs | 4 ++-- .../HOS/Services/Time/TimeZone/TimeZoneContentManager.cs | 5 +++-- Ryujinx/Ui/ApplicationLibrary.cs | 4 ++++ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 5030000d51..438c337b9c 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -235,14 +235,15 @@ namespace Ryujinx.HLE.HOS TimeServiceManager.Instance.SetupEphemeralNetworkSystemClock(); - LocalFileSystem baseFs = new LocalFileSystem(device.FileSystem.GetBasePath()); - DefaultFsServerObjects fsServerObjects = DefaultFsServerObjects.GetDefaultEmulatedCreators(baseFs, KeySet); + LocalFileSystem serverBaseFs = new LocalFileSystem(device.FileSystem.GetBasePath()); + + DefaultFsServerObjects fsServerObjects = DefaultFsServerObjects.GetDefaultEmulatedCreators(serverBaseFs, KeySet); GameCard = fsServerObjects.GameCard; FileSystemServerConfig fsServerConfig = new FileSystemServerConfig { - FsCreators = fsServerObjects.FsCreators, + FsCreators = fsServerObjects.FsCreators, DeviceOperator = fsServerObjects.DeviceOperator, ExternalKeySet = KeySet.ExternalKeySet }; diff --git a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs index 12106e2a15..c042ed8e96 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/FileSystemProxy/IDirectory.cs @@ -21,8 +21,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy long bufferPosition = context.Request.ReceiveBuff[0].Position; long bufferLen = context.Request.ReceiveBuff[0].Size; - byte[] entriesBytes = new byte[bufferLen]; - Span entries = MemoryMarshal.Cast(entriesBytes); + byte[] entriesBytes = new byte[bufferLen]; + Span entries = MemoryMarshal.Cast(entriesBytes); Result result = _baseDirectory.Read(out long entriesRead, entries); diff --git a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs index 9cc1939247..0f173f0a9f 100644 --- a/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/Fs/IFileSystemProxy.cs @@ -136,8 +136,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs // OpenGameCardStorage(u32, u32) -> object public ResultCode OpenGameCardStorage(ServiceCtx context) { - GameCardHandle handle = new GameCardHandle(context.RequestData.ReadInt32()); - GameCardPartitionRaw partitionId = (GameCardPartitionRaw) context.RequestData.ReadInt32(); + GameCardHandle handle = new GameCardHandle(context.RequestData.ReadInt32()); + GameCardPartitionRaw partitionId = (GameCardPartitionRaw)context.RequestData.ReadInt32(); Result result = _baseFileSystemProxy.OpenGameCardStorage(out LibHac.Fs.IStorage storage, handle, partitionId); if (result.IsFailure()) return (ResultCode)result.Value; diff --git a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs index 1dc2958da3..d5a83d8f4f 100644 --- a/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs @@ -1,4 +1,5 @@ -using LibHac.Fs; +using LibHac; +using LibHac.Fs; using LibHac.FsSystem; using LibHac.FsSystem.NcaUtils; using Ryujinx.Common.Logging; @@ -8,7 +9,7 @@ using Ryujinx.HLE.Resource; using Ryujinx.HLE.Utilities; using System.Collections.Generic; using System.IO; -using LibHac; + using static Ryujinx.HLE.HOS.Services.Time.TimeZone.TimeZoneRule; namespace Ryujinx.HLE.HOS.Services.Time.TimeZone diff --git a/Ryujinx/Ui/ApplicationLibrary.cs b/Ryujinx/Ui/ApplicationLibrary.cs index 42e60c7ca0..7ec3cb8060 100644 --- a/Ryujinx/Ui/ApplicationLibrary.cs +++ b/Ryujinx/Ui/ApplicationLibrary.cs @@ -154,6 +154,7 @@ namespace Ryujinx.UI try { controlFs.OpenFile(out IFile icon, $"/icon_{DesiredTitleLanguage}.dat", OpenMode.Read).ThrowIfFailure(); + using (MemoryStream stream = new MemoryStream()) { icon.AsStream().CopyTo(stream); @@ -170,6 +171,7 @@ namespace Ryujinx.UI } controlFs.OpenFile(out IFile icon, entry.FullPath, OpenMode.Read).ThrowIfFailure(); + using (MemoryStream stream = new MemoryStream()) { icon.AsStream().CopyTo(stream); @@ -362,7 +364,9 @@ namespace Ryujinx.UI foreach (DirectoryEntryEx fileEntry in Pfs.EnumerateEntries("/", "*.nca")) { Pfs.OpenFile(out IFile ncaFile, fileEntry.FullPath, OpenMode.Read).ThrowIfFailure(); + Nca nca = new Nca(KeySet, ncaFile.AsStorage()); + if (nca.Header.ContentType == NcaContentType.Control) { controlNca = nca;