hle: Some cleanup (#3210)
* hle: Some cleanup This PR cleaned up a bit the HLE folder and the VirtualFileSystem one, since we use LibHac, we can use some class of it directly instead of duplicate things. The "Content" of VFS folder is removed since it should be handled in the NCM service directly. A larger cleanup should be done later since there is still be duplicated code here and there. * Fix Headless.SDL2 * Addresses gdkchan feedback
This commit is contained in:
parent
ba0171d054
commit
e3b36db71c
35 changed files with 192 additions and 373 deletions
|
@ -2,10 +2,10 @@
|
|||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
||||
using Ryujinx.HLE.HOS.SystemState;
|
||||
using System;
|
||||
|
@ -106,7 +106,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
private string GetMessageText(uint module, uint description, string key)
|
||||
{
|
||||
string binaryTitleContentPath = _horizon.ContentManager.GetInstalledContentPath(ErrorMessageBinaryTitleId, StorageId.NandSystem, NcaContentType.Data);
|
||||
string binaryTitleContentPath = _horizon.ContentManager.GetInstalledContentPath(ErrorMessageBinaryTitleId, StorageId.BuiltInSystem, NcaContentType.Data);
|
||||
|
||||
using (LibHac.Fs.IStorage ncaFileStream = new LocalStorage(_horizon.Device.FileSystem.SwitchPathToSystemPath(binaryTitleContentPath), FileAccess.Read, FileMode.Open))
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ using Ryujinx.Audio.Integration;
|
|||
using Ryujinx.Audio.Output;
|
||||
using Ryujinx.Audio.Renderer.Device;
|
||||
using Ryujinx.Audio.Renderer.Server;
|
||||
using Ryujinx.HLE.FileSystem.Content;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS.Kernel;
|
||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||
using Ryujinx.HLE.HOS.Kernel.Process;
|
||||
|
@ -238,6 +238,7 @@ namespace Ryujinx.HLE.HOS
|
|||
SurfaceFlinger = new SurfaceFlinger(device);
|
||||
|
||||
InitializeAudioRenderer();
|
||||
InitializeServices();
|
||||
}
|
||||
|
||||
private void InitializeAudioRenderer()
|
||||
|
@ -288,7 +289,7 @@ namespace Ryujinx.HLE.HOS
|
|||
AudioManager.Start();
|
||||
}
|
||||
|
||||
public void InitializeServices()
|
||||
private void InitializeServices()
|
||||
{
|
||||
SmServer = new ServerBase(KernelContext, "SmServer", () => new IUserInterface(KernelContext));
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.HLE.FileSystem;
|
||||
using LibHac.Ncm;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Arp
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Arp
|
|||
{
|
||||
TitleId = 0x00,
|
||||
Version = 0x00,
|
||||
BaseGameStorageId = (byte)StorageId.NandSystem,
|
||||
BaseGameStorageId = (byte)StorageId.BuiltInSystem,
|
||||
UpdateGameStorageId = (byte)StorageId.None
|
||||
};
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace Ryujinx.HLE.HOS.Services.Arp
|
|||
{
|
||||
TitleId = context.Device.Application.TitleId,
|
||||
Version = 0x00,
|
||||
BaseGameStorageId = (byte)StorageId.NandSystem,
|
||||
BaseGameStorageId = (byte)StorageId.BuiltInSystem,
|
||||
UpdateGameStorageId = (byte)StorageId.None
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ using LibHac;
|
|||
using LibHac.Common;
|
||||
using LibHac.Fs;
|
||||
using LibHac.Fs.Shim;
|
||||
using LibHac.FsSrv;
|
||||
using LibHac.FsSrv.Impl;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
|
@ -19,7 +18,6 @@ using static Ryujinx.HLE.Utilities.StringUtils;
|
|||
using IFileSystem = LibHac.FsSrv.Sf.IFileSystem;
|
||||
using IStorage = LibHac.FsSrv.Sf.IStorage;
|
||||
using RightsId = LibHac.Fs.RightsId;
|
||||
using StorageId = Ryujinx.HLE.FileSystem.StorageId;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Fs
|
||||
{
|
||||
|
|
|
@ -55,9 +55,11 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
_storage = storage;
|
||||
|
||||
SharedMemory = SharedMemory.Create();
|
||||
|
||||
InitDevices();
|
||||
}
|
||||
|
||||
public void InitDevices()
|
||||
private void InitDevices()
|
||||
{
|
||||
DebugPad = new DebugPadDevice(_device, true);
|
||||
Touchscreen = new TouchDevice(_device, true);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.HLE.FileSystem;
|
||||
using LibHac.Ncm;
|
||||
using Ryujinx.HLE.HOS.Services.Ncm.Lr.LocationResolverManager;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Ncm.Lr
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.FileSystem.Content;
|
||||
using System.Text;
|
||||
|
||||
using static Ryujinx.HLE.Utilities.StringUtils;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using LibHac.Ncm;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Services.Arp;
|
||||
using Ryujinx.HLE.HOS.Services.Nim.ShopServiceAccessServerInterface;
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ using LibHac.Common;
|
|||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.HLE.Exceptions;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.FileSystem.Content;
|
||||
using Ryujinx.HLE.HOS.Kernel.Memory;
|
||||
using Ryujinx.HLE.HOS.Services.Sdb.Pl.Types;
|
||||
using System;
|
||||
|
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pl
|
|||
{
|
||||
if (contentManager.TryGetFontTitle(name, out ulong fontTitle) && contentManager.TryGetFontFilename(name, out string fontFilename))
|
||||
{
|
||||
string contentPath = contentManager.GetInstalledContentPath(fontTitle, StorageId.NandSystem, NcaContentType.Data);
|
||||
string contentPath = contentManager.GetInstalledContentPath(fontTitle, StorageId.BuiltInSystem, NcaContentType.Data);
|
||||
string fontPath = _device.FileSystem.SwitchPathToSystemPath(contentPath);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(fontPath))
|
||||
|
|
|
@ -3,9 +3,9 @@ using LibHac.Common;
|
|||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS.SystemState;
|
||||
using Ryujinx.HLE.Utilities;
|
||||
using System;
|
||||
|
@ -290,7 +290,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
|||
{
|
||||
const ulong SystemVersionTitleId = 0x0100000000000809;
|
||||
|
||||
string contentPath = device.System.ContentManager.GetInstalledContentPath(SystemVersionTitleId, StorageId.NandSystem, NcaContentType.Data);
|
||||
string contentPath = device.System.ContentManager.GetInstalledContentPath(SystemVersionTitleId, StorageId.BuiltInSystem, NcaContentType.Data);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(contentPath))
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.FileSystem.Content;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||
using Ryujinx.HLE.HOS.Services.Spl.Types;
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@ using LibHac.Common;
|
|||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.Exceptions;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.FileSystem.Content;
|
||||
using Ryujinx.HLE.HOS.Services.Ssl.Types;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
|
|||
|
||||
public string GetCertStoreTitleContentPath()
|
||||
{
|
||||
return _contentManager.GetInstalledContentPath(CertStoreTitleId, StorageId.NandSystem, NcaContentType.Data);
|
||||
return _contentManager.GetInstalledContentPath(CertStoreTitleId, StorageId.BuiltInSystem, NcaContentType.Data);
|
||||
}
|
||||
|
||||
public bool HasCertStoreTitle()
|
||||
|
|
|
@ -3,12 +3,12 @@ using LibHac.Common;
|
|||
using LibHac.Fs;
|
||||
using LibHac.Fs.Fsa;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.FsSystem;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.Exceptions;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.FileSystem.Content;
|
||||
using Ryujinx.HLE.HOS.Services.Time.Clock;
|
||||
using Ryujinx.HLE.Utilities;
|
||||
using System;
|
||||
|
@ -241,7 +241,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
|||
|
||||
public string GetTimeZoneBinaryTitleContentPath()
|
||||
{
|
||||
return _contentManager.GetInstalledContentPath(TimeZoneBinaryTitleId, StorageId.NandSystem, NcaContentType.Data);
|
||||
return _contentManager.GetInstalledContentPath(TimeZoneBinaryTitleId, StorageId.BuiltInSystem, NcaContentType.Data);
|
||||
}
|
||||
|
||||
public bool HasTimeZoneBinaryTitle()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue