yasf(yet another style fix) plus symbols

This commit is contained in:
emmaus 2018-11-18 09:18:55 +00:00
parent 1876a667ce
commit 79132ddfb0
12 changed files with 101 additions and 49 deletions

View file

@ -172,10 +172,8 @@ namespace Ryujinx.HLE.FileSystem
return File.Exists(Name);
}
public long OpenDirectory(string Name, int FilterFlags,out IDirectory DirectoryInterface)
public long OpenDirectory(string Name, int FilterFlags, out IDirectory DirectoryInterface)
{
DirectoryInterface = null;
if (Directory.Exists(Name))
{
DirectoryInterface = new IDirectory(Name, FilterFlags, this);
@ -183,13 +181,13 @@ namespace Ryujinx.HLE.FileSystem
return 0;
}
DirectoryInterface = null;
return MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist);
}
public long OpenFile(string Name, out IFile FileInterface)
{
FileInterface = null;
if (File.Exists(Name))
{
FileStream Stream = new FileStream(Name, FileMode.Open);
@ -199,6 +197,8 @@ namespace Ryujinx.HLE.FileSystem
return 0;
}
FileInterface = null;
return MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist);
}

View file

@ -113,19 +113,18 @@ namespace Ryujinx.HLE.FileSystem
public long OpenFile(string Name, out IFile FileInterface)
{
FileInterface = null;
Name = Name.TrimStart('/');
if (Pfs.FileExists(Name))
{
Stream Stream = Pfs.OpenFile(Name);
FileInterface = new IFile(Stream, Name);
return 0;
}
FileInterface = null;
return MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist);
}

View file

@ -115,8 +115,6 @@ namespace Ryujinx.HLE.FileSystem
public long OpenDirectory(string Name, int FilterFlags, out IDirectory DirectoryInterface)
{
DirectoryInterface = null;
RomfsDir Directory = RomFs.Directories.Find(x => x.Name == Name);
if (Directory != null)
@ -126,13 +124,13 @@ namespace Ryujinx.HLE.FileSystem
return 0;
}
DirectoryInterface = null;
return MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist);
}
public long OpenFile(string Name, out IFile FileInterface)
{
FileInterface = null;
if (RomFs.FileExists(Name))
{
Stream Stream = RomFs.OpenFile(Name);
@ -142,6 +140,8 @@ namespace Ryujinx.HLE.FileSystem
return 0;
}
FileInterface = null;
return MakeError(ErrorModule.Fs, FsErr.PathDoesNotExist);
}

View file

@ -89,7 +89,6 @@ namespace Ryujinx.HLE.HOS.Font
}
NcaFileStream.Dispose();
Nca.Dispose();
return Info;

View file

@ -51,6 +51,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
CurrentItemIndex = 0;
}
// Read() -> (u64 count, buffer<nn::fssrv::sf::IDirectoryEntry, 6, 0> entries)
public long Read(ServiceCtx Context)
{
long BufferPosition = Context.Request.ReceiveBuff[0].Position;
@ -88,6 +89,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
Context.Memory.WriteInt64(Position + 0x308, Entry.Size);
}
// GetEntryCount() -> u64
public long GetEntryCount(ServiceCtx Context)
{
Context.ResponseData.Write((long)DirectoryEntries.Count);

View file

@ -32,6 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
this.HostPath = HostPath;
}
// Read(u32, u64 offset, u64 size) -> (u64 out_size, buffer<u8, 0x46, 0> out_buf)
public long Read(ServiceCtx Context)
{
long Position = Context.Request.ReceiveBuff[0].Position;
@ -53,6 +54,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// Write(u32, u64 offset, u64 size, buffer<u8, 0x45, 0>)
public long Write(ServiceCtx Context)
{
long Position = Context.Request.SendBuff[0].Position;
@ -69,6 +71,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// Flush()
public long Flush(ServiceCtx Context)
{
BaseStream.Flush();
@ -76,6 +79,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// SetSize(u64 size)
public long SetSize(ServiceCtx Context)
{
long Size = Context.RequestData.ReadInt64();
@ -85,6 +89,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// GetSize() -> u64 fileSize
public long GetSize(ServiceCtx Context)
{
Context.ResponseData.Write(BaseStream.Length);

View file

@ -48,6 +48,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
this.Provider = Provider;
}
// CreateFile(u32 mode, u64 size, buffer<bytes<0x301>, 0x19, 0x301> path)
public long CreateFile(ServiceCtx Context)
{
string Name = ReadUtf8String(Context);
@ -75,6 +76,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return Provider.CreateFile(FileName, Size);
}
// DeleteFile(buffer<bytes<0x301>, 0x19, 0x301> path)
public long DeleteFile(ServiceCtx Context)
{
string Name = ReadUtf8String(Context);
@ -94,6 +96,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return Provider.DeleteFile(FileName);
}
// CreateDirectory(buffer<bytes<0x301>, 0x19, 0x301> path)
public long CreateDirectory(ServiceCtx Context)
{
string Name = ReadUtf8String(Context);
@ -120,16 +123,18 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// DeleteDirectory(buffer<bytes<0x301>, 0x19, 0x301> path)
public long DeleteDirectory(ServiceCtx Context)
{
return DeleteDirectory(Context, false);
}
// DeleteDirectoryRecursively(buffer<bytes<0x301>, 0x19, 0x301> path)
public long DeleteDirectoryRecursively(ServiceCtx Context)
{
return DeleteDirectory(Context, true);
}
private long DeleteDirectory(ServiceCtx Context, bool Recursive)
{
string Name = ReadUtf8String(Context);
@ -151,6 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// RenameFile(buffer<bytes<0x301>, 0x19, 0x301> oldPath, buffer<bytes<0x301>, 0x19, 0x301> newPath)
public long RenameFile(ServiceCtx Context)
{
string OldName = ReadUtf8String(Context, 0);
@ -177,6 +183,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return Provider.RenameFile(OldFileName, NewFileName);
}
// RenameDirectory(buffer<bytes<0x301>, 0x19, 0x301> oldPath, buffer<bytes<0x301>, 0x19, 0x301> newPath)
public long RenameDirectory(ServiceCtx Context)
{
string OldName = ReadUtf8String(Context, 0);
@ -203,6 +210,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return Provider.RenameDirectory(OldDirName, NewDirName);
}
// GetEntryType(buffer<bytes<0x301>, 0x19, 0x301> path) -> nn::fssrv::sf::DirectoryEntryType
public long GetEntryType(ServiceCtx Context)
{
string Name = ReadUtf8String(Context);
@ -227,6 +235,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// OpenFile(u32 mode, buffer<bytes<0x301>, 0x19, 0x301> path) -> object<nn::fssrv::sf::IFile> file
public long OpenFile(ServiceCtx Context)
{
int FilterFlags = Context.RequestData.ReadInt32();
@ -265,6 +274,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return Error;
}
// OpenDirectory(u32 filter_flags, buffer<bytes<0x301>, 0x19, 0x301> path) -> object<nn::fssrv::sf::IDirectory> directory
public long OpenDirectory(ServiceCtx Context)
{
int FilterFlags = Context.RequestData.ReadInt32();
@ -300,11 +310,13 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return Error;
}
// Commit()
public long Commit(ServiceCtx Context)
{
return 0;
}
// GetFreeSpaceSize(buffer<bytes<0x301>, 0x19, 0x301> path) -> u64 totalFreeSpace
public long GetFreeSpaceSize(ServiceCtx Context)
{
string Name = ReadUtf8String(Context);
@ -314,6 +326,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// GetTotalSpaceSize(buffer<bytes<0x301>, 0x19, 0x301> path) -> u64 totalSize
public long GetTotalSpaceSize(ServiceCtx Context)
{
string Name = ReadUtf8String(Context);
@ -323,6 +336,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// CleanDirectoryRecursively(buffer<bytes<0x301>, 0x19, 0x301> path)
public long CleanDirectoryRecursively(ServiceCtx Context)
{
string Name = ReadUtf8String(Context);

View file

@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 1, SetCurrentProcess },
{ 1, Initialize },
{ 8, OpenFileSystemWithId },
{ 11, OpenBisFileSystem },
{ 18, OpenSdCardFileSystem },
@ -35,42 +35,14 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
};
}
public long SetCurrentProcess(ServiceCtx Context)
// Initialize(u64, pid)
public long Initialize(ServiceCtx Context)
{
return 0;
}
public long OpenBisFileSystem(ServiceCtx Context)
{
int BisPartitionId = Context.RequestData.ReadInt32();
string PartitionString = ReadUtf8String(Context);
string BisPartitonPath = string.Empty;
switch (BisPartitionId)
{
case 29:
BisPartitonPath = SafeNandPath;
break;
case 30:
case 31:
BisPartitonPath = SystemNandPath;
break;
case 32:
BisPartitonPath = UserNandPath;
break;
default:
return MakeError(ErrorModule.Fs, FsErr.InvalidInput);
}
string FullPath = Context.Device.FileSystem.GetFullPartitionPath(BisPartitonPath);
FileSystemProvider FileSystemProvider = new FileSystemProvider(FullPath, Context.Device.FileSystem.GetBasePath());
MakeObject(Context, new IFileSystem(FullPath, FileSystemProvider));
return 0;
}
// OpenFileSystemWithId(nn::fssrv::sf::FileSystemType filesystem_type, nn::ApplicationId tid, buffer<bytes<0x301>, 0x19, 0x301> path)
// -> object<nn::fssrv::sf::IFileSystem> contentFs
public long OpenFileSystemWithId(ServiceCtx Context)
{
FileSystemType FileSystemType = (FileSystemType)Context.RequestData.ReadInt32();
@ -103,6 +75,39 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return MakeError(ErrorModule.Fs, FsErr.InvalidInput);
}
// OpenBisFileSystem(nn::fssrv::sf::Partition partitionID, buffer<bytes<0x301>, 0x19, 0x301>) -> object<nn::fssrv::sf::IFileSystem> Bis
public long OpenBisFileSystem(ServiceCtx Context)
{
int BisPartitionId = Context.RequestData.ReadInt32();
string PartitionString = ReadUtf8String(Context);
string BisPartitonPath = string.Empty;
switch (BisPartitionId)
{
case 29:
BisPartitonPath = SafeNandPath;
break;
case 30:
case 31:
BisPartitonPath = SystemNandPath;
break;
case 32:
BisPartitonPath = UserNandPath;
break;
default:
return MakeError(ErrorModule.Fs, FsErr.InvalidInput);
}
string FullPath = Context.Device.FileSystem.GetFullPartitionPath(BisPartitonPath);
FileSystemProvider FileSystemProvider = new FileSystemProvider(FullPath, Context.Device.FileSystem.GetBasePath());
MakeObject(Context, new IFileSystem(FullPath, FileSystemProvider));
return 0;
}
// OpenSdCardFileSystem() -> object<nn::fssrv::sf::IFileSystem>
public long OpenSdCardFileSystem(ServiceCtx Context)
{
string SdCardPath = Context.Device.FileSystem.GetSdCardPath();
@ -114,6 +119,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// OpenSaveDataFileSystem(u8 save_data_space_id, nn::fssrv::sf::SaveStruct saveStruct) -> object<nn::fssrv::sf::IFileSystem> saveDataFs
public long OpenSaveDataFileSystem(ServiceCtx Context)
{
LoadSaveDataFileSystem(Context);
@ -121,6 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// OpenSaveDataFileSystemBySystemSaveDataId(u8 save_data_space_id, nn::fssrv::sf::SaveStruct saveStruct) -> object<nn::fssrv::sf::IFileSystem> systemSaveDataFs
public long OpenSaveDataFileSystemBySystemSaveDataId(ServiceCtx Context)
{
LoadSaveDataFileSystem(Context);
@ -128,6 +135,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// OpenDataStorageByCurrentProcess() -> object<nn::fssrv::sf::IStorage> dataStorage
public long OpenDataStorageByCurrentProcess(ServiceCtx Context)
{
MakeObject(Context, new IStorage(Context.Device.FileSystem.RomFs));
@ -135,6 +143,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// OpenDataStorageByDataId(u8 storageId, nn::ApplicationId tid) -> object<nn::fssrv::sf::IStorage> dataStorage
public long OpenDataStorageByDataId(ServiceCtx Context)
{
StorageId StorageId = (StorageId)Context.RequestData.ReadByte();
@ -190,6 +199,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
throw new FileNotFoundException($"System archive with titleid {TitleId:x16} was not found on Storage {StorageId}. Found in {InstalledStorage}.");
}
// OpenPatchDataStorageByCurrentProcess() -> object<nn::fssrv::sf::IStorage>
public long OpenPatchDataStorageByCurrentProcess(ServiceCtx Context)
{
MakeObject(Context, new IStorage(Context.Device.FileSystem.RomFs));
@ -197,6 +207,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// GetGlobalAccessLogMode() -> u32 logMode
public long GetGlobalAccessLogMode(ServiceCtx Context)
{
Context.ResponseData.Write(0);

View file

@ -22,6 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
this.BaseStream = BaseStream;
}
// Read(u64 offset, u64 length) -> buffer<u8, 0x46, 0> buffer
public long Read(ServiceCtx Context)
{
long Offset = Context.RequestData.ReadInt64();

View file

@ -43,6 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
this.StorageId = StorageId;
}
// DeleteInfoHtmlNcaPath()
public long DeleteInfoHtmlNcaPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -52,6 +53,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// DeleteDocHtmlNcaPath()
public long DeleteDocHtmlNcaPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -61,6 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// DeleteControlNcaPath()
public long DeleteControlNcaPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -70,6 +73,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// DeleteProgramNcaPath()
public long DeleteProgramNcaPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -79,6 +83,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// ClearLocationResolver2()
public long ClearLocationResolver2(ServiceCtx Context)
{
Context.Device.System.ContentManager.RefreshEntries(StorageId, 1);
@ -86,6 +91,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// SetProgramNcaPath2()
public long SetProgramNcaPath2(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -95,6 +101,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// RedirectApplicationControlPath()
public long RedirectApplicationControlPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -104,6 +111,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// RedirectApplicationHtmlDocumentPath()
public long RedirectApplicationHtmlDocumentPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -113,6 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// RedirectApplicationLegalInformationPath()
public long RedirectApplicationLegalInformationPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -122,6 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// ResolveDataPath()
public long ResolveDataPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -136,6 +146,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
}
}
// ResolveApplicationHtmlDocumentPath()
public long ResolveApplicationHtmlDocumentPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -150,6 +161,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
}
}
// ResolveApplicationLegalInformationPath()
public long ResolveApplicationLegalInformationPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -164,6 +176,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
}
}
// ResolveApplicationControlPath()
public long ResolveApplicationControlPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -178,6 +191,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
}
}
// RedirectProgramPath()
public long RedirectProgramPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -187,6 +201,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// Refresh()
public long Refresh(ServiceCtx Context)
{
Context.Device.System.ContentManager.RefreshEntries(StorageId, 1);
@ -194,6 +209,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
return 0;
}
// ResolveProgramPath()
public long ResolveProgramPath(ServiceCtx Context)
{
long TitleId = Context.RequestData.ReadInt64();
@ -210,8 +226,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
private void RedirectPath(ServiceCtx Context, long TitleId, int Flag, ContentType ContentType)
{
string ContentPath = ReadUtf8String(Context);
string ContentPath = ReadUtf8String(Context);
LocationEntry NewLocation = new LocationEntry(ContentPath, Flag, TitleId, ContentType);
Context.Device.System.ContentManager.RedirectLocation(NewLocation, StorageId);

View file

@ -19,6 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Lr
};
}
// OpenLocationResolver()
private long OpenLocationResolver(ServiceCtx Context)
{
StorageId StorageId = (StorageId)Context.RequestData.ReadByte();

View file

@ -28,11 +28,13 @@ namespace Ryujinx.HLE.HOS.Services.Set
};
}
// GetFirmwareVersion() -> buffer<nn::settings::system::FirmwareVersion, 0x1a, 0x100>
public static long GetFirmwareVersion(ServiceCtx Context)
{
return GetFirmwareVersion2(Context);
}
// GetFirmwareVersion2() -> buffer<nn::settings::system::FirmwareVersion, 0x1a, 0x100>
public static long GetFirmwareVersion2(ServiceCtx Context)
{
long ReplyPos = Context.Request.RecvListBuff[0].Position;
@ -91,6 +93,7 @@ namespace Ryujinx.HLE.HOS.Services.Set
return 0;
}
// GetColorSetId() -> i32
public static long GetColorSetId(ServiceCtx Context)
{
Context.ResponseData.Write((int)Context.Device.System.State.ThemeColor);
@ -98,6 +101,7 @@ namespace Ryujinx.HLE.HOS.Services.Set
return 0;
}
// GetColorSetId() -> i32
public static long SetColorSetId(ServiceCtx Context)
{
int ColorSetId = Context.RequestData.ReadInt32();
@ -107,6 +111,7 @@ namespace Ryujinx.HLE.HOS.Services.Set
return 0;
}
// GetSettingsItemValue(buffer<nn::settings::SettingsName, 0x19, 0x48>, buffer<nn::settings::SettingsItemKey, 0x19, 0x48>) -> (u64, buffer<unknown, 6, 0>)
public static long GetSettingsItemValue(ServiceCtx Context)
{
long ClassPos = Context.Request.PtrBuff[0].Position;